mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
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
1 changed files with 2 additions and 4 deletions
|
|
@ -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 a new issue