add missing endusershell() call. Original version was incorrect.

PR: bin/2442
Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
This commit is contained in:
Philippe Charnier 2004-01-18 21:33:25 +00:00
parent d2b7305939
commit c4fe9d664a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124690

View file

@ -180,7 +180,7 @@ __pw_scan(char *bp, struct passwd *pw, int flags)
goto fmt;
p = pw->pw_shell;
if (root && *p) /* empty == /bin/sh */
if (root && *p) { /* empty == /bin/sh */
for (setusershell();;) {
if (!(sh = getusershell())) {
if (flags & _PWSCAN_WARN)
@ -190,6 +190,8 @@ __pw_scan(char *bp, struct passwd *pw, int flags)
if (!strcmp(p, sh))
break;
}
endusershell();
}
if (p[0])
pw->pw_fields |= _PWF_SHELL;