From 3a59574128fb37f58a836f572264d9a27930cb88 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 22 May 2018 11:45:39 -0400 Subject: [PATCH] [users] Factor out command-line to useradd - This is prep-work for #964, which was caused by #955 - Original assumption was that distro's would have a working useradd configuration; @abucodonosor already pointed out that this was probably not the case, but I ignored that. --- src/modules/users/CreateUserJob.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/users/CreateUserJob.cpp b/src/modules/users/CreateUserJob.cpp index d4d299e39..96b14c365 100644 --- a/src/modules/users/CreateUserJob.cpp +++ b/src/modules/users/CreateUserJob.cpp @@ -146,13 +146,12 @@ CreateUserJob::exec() } } - int ec = CalamaresUtils::System::instance()-> - targetEnvCall( { "useradd", - "-m", - "-U", - "-c", - m_fullName, - m_userName } ); + QStringList useradd{ "useradd", "-m", "-U" }; + // TODO: shell-settings + useradd << "-c" << m_fullName; + useradd << m_userName; + + int ec = CalamaresUtils::System::instance()->targetEnvCall( useradd ); if ( ec ) return Calamares::JobResult::error( tr( "Cannot create user %1." ) .arg( m_userName ),