mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-11-16 10:11:26 +00:00
desktop_login: use chpasswd not passwd to set user password
This allows us to use assert_script_run, and be more reliable. Same approach used in _do_install_and_reboot postinstall stuff. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
9392c66b45
commit
24c46489a2
@ -29,9 +29,7 @@ sub adduser {
|
|||||||
assert_script_run "useradd -c '$name' $login";
|
assert_script_run "useradd -c '$name' $login";
|
||||||
if ($password ne "askuser") {
|
if ($password ne "askuser") {
|
||||||
# If we want to create a user with a defined password.
|
# If we want to create a user with a defined password.
|
||||||
type_very_safely "passwd $login\n";
|
assert_script_run "echo '$login:$password' | chpasswd";
|
||||||
type_password $password;
|
|
||||||
type_password $password;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# If we want to create a user without a password,
|
# If we want to create a user without a password,
|
||||||
|
Loading…
Reference in New Issue
Block a user