* nis/nss_compat/compat-grp.c (internal_getgrgid_r): Don't

blacklist the group till after we look it up.
This commit is contained in:
Ulrich Drepper 2006-12-22 20:26:56 +00:00
parent fc242bef00
commit 33c6de5801
3 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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.
2006-12-21 Ulrich Drepper <drepper@redhat.com> 2006-12-21 Ulrich Drepper <drepper@redhat.com>
* include/atomic.h (atomic_forced_read): New macro. * include/atomic.h (atomic_forced_read): New macro.

View File

@ -580,13 +580,17 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent,
/* +group */ /* +group */
if (result->gr_name[0] == '+' && result->gr_name[1] != '\0') 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; enum nss_status status;
/* Store the group in the blacklist for the "+" at the end of /* Store the group in the blacklist for the "+" at the end of
/etc/group */ /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, status = getgrnam_plusgroup (&result->gr_name[1], result, ent,
buffer, buflen, errnop); buffer, buflen, errnop);
blacklist_store_name (buf, ent);
if (status == NSS_STATUS_SUCCESS && result->gr_gid == gid) if (status == NSS_STATUS_SUCCESS && result->gr_gid == gid)
break; break;
else else

View File

@ -37,7 +37,7 @@ __pthread_kill (threadid, signo)
/* Not a valid thread handle. */ /* Not a valid thread handle. */
return ESRCH; return ESRCH;
/* Force load of pd->tid into local variable or register. Oherwise /* Force load of pd->tid into local variable or register. Otherwise
if a thread exits between ESRCH test and tgkill, we might return if a thread exits between ESRCH test and tgkill, we might return
EINVAL, because pd->tid would be cleared by the kernel. */ EINVAL, because pd->tid would be cleared by the kernel. */
pid_t tid = atomic_forced_read (pd->tid); pid_t tid = atomic_forced_read (pd->tid);