Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > bee470e21a8ce2cdd844d7d805aa403d > files > 151

glibc-2.5-49.el5_5.6.src.rpm

2006-12-22  Gavin Romig-Koch  <gavin@redhat.com>

	* nis/nss_compat/compat-grp.c (internal_getgrgid_r): Don't
	blacklist the group till after we look it up.

--- libc/nis/nss_compat/compat-grp.c	31 Jul 2006 23:33:04 -0000	1.32
+++ libc/nis/nss_compat/compat-grp.c	22 Dec 2006 20:26:11 -0000	1.33
@@ -580,13 +580,17 @@ internal_getgrgid_r (gid_t gid, struct g
       /* +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