1 2011-01-14 Ulrich Drepper <drepper@gmail.com>
4 * sysdeps/unix/sysv/linux/i386/setgroups.c: Use INLINE_SETXID_SYSCALL
6 * sysdeps/unix/sysv/linux/setgroups.c: New file.
8 2011-01-14 Ulrich Drepper <drepper@gmail.com>
11 * sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
12 (__SETXID_2): Likewise.
13 (__SETXID_3): Likewise.
15 Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/setxid.h
16 ===================================================================
17 --- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/pthread/setxid.h
18 +++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/setxid.h
22 #define __SETXID_1(cmd, arg1) \
24 + cmd.id[0] = (long int) arg1
25 #define __SETXID_2(cmd, arg1, arg2) \
26 - __SETXID_1 (cmd, arg1); cmd.id[1] = arg2
27 + __SETXID_1 (cmd, arg1); cmd.id[1] = (long int) arg2
28 #define __SETXID_3(cmd, arg1, arg2, arg3) \
29 - __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = arg3
30 + __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = (long int) arg3
33 # define INLINE_SETXID_SYSCALL(name, nr, args...) \
34 Index: glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/i386/setgroups.c
35 ===================================================================
36 --- glibc-2.12-2-gc4ccff1.orig/sysdeps/unix/sysv/linux/i386/setgroups.c
37 +++ glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/i386/setgroups.c
39 #include <sys/syscall.h>
40 #include <bp-checks.h>
43 #include <linux/posix_types.h>
44 #include <kernel-features.h>
47 setgroups (size_t n, const gid_t *groups)
49 #if __ASSUME_32BITUIDS > 0
50 - return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
51 + return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
53 if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
55 @@ -62,7 +63,8 @@ setgroups (size_t n, const gid_t *groups
57 int saved_errno = errno;
59 - result = INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
60 + result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
61 + CHECK_N (groups, n));
62 if (result == 0 || errno != ENOSYS)
65 @@ -80,7 +82,8 @@ setgroups (size_t n, const gid_t *groups
69 - return INLINE_SYSCALL (setgroups, 2, n, CHECK_N (kernel_groups, n));
70 + return INLINE_SETXID_SYSCALL (setgroups, 2, n,
71 + CHECK_N (kernel_groups, n));
75 Index: glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/setgroups.c
76 ===================================================================
78 +++ glibc-2.12-2-gc4ccff1/sysdeps/unix/sysv/linux/setgroups.c
80 +/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
81 + Free Software Foundation, Inc.
82 + This file is part of the GNU C Library.
84 + The GNU C Library is free software; you can redistribute it and/or
85 + modify it under the terms of the GNU Lesser General Public
86 + License as published by the Free Software Foundation; either
87 + version 2.1 of the License, or (at your option) any later version.
89 + The GNU C Library is distributed in the hope that it will be useful,
90 + but WITHOUT ANY WARRANTY; without even the implied warranty of
91 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
92 + Lesser General Public License for more details.
94 + You should have received a copy of the GNU Lesser General Public
95 + License along with the GNU C Library; if not, write to the Free
96 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
105 +/* Set the group set for the current user to GROUPS (N of them). For
106 + Linux we must convert the array of groups into the format that the
109 +setgroups (size_t n, const gid_t *groups)
111 +#ifdef __NR_setgroups32
112 +# error "wrong setgroups.c file used"
114 + return INLINE_SETXID_SYSCALL (setgroups, 2, n, groups);
116 +libc_hidden_def (setgroups)