From b41f585c1a9bcdc3a397544aecd1fb50b476bd09 Mon Sep 17 00:00:00 2001 From: nectar Date: Fri, 18 Apr 2003 16:24:25 +0000 Subject: Correctly set _PWF_FILES in pw_fields when appropriate. (_PWF_NIS and _PWF_HESIOD were already being set.) Reported by: Shizuka Kudo Sponsored by: DARPA, Network Associates Laboratories --- lib/libc/gen/getpwent.c | 8 ++++++-- 1 file 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); } -- cgit v1.1