]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2.3.3-65 cvs/fedora-glibc-2_3_3-65
authorJakub Jelinek <jakub@redhat.com>
Tue, 5 Oct 2004 15:43:27 +0000 (15:43 +0000)
committerJakub Jelinek <jakub@redhat.com>
Tue, 5 Oct 2004 15:43:27 +0000 (15:43 +0000)
ChangeLog
grp/initgroups.c
nptl/ChangeLog
nptl/sysdeps/pthread/timer_create.c
nscd/initgrcache.c

index ea4be8811c8e03f4c77a7f0d623f493347f69432..60c8257c4a3bc0a46c23a8401549f0788b75c65d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-05  Ulrich Drepper  <drepper@redhat.com>
+
+       * grp/initgroups.c: Remove duplicate group IDs.
+       * grp/compat-initgroups.c: Likewise.
+       * nscd/initgrcache.c: Likewise.
+
 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Include dl-sysdep.h.
index 5a3edecf09e961fa8fc873d8bb74ee4c7956a83b..d052cf48f7b9bdd4861c7f89e744785bf1bb42a5 100644 (file)
@@ -112,9 +112,9 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
              break;
 
          if (inner < prev_start)
-           ++cnt;
-         else
            (*groupsp)[cnt] = (*groupsp)[--start];
+         else
+           ++cnt;
        }
 
       /* This is really only for debugging.  */
@@ -141,10 +141,10 @@ int
 getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups)
 {
   gid_t *newgroups;
-  long int size = *ngroups;
+  long int size = MAX (1, *ngroups);
   int result;
 
-  newgroups = (gid_t *) malloc (size * sizeof (gid_t));
+  newgroups = (gid_t *) malloc ((size + 1) * sizeof (gid_t));
   if (__builtin_expect (newgroups == NULL, 0))
     /* No more memory.  */
     // XXX This is wrong.  The user provided memory, we have to use
index d52bd5ccc2a07d1a9ccc726075bbfb059fa4503e..908d39383eaa941661fdc9c3639abcc67a8c1ef7 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/pthread/timer_create.c (timer_create): Use
+       defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
+       defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
+       THREAD_CPUTIME.
+
 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
index 57dd39e81b1986463d1b127bb8835f7879ba80f6..2f5a587e8da219ea111f50da0ee9f53458816698 100644 (file)
@@ -38,10 +38,10 @@ timer_create (clock_id, evp, timerid)
   struct thread_node *thread = NULL;
 
   if (0
-#ifdef CLOCK_PROCESS_CPUTIME_ID
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
       || clock_id == CLOCK_PROCESS_CPUTIME_ID
 #endif
-#ifdef CLOCK_THREAD_CPUTIME_ID
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
       || clock_id == CLOCK_THREAD_CPUTIME_ID
 #endif
       )
@@ -100,12 +100,12 @@ timer_create (clock_id, evp, timerid)
        default:
          thread = &__timer_signal_thread_rclk;
          break;
-#ifdef CLOCK_PROCESS_CPUTIME_ID
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
        case CLOCK_PROCESS_CPUTIME_ID:
          thread = &__timer_signal_thread_pclk;
          break;
 #endif
-#ifdef CLOCK_THREAD_CPUTIME_ID
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
        case CLOCK_THREAD_CPUTIME_ID:
          thread = &__timer_signal_thread_tclk;
          break;
index 762167ea198b23989bf39eb8e7d176cae3df4169..b46433716b534f6d98bc1fa78248f1cf53898553 100644 (file)
@@ -144,9 +144,9 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
              break;
 
          if (inner < prev_start)
-           ++cnt;
-         else
            groups[cnt] = groups[--start];
+         else
+           ++cnt;
        }
 
       if (status != NSS_STATUS_TRYAGAIN)