mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
pw: fix inverted condition in shell_path error handling
This commit is contained in:
1 parent
13f4a37b53
commit
4fd8a69ec6
2 files changed
+2
-2
No files matched your search
@@ -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