[users] Read home_permissions setting from config

This commit is contained in:
Adriaan de Groot 2024-09-11 16:23:02 +02:00
parent f5c425345b
commit aa938285a4
2 changed files with 18 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include "JobQueue.h"
#include "compat/Variant.h"
#include "utils/Logger.h"
#include "utils/Permissions.h"
#include "utils/String.h"
#include "utils/StringExpander.h"
#include "utils/Variant.h"
@ -946,6 +947,21 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
m_forbiddenLoginNames = Calamares::getStringList( userSettings, "forbidden_names" );
m_forbiddenLoginNames << alwaysForbiddenLoginNames();
tidy( m_forbiddenLoginNames );
const auto permissionKey = QStringLiteral( "home_permissions" );
if ( userSettings.contains( permissionKey ) )
{
const auto value = Calamares::getString( userSettings, permissionKey );
m_homeDirPermissions = Calamares::parseFileMode( value );
if ( m_homeDirPermissions < 0 )
{
cWarning() << "Setting for" << permissionKey << '(' << value << userSettings[permissionKey] << ") is invalid.";
}
}
else
{
m_homeDirPermissions = -1;
}
}
setAutoLoginGroup( either< QString, const QString& >(

View File

@ -371,6 +371,8 @@ private:
QStringList m_forbiddenLoginNames;
PasswordCheckList m_passwordChecks;
int m_homeDirPermissions = -1;
};
#endif