pw: fix inverted condition in shell_path error handling
This commit is contained in:
@@ -464,7 +464,7 @@ shell_path(char const * path, char *shells[], char *sh)
|
||||
return shellpath;
|
||||
}
|
||||
}
|
||||
if (sh == NULL)
|
||||
if (sh != NULL)
|
||||
errx(EX_OSFILE, "can't find shell `%s' in shell paths", sh);
|
||||
errx(EX_CONFIG, "no default shell available or defined");
|
||||
return NULL;
|
||||
|
||||
@@ -402,7 +402,7 @@ user_add_bad_shell_body() {
|
||||
populate_etc_skel
|
||||
|
||||
atf_check -s exit:0 ${PW} useradd foo -s sh
|
||||
atf_check -s exit:78 -e ignore ${PW} useradd bar -s badshell
|
||||
atf_check -s exit:72 -e inline:"pw: can't find shell \`badshell' in shell paths\n" ${PW} useradd bar -s badshell
|
||||
}
|
||||
|
||||
atf_test_case user_add_already_exists
|
||||
|
||||
Reference in New Issue
Block a user