From cf7056af7bc2447fbf90f6a1fc442710c61d3f8d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 12 Jan 2007 17:59:51 +0000 Subject: [PATCH] * nis/nss_compat/compat-grp.c (internal_getgrgid_r): Don't blacklist the group till after we look it up. --- ChangeLog | 5 +++++ nis/nss_compat/compat-grp.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f5596363447..0afd09566b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-22 Gavin Romig-Koch + + * nis/nss_compat/compat-grp.c (internal_getgrgid_r): Don't + blacklist the group till after we look it up. + 2006-12-21 Ulrich Drepper * include/atomic.h (atomic_forced_read): New macro. diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c index f2f7195be1f..236c84a20fb 100644 --- a/nis/nss_compat/compat-grp.c +++ b/nis/nss_compat/compat-grp.c @@ -580,13 +580,17 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent, /* +group */ if (result->gr_name[0] == '+' && result->gr_name[1] != '\0') { + /* Yes, no +1, see the memcpy call below. */ + size_t len = strlen (result->gr_name); + char buf[len]; enum nss_status status; /* Store the group in the blacklist for the "+" at the end of /etc/group */ - blacklist_store_name (&result->gr_name[1], ent); + memcpy (buf, &result->gr_name[1], len); status = getgrnam_plusgroup (&result->gr_name[1], result, ent, buffer, buflen, errnop); + blacklist_store_name (buf, ent); if (status == NSS_STATUS_SUCCESS && result->gr_gid == gid) break; else -- 2.47.2