From af98d46f5a025ae33c60ddb1a5edc753fb714bc5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 17 Jan 2007 10:42:43 +0000 Subject: Updated to fedora-glibc-20070117T0857 --- nis/nss_compat/compat-grp.c | 6 +++++- nis/nss_nis/nis-service.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'nis') 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 diff --git a/nis/nss_nis/nis-service.c b/nis/nss_nis/nis-service.c index 0c176095c8..59a598f296 100644 --- a/nis/nss_nis/nis-service.c +++ b/nis/nss_nis/nis-service.c @@ -271,7 +271,7 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol, /* If the protocol is given, we could try if our NIS server knows about services.byservicename map. If yes, we only need one query. */ - size_t keylen = strlen (name) + 1 + (protocol ? strlen (protocol) : 0); + size_t keylen = strlen (name) + (protocol ? 1 + strlen (protocol) : 0); char key[keylen + 1]; /* key is: "name/proto" */ -- cgit 1.4.1