about summary refs log tree commit diff
path: root/nis/nss_compat/compat-grp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-12-22 20:26:56 +0000
committerUlrich Drepper <drepper@redhat.com>2006-12-22 20:26:56 +0000
commit33c6de5801caeb9087c19f265e8af71309743445 (patch)
tree1d1f18fb27a48affa666c621c39dbc06bd8aad6a /nis/nss_compat/compat-grp.c
parentfc242bef00206c3bab4117345734ce744f0b7eff (diff)
downloadglibc-33c6de5801caeb9087c19f265e8af71309743445.tar.gz
glibc-33c6de5801caeb9087c19f265e8af71309743445.tar.xz
glibc-33c6de5801caeb9087c19f265e8af71309743445.zip
* nis/nss_compat/compat-grp.c (internal_getgrgid_r): Don't
	blacklist the group till after we look it up.
Diffstat (limited to 'nis/nss_compat/compat-grp.c')
-rw-r--r--nis/nss_compat/compat-grp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c
index f2f7195be1..236c84a20f 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