diff --git a/src/modules/users/CreateUserJob.cpp b/src/modules/users/CreateUserJob.cpp index 7d4ded545..119028059 100644 --- a/src/modules/users/CreateUserJob.cpp +++ b/src/modules/users/CreateUserJob.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2016, Teo Mrnjavac + * Copyright 2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -153,14 +154,14 @@ CreateUserJob::exec() 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 ), - tr( "useradd terminated with error code %1." ) - .arg( ec ) ); + auto pres = CalamaresUtils::System::instance()->targetEnvCommand( useradd ); + if ( pres.getExitCode() ) + { + cError() << "useradd failed" << pres.getExitCode(); + return pres.explainProcess( useradd, 10 /* bogus timeout */ ); + } - ec = CalamaresUtils::System::instance()-> + int ec = CalamaresUtils::System::instance()-> targetEnvCall( { "usermod", "-aG", defaultGroups,