From 71cc8f0764fca8c0979dbbcf51bc9f694d3bc974 Mon Sep 17 00:00:00 2001 From: Jacques Vidrine Date: Fri, 18 Apr 2003 16:24:25 +0000 Subject: [PATCH] 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 eb1825fd3c0a..f00b20bb8e11 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -623,8 +623,12 @@ files_passwd(void *retval, void *mdata, va_list ap) (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); }