summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2004-01-18 21:33:25 +0000
committercharnier <charnier@FreeBSD.org>2004-01-18 21:33:25 +0000
commit30e88bfa384531fd381c11b2ca92b4b13bb7e8fa (patch)
tree728ddc40f4ec3fac63b1867bc6eb9c5b1570b7c0 /lib/libc
parent967828a92a5d736d1332a8716ca5c4ef5b3734cc (diff)
downloadFreeBSD-src-30e88bfa384531fd381c11b2ca92b4b13bb7e8fa.zip
FreeBSD-src-30e88bfa384531fd381c11b2ca92b4b13bb7e8fa.tar.gz
add missing endusershell() call. Original version was incorrect.
PR: bin/2442 Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/pw_scan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/pw_scan.c b/lib/libc/gen/pw_scan.c
index e785511..04cc388 100644
--- a/lib/libc/gen/pw_scan.c
+++ b/lib/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;
OpenPOWER on IntegriCloud