about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-10-01 21:24:29 +0000
committerUlrich Drepper <drepper@redhat.com>2004-10-01 21:24:29 +0000
commit927f0673b3bce7c209071bb5c4e3815f9b1ef0b0 (patch)
tree1859ee41b1ef187590d86f1e8101daa353bbe0fb
parentcb984ef2a284a17e67b9143f4a432df719191004 (diff)
downloadglibc-927f0673b3bce7c209071bb5c4e3815f9b1ef0b0.tar.gz
glibc-927f0673b3bce7c209071bb5c4e3815f9b1ef0b0.tar.xz
glibc-927f0673b3bce7c209071bb5c4e3815f9b1ef0b0.zip
	* nscd/nscd_initgroups.c (__nscd_getgrouplist): Always add the
	group the caller provided unless there is a real problem.
-rw-r--r--ChangeLog3
-rw-r--r--nptl/ChangeLog3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S2
-rw-r--r--nscd/nscd_initgroups.c29
4 files changed, 20 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a4067d481..0deffe0be7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
 
+	* nscd/nscd_initgroups.c (__nscd_getgrouplist): Always add the
+	group the caller provided unless there is a real problem.
+
 	* posix/bug-glob1.c (prepare): Fix creation of symlink.
 
 2004-09-30  Ulrich Drepper  <drepper@redhat.com>
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index cbedbc37f4..85df60f1bd 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,8 @@
 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+	(__lll_mutex_timedlock_wait): Address futex correctly.
+
 	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
 	(__lll_mutex_timedlock_wait): I woken but cannot get the lock,
 	make sure 2 is stored in the futex and we looked at the old value.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 6827804f7f..d5c9345558 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -152,7 +152,7 @@ __lll_mutex_timedlock_wait:
 
 	/* Make sure the current holder knows we are going to sleep.  */
 	movl	%edx, %eax
-	xchgl	%eax, (%ebx)
+	xchgl	%eax, (%rdi)
 	testl	%eax, %eax
 	jz	6b
 	jmp	1b
diff --git a/nscd/nscd_initgroups.c b/nscd/nscd_initgroups.c
index ea32ab6bcc..d6cb00000e 100644
--- a/nscd/nscd_initgroups.c
+++ b/nscd/nscd_initgroups.c
@@ -95,6 +95,7 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
 	 doesn't use memcpy but instead copies each array element one
 	 by one.  */
       assert (sizeof (int32_t) == sizeof (gid_t));
+      assert (initgr_resp->ngrps > 0);
 
       /* Make sure we have enough room.  We always count GROUP in even
 	 though we might not end up adding it.  */
@@ -125,25 +126,21 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
 	  retval = initgr_resp->ngrps;
 	  memcpy (*groupsp, respdata, retval * sizeof (gid_t));
 	}
-
-      /* Check whether GROUP is part of the mix.  If not, add it.  */
-      if (retval >= 0)
-	{
-	  int cnt;
-	  for (cnt = 0; cnt < retval; ++cnt)
-	    if ((*groupsp)[cnt] == group)
-	      break;
-
-	  if (cnt == retval)
-	    (*groupsp)[retval++] = group;
-	}
     }
   else
+    /* No group found yet.   */
+    retval = 0;
+
+  /* Check whether GROUP is part of the mix.  If not, add it.  */
+  if (retval >= 0)
     {
-      /* The `errno' to some value != ERANGE.  */
-      __set_errno (ENOENT);
-      /* Even though we have not found anything, the result is zero.  */
-      retval = 0;
+      int cnt;
+      for (cnt = 0; cnt < retval; ++cnt)
+	if ((*groupsp)[cnt] == group)
+	  break;
+
+      if (cnt == retval)
+	(*groupsp)[retval++] = group;
     }
 
   if (sock != -1)