[users] Read home_permissions setting from config
This commit is contained in:
parent
f5c425345b
commit
aa938285a4
@ -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& >(
|
||||
|
@ -371,6 +371,8 @@ private:
|
||||
QStringList m_forbiddenLoginNames;
|
||||
|
||||
PasswordCheckList m_passwordChecks;
|
||||
|
||||
int m_homeDirPermissions = -1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user