summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-04-18 16:24:25 +0000
committernectar <nectar@FreeBSD.org>2003-04-18 16:24:25 +0000
commitb41f585c1a9bcdc3a397544aecd1fb50b476bd09 (patch)
tree7d88979bad20f0c569bdd06ce017f5e581d40d34 /lib
parent93158f52199caea2e1d81d292165cd51fd0e6032 (diff)
downloadFreeBSD-src-b41f585c1a9bcdc3a397544aecd1fb50b476bd09.zip
FreeBSD-src-b41f585c1a9bcdc3a397544aecd1fb50b476bd09.tar.gz
Correctly set _PWF_FILES in pw_fields when appropriate.
(_PWF_NIS and _PWF_HESIOD were already being set.) Reported by: Shizuka Kudo <shizukakudo_99@yahoo.com> Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getpwent.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index eb1825f..f00b20b 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -623,8 +623,12 @@ fin:
(void)st->db->close(st->db);
st->db = NULL;
}
- if (rv == NS_SUCCESS && retval != NULL)
- *(struct passwd **)retval = pwd;
+ if (rv == NS_SUCCESS) {
+ pwd->pw_fields &= ~_PWF_SOURCE;
+ pwd->pw_fields |= _PWF_FILES;
+ if (retval != NULL)
+ *(struct passwd **)retval = pwd;
+ }
return (rv);
}
OpenPOWER on IntegriCloud