Merge pull request #2194 from AsahiLinux/passwd-fix
[users] Use usermod to disable passwords
This commit is contained in:
commit
e6ce29ed33
@ -83,10 +83,10 @@ SetPasswordJob::exec()
|
||||
|
||||
if ( m_userName == "root" && m_newPassword.isEmpty() ) //special case for disabling root account
|
||||
{
|
||||
int ec = CalamaresUtils::System::instance()->targetEnvCall( { "passwd", "-dl", m_userName } );
|
||||
int ec = CalamaresUtils::System::instance()->targetEnvCall( { "usermod", "-p", "!", m_userName } );
|
||||
if ( ec )
|
||||
return Calamares::JobResult::error( tr( "Cannot disable root account." ),
|
||||
tr( "passwd terminated with error code %1." ).arg( ec ) );
|
||||
tr( "usermod terminated with error code %1." ).arg( ec ) );
|
||||
return Calamares::JobResult::ok();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user