aboutsummaryrefslogtreecommitdiff
path: root/nis
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-01-12 17:59:51 +0000
committerJakub Jelinek <jakub@redhat.com>2007-01-12 17:59:51 +0000
commitcf7056af7bc2447fbf90f6a1fc442710c61d3f8d (patch)
treeb9c15a82c63fa0fe15a6060efa2393bf32850c6e /nis
parent3a055f27811cfe1b76fff6b245e07cdb04cb4a9b (diff)
downloadglibc-cf7056af7bc2447fbf90f6a1fc442710c61d3f8d.tar
glibc-cf7056af7bc2447fbf90f6a1fc442710c61d3f8d.tar.gz
glibc-cf7056af7bc2447fbf90f6a1fc442710c61d3f8d.tar.bz2
glibc-cf7056af7bc2447fbf90f6a1fc442710c61d3f8d.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')
-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