Blame SOURCES/glibc-rh736346.patch

4999bf
2011-01-14  Ulrich Drepper  <drepper@gmail.com>
4999bf
4999bf
	[BZ #10563]
4999bf
	* sysdeps/unix/sysv/linux/i386/setgroups.c: Use INLINE_SETXID_SYSCALL
4999bf
	to make the syscall.
4999bf
	* sysdeps/unix/sysv/linux/setgroups.c: New file.
4999bf
4999bf
2011-01-14  Ulrich Drepper  <drepper@gmail.com>
4999bf
4999bf
	[BZ #10563]
4999bf
	* sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
4999bf
	(__SETXID_2): Likewise.
4999bf
	(__SETXID_3): Likewise.
4999bf
4999bf
Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/setxid.h
4999bf
===================================================================
4999bf
--- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/pthread/setxid.h
4999bf
+++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/setxid.h
4999bf
@@ -20,11 +20,11 @@
4999bf
 #include <sysdep.h>
4999bf
 
4999bf
 #define __SETXID_1(cmd, arg1) \
4999bf
-  cmd.id[0] = arg1
4999bf
+  cmd.id[0] = (long int) arg1
4999bf
 #define __SETXID_2(cmd, arg1, arg2) \
4999bf
-  __SETXID_1 (cmd, arg1); cmd.id[1] = arg2
4999bf
+  __SETXID_1 (cmd, arg1); cmd.id[1] = (long int) arg2
4999bf
 #define __SETXID_3(cmd, arg1, arg2, arg3) \
4999bf
-  __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = arg3
4999bf
+  __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = (long int) arg3
4999bf
 
4999bf
 #ifdef SINGLE_THREAD
4999bf
 # define INLINE_SETXID_SYSCALL(name, nr, args...) \
4999bf
Index: glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/i386/setgroups.c
4999bf
===================================================================
4999bf
--- glibc-2.12-2-gc4ccff1.orig/sysdeps/unix/sysv/linux/i386/setgroups.c
4999bf
+++ glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/i386/setgroups.c
4999bf
@@ -25,6 +25,7 @@
4999bf
 #include <sys/syscall.h>
4999bf
 #include <bp-checks.h>
4999bf
 
4999bf
+#include <setxid.h>
4999bf
 #include <linux/posix_types.h>
4999bf
 #include <kernel-features.h>
4999bf
 
4999bf
@@ -44,7 +45,7 @@ int
4999bf
 setgroups (size_t n, const gid_t *groups)
4999bf
 {
4999bf
 #if __ASSUME_32BITUIDS > 0
4999bf
-  return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
4999bf
+  return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
4999bf
 #else
4999bf
   if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
4999bf
     {
4999bf
@@ -62,7 +63,8 @@ setgroups (size_t n, const gid_t *groups
4999bf
 	  int result;
4999bf
 	  int saved_errno = errno;
4999bf
 
4999bf
-	  result = INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
4999bf
+	  result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
4999bf
+					  CHECK_N (groups, n));
4999bf
 	  if (result == 0 || errno != ENOSYS)
4999bf
 	    return result;
4999bf
 
4999bf
@@ -80,7 +82,8 @@ setgroups (size_t n, const gid_t *groups
4999bf
 	    }
4999bf
 	}
4999bf
 
4999bf
-      return INLINE_SYSCALL (setgroups, 2, n, CHECK_N (kernel_groups, n));
4999bf
+      return INLINE_SETXID_SYSCALL (setgroups, 2, n,
4999bf
+				    CHECK_N (kernel_groups, n));
4999bf
     }
4999bf
 #endif
4999bf
 }
4999bf
Index: glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/setgroups.c
4999bf
===================================================================
4999bf
--- /dev/null
4999bf
+++ glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/setgroups.c
4999bf
@@ -0,0 +1,37 @@
4999bf
+/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
4999bf
+   Free Software Foundation, Inc.
4999bf
+   This file is part of the GNU C Library.
4999bf
+
4999bf
+   The GNU C Library is free software; you can redistribute it and/or
4999bf
+   modify it under the terms of the GNU Lesser General Public
4999bf
+   License as published by the Free Software Foundation; either
4999bf
+   version 2.1 of the License, or (at your option) any later version.
4999bf
+
4999bf
+   The GNU C Library is distributed in the hope that it will be useful,
4999bf
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
4999bf
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4999bf
+   Lesser General Public License for more details.
4999bf
+
4999bf
+   You should have received a copy of the GNU Lesser General Public
4999bf
+   License along with the GNU C Library; if not, write to the Free
4999bf
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4999bf
+   02111-1307 USA.  */
4999bf
+
4999bf
+#include <errno.h>
4999bf
+#include <grp.h>
4999bf
+#include <setxid.h>
4999bf
+#include <sysdep.h>
4999bf
+
4999bf
+
4999bf
+/* Set the group set for the current user to GROUPS (N of them).  For
4999bf
+   Linux we must convert the array of groups into the format that the
4999bf
+   kernel expects.  */
4999bf
+int
4999bf
+setgroups (size_t n, const gid_t *groups)
4999bf
+{
4999bf
+#ifdef __NR_setgroups32
4999bf
+# error "wrong setgroups.c file used"
4999bf
+#endif
4999bf
+  return INLINE_SETXID_SYSCALL (setgroups, 2, n, groups);
4999bf
+}
4999bf
+libc_hidden_def (setgroups)