Fix broken su -m behaviour :
chshell must return 0 if the shell is not a standard shell, or else it is possible to use an account without a valid shell. Reviewed by: des
This commit is contained in:
parent
d5e1f581ff
commit
f6a43a2b50
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121236
@ -520,10 +520,8 @@ chshell(char *sh)
|
||||
|
||||
r = 0;
|
||||
setusershell();
|
||||
do {
|
||||
cp = getusershell();
|
||||
r = strcmp(cp, sh);
|
||||
} while (!r && cp != NULL);
|
||||
while ((cp = getusershell()) != NULL && !r)
|
||||
r = (strcmp(cp, sh) == 0);
|
||||
endusershell();
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user