Add user to groups separately from useradd.
This commit is contained in:
parent
37df041b9c
commit
c61e53edf7
@ -153,8 +153,6 @@ CreateUserJob::exec()
|
||||
"-s",
|
||||
"/bin/bash",
|
||||
"-U",
|
||||
"-G",
|
||||
defaultGroups,
|
||||
"-c",
|
||||
m_fullName,
|
||||
m_userName } );
|
||||
@ -164,6 +162,18 @@ CreateUserJob::exec()
|
||||
tr( "useradd terminated with error code %1." )
|
||||
.arg( ec ) );
|
||||
|
||||
ec = CalamaresUtils::System::instance()->
|
||||
targetEnvCall( { "usermod",
|
||||
"-aG",
|
||||
defaultGroups,
|
||||
m_userName } );
|
||||
if ( ec )
|
||||
return Calamares::JobResult::error( tr( "Cannot add user %1 to groups: %2." )
|
||||
.arg( m_userName )
|
||||
.arg( defaultGroups ),
|
||||
tr( "usermod terminated with error code %1." )
|
||||
.arg( ec ) );
|
||||
|
||||
ec = CalamaresUtils::System::instance()->
|
||||
targetEnvCall( { "chown",
|
||||
"-R",
|
||||
|
Loading…
Reference in New Issue
Block a user