Regression: fix pw usermod -w xxx
Reported by: gjb
This commit is contained in:
parent
6cb8dbf791
commit
5770ce6f1d
@ -1645,6 +1645,8 @@ pw_user_mod(int argc, char **argv, char *arg1)
|
||||
if (lc == NULL || login_setcryptfmt(lc, "sha512", NULL) == NULL)
|
||||
warn("setting crypt(3) format");
|
||||
login_close(lc);
|
||||
cnf->default_password = boolean_val(passwd,
|
||||
cnf->default_password);
|
||||
pwd->pw_passwd = pw_password(cnf, pwd->pw_name, dryrun);
|
||||
edited = true;
|
||||
}
|
||||
|
@ -314,6 +314,19 @@ user_add_already_exists_body() {
|
||||
${PW} useradd foo
|
||||
}
|
||||
|
||||
atf_test_case user_add_w_yes
|
||||
user_add_w_yes_body() {
|
||||
populate_etc_skel
|
||||
atf_check -s exit:0 ${PW} useradd foo -w yes
|
||||
atf_check -s exit:0 \
|
||||
-o match:'^foo:\$.*' \
|
||||
grep "^foo" ${HOME}/master.passwd
|
||||
atf_check -s exit:0 ${PW} usermod foo -w yes
|
||||
atf_check -s exit:0 \
|
||||
-o match:'^foo:\$.*' \
|
||||
grep "^foo" ${HOME}/master.passwd
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case user_add
|
||||
atf_add_test_case user_add_noupdate
|
||||
@ -341,4 +354,5 @@ atf_init_test_cases() {
|
||||
atf_add_test_case user_add_uid_too_large
|
||||
atf_add_test_case user_add_bad_shell
|
||||
atf_add_test_case user_add_already_exists
|
||||
atf_add_test_case user_add_w_yes
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user