diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-06-28 07:57:21 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-06-28 07:57:21 +0000 |
commit | bbca27a424c7b9e339b11e1447b2756f3582a59c (patch) | |
tree | c7a969f6e9ac0458494cb70e177f3927e3370a7d /nis/nss_compat/compat-grp.c | |
parent | 1aa43890df5ecc09004007336f64ed1344a9d335 (diff) | |
download | glibc-bbca27a424c7b9e339b11e1447b2756f3582a59c.tar.gz |
Update.
2003-06-07 Thorsten Kukuk <kukuk@suse.de>
* nis/nss_compat/compat-grp.c: Remove unused nis_first variable
(getgrent_next_file) Don't store group name to early in blacklist.
* nis/nss_compat/compat-pwd.c (internal_getpwuid_r): Save strlen result
and use memcpy instead of strcpy.
2003-06-28 Ulrich Drepper <drepper@redhat.com>
* nis/nss_compat/compat-grp.c: Optimize several little things. Use
stream unlocked.
* nis/nss_compat/compat-initgroups.c: Likewise.
* nis/nss_compat/compat-pwd.c: Likewise.
* nis/nss_compat/compat-spwd.c: Likewise.
2003-06-27 Thorsten Kukuk <kukuk@suse.de>
* nis/nss_compat/compat-initgroups.c: Don't use our own NIS/NIS+
functions, dlopen corresponding NSS module instead.
Diffstat (limited to 'nis/nss_compat/compat-grp.c')
-rw-r--r-- | nis/nss_compat/compat-grp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c index a24db336e2..ff19912a0a 100644 --- a/nis/nss_compat/compat-grp.c +++ b/nis/nss_compat/compat-grp.c @@ -58,14 +58,13 @@ struct blacklist_t struct ent_t { - bool_t nis_first; bool_t files; FILE *stream; struct blacklist_t blacklist; }; typedef struct ent_t ent_t; -static ent_t ext_ent = {0, TRUE, NULL, {NULL, 0, 0}}; +static ent_t ext_ent = {TRUE, NULL, {NULL, 0, 0}}; /* Protect global state against multiple changers. */ __libc_lock_define_initialized (static, lock) @@ -304,13 +303,16 @@ getgrent_next_file (struct group *result, ent_t *ent, if (result->gr_name[0] == '+' && result->gr_name[1] != '\0' && result->gr_name[1] != '@') { + 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) /* We found the entry. */ break; else if (status == NSS_STATUS_RETURN /* We couldn't parse the entry */ @@ -472,7 +474,7 @@ enum nss_status _nss_compat_getgrnam_r (const char *name, struct group *grp, char *buffer, size_t buflen, int *errnop) { - ent_t ent = {0, TRUE, NULL, {NULL, 0, 0}}; + ent_t ent = {TRUE, NULL, {NULL, 0, 0}}; enum nss_status result; if (name[0] == '-' || name[0] == '+') @@ -594,7 +596,7 @@ enum nss_status _nss_compat_getgrgid_r (gid_t gid, struct group *grp, char *buffer, size_t buflen, int *errnop) { - ent_t ent = {0, TRUE, NULL, {NULL, 0, 0}}; + ent_t ent = {TRUE, NULL, {NULL, 0, 0}}; enum nss_status result; __libc_lock_lock (lock); |