summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>2004-01-18 21:33:25 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>2004-01-18 21:33:25 +0000
commitcae6d992ea1343a8e952c86544cb57eb32a1788d (patch)
treea1f72b5e316b93d7e833fc266ce84826692aa0a1 /libc
parent7e719aef2bfb501ca96a3993b21219dc67f12ba3 (diff)
downloadpw-darwin-cae6d992ea1343a8e952c86544cb57eb32a1788d.tar.gz
pw-darwin-cae6d992ea1343a8e952c86544cb57eb32a1788d.tar.zst
pw-darwin-cae6d992ea1343a8e952c86544cb57eb32a1788d.zip
add missing endusershell() call. Original version was incorrect.
PR: bin/2442 Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
Diffstat (limited to 'libc')
-rw-r--r--libc/gen/pw_scan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libc/gen/pw_scan.c b/libc/gen/pw_scan.c
index e785511..04cc388 100644
--- a/libc/gen/pw_scan.c
+++ b/libc/gen/pw_scan.c
@@ -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;