aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-30 23:15:55 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-30 23:15:55 +0000
commite0dbb4810552c091065080cb61d631354040f826 (patch)
tree8e4e25519279fd0b3db39e563450325916b28acf
parente98fb1a6172fe54007525523f7a6cb88478d492c (diff)
downloadglibc-e0dbb4810552c091065080cb61d631354040f826.tar
glibc-e0dbb4810552c091065080cb61d631354040f826.tar.gz
glibc-e0dbb4810552c091065080cb61d631354040f826.tar.bz2
glibc-e0dbb4810552c091065080cb61d631354040f826.zip
Update.
* sysdeps/unix/sysv/linux/i386/setgroups.c (setgroups): Avoid comparison with limit if we can rely on the syscall being available.
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgroups.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ea7f0bbb05..c2de3d5a9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2004-03-30 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/unix/sysv/linux/i386/setgroups.c (setgroups): Avoid
+ comparison with limit if we can rely on the syscall being available.
+
* nis/nss_nis/nis-initgroups.c: Implement getting the information
from the netid.byname map if the system administrator allows this.
* nis/Makefile (distribute): Add nss.
diff --git a/sysdeps/unix/sysv/linux/i386/setgroups.c b/sysdeps/unix/sysv/linux/i386/setgroups.c
index 14c8f783b3..a2c6fc8daa 100644
--- a/sysdeps/unix/sysv/linux/i386/setgroups.c
+++ b/sysdeps/unix/sysv/linux/i386/setgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,6 +43,9 @@ extern int __libc_missing_32bit_uids;
int
setgroups (size_t n, const gid_t *groups)
{
+#if __ASSUME_32BITUIDS > 0
+ return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
+#else
if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
{
__set_errno (EINVAL);
@@ -50,9 +53,6 @@ setgroups (size_t n, const gid_t *groups)
}
else
{
-#if __ASSUME_32BITUIDS > 0
- return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
-#else
size_t i;
__kernel_gid_t kernel_groups[n];
@@ -81,7 +81,7 @@ setgroups (size_t n, const gid_t *groups)
}
return INLINE_SYSCALL (setgroups, 2, n, CHECK_N (kernel_groups, n));
-#endif
}
+#endif
}
libc_hidden_def (setgroups)