From 2edb61e3f955bfcc9dd3cb6b3b1acfe4806234a6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 20 Sep 2004 00:16:11 +0000 Subject: Update. * sysdeps/unix/sysv/linux/setegid.c [HAVE_PTR__NPTL_SETXID]: Call callback to set IDs in all other threads as well. * sysdeps/unix/sysv/linux/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setegid.c: Likewise. * sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/setuid.c: New file. * sysdeps/unix/sysv/linux/setgid.c: New file. * sysdeps/unix/sysv/linux/setreuid.c: New file. * sysdeps/unix/sysv/linux/setregid.c: New file. * sysdeps/unix/sysv/linux/setresuid.c: New file. * sysdeps/unix/sysv/linux/setresgid.c: New file. * sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NCS. * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: Use x86 version. * sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Remove setresgid and setresuid. * nscd/aicache.c: Use pthread_seteuid_np instead of seteuid. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/pwdcache.c: Likewise. --- sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h | 30 ++++++++++++---------- sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h | 30 ++++++++++++---------- 2 files changed, 32 insertions(+), 28 deletions(-) (limited to 'sysdeps/unix/sysv/linux/powerpc') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index 269b4dd531..2ee3e60229 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -79,7 +79,7 @@ # define INTERNAL_SYSCALL_DECL(err) long int err # undef INTERNAL_SYSCALL -# define INTERNAL_SYSCALL(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ ({ \ register long int r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -104,6 +104,8 @@ err = r0; \ (int) r3; \ }) +# define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) # undef INTERNAL_SYSCALL_ERROR_P # define INTERNAL_SYSCALL_ERROR_P(val, err) \ @@ -113,48 +115,48 @@ # define INTERNAL_SYSCALL_ERRNO(val, err) (val) # define LOADARGS_0(name, dummy) \ - r0 = __NR_##name + r0 = name # define LOADARGS_1(name, __arg1) \ long int arg1 = (long int) (__arg1); \ LOADARGS_0(name, 0); \ - extern void __illegally_sized_syscall_##name##_arg1 (void); \ + extern void __illegally_sized_syscall_arg1 (void); \ if (__builtin_classify_type (__arg1) != 5 && sizeof (__arg1) > 4) \ - __illegally_sized_syscall_##name##_arg1 (); \ + __illegally_sized_syscall_arg1 (); \ r3 = arg1 # define LOADARGS_2(name, __arg1, __arg2) \ long int arg2 = (long int) (__arg2); \ LOADARGS_1(name, __arg1); \ - extern void __illegally_sized_syscall_##name##_arg2 (void); \ + extern void __illegally_sized_syscall_arg2 (void); \ if (__builtin_classify_type (__arg2) != 5 && sizeof (__arg2) > 4) \ - __illegally_sized_syscall_##name##_arg2 (); \ + __illegally_sized_syscall_arg2 (); \ r4 = arg2 # define LOADARGS_3(name, __arg1, __arg2, __arg3) \ long int arg3 = (long int) (__arg3); \ LOADARGS_2(name, __arg1, __arg2); \ - extern void __illegally_sized_syscall_##name##_arg3 (void); \ + extern void __illegally_sized_syscall_arg3 (void); \ if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 4) \ - __illegally_sized_syscall_##name##_arg3 (); \ + __illegally_sized_syscall_arg3 (); \ r5 = arg3 # define LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4) \ long int arg4 = (long int) (__arg4); \ LOADARGS_3(name, __arg1, __arg2, __arg3); \ - extern void __illegally_sized_syscall_##name##_arg4 (void); \ + extern void __illegally_sized_syscall_arg4 (void); \ if (__builtin_classify_type (__arg4) != 5 && sizeof (__arg4) > 4) \ - __illegally_sized_syscall_##name##_arg4 (); \ + __illegally_sized_syscall_arg4 (); \ r6 = arg4 # define LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5) \ long int arg5 = (long int) (__arg5); \ LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4); \ - extern void __illegally_sized_syscall_##name##_arg5 (void); \ + extern void __illegally_sized_syscall_arg5 (void); \ if (__builtin_classify_type (__arg5) != 5 && sizeof (__arg5) > 4) \ - __illegally_sized_syscall_##name##_arg5 (); \ + __illegally_sized_syscall_arg5 (); \ r7 = arg5 # define LOADARGS_6(name, __arg1, __arg2, __arg3, __arg4, __arg5, __arg6) \ long int arg6 = (long int) (__arg6); \ LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5); \ - extern void __illegally_sized_syscall_##name##_arg6 (void); \ + extern void __illegally_sized_syscall_arg6 (void); \ if (__builtin_classify_type (__arg6) != 5 && sizeof (__arg6) > 4) \ - __illegally_sized_syscall_##name##_arg6 (); \ + __illegally_sized_syscall_arg6 (); \ r8 = arg6 # define ASM_INPUT_0 "0" (r0) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index 2e1adccd5d..38a376fa90 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -91,7 +91,7 @@ the negation of the return value in the kernel gets reverted. */ #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ ({ \ register long int r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -114,6 +114,8 @@ err = r0; \ (int) r3; \ }) +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) #undef INTERNAL_SYSCALL_DECL #define INTERNAL_SYSCALL_DECL(err) long int err @@ -126,48 +128,48 @@ #define INTERNAL_SYSCALL_ERRNO(val, err) (val) #define LOADARGS_0(name, dummy) \ - r0 = __NR_##name + r0 = name #define LOADARGS_1(name, __arg1) \ long int arg1 = (long int) (__arg1); \ LOADARGS_0(name, 0); \ - extern void __illegally_sized_syscall_##name##_arg1 (void); \ + extern void __illegally_sized_syscall_arg1 (void); \ if (__builtin_classify_type (__arg1) != 5 && sizeof (__arg1) > 8) \ - __illegally_sized_syscall_##name##_arg1 (); \ + __illegally_sized_syscall_arg1 (); \ r3 = arg1 #define LOADARGS_2(name, __arg1, __arg2) \ long int arg2 = (long int) (__arg2); \ LOADARGS_1(name, __arg1); \ - extern void __illegally_sized_syscall_##name##_arg2 (void); \ + extern void __illegally_sized_syscall_arg2 (void); \ if (__builtin_classify_type (__arg2) != 5 && sizeof (__arg2) > 8) \ - __illegally_sized_syscall_##name##_arg2 (); \ + __illegally_sized_syscall_arg2 (); \ r4 = arg2 #define LOADARGS_3(name, __arg1, __arg2, __arg3) \ long int arg3 = (long int) (__arg3); \ LOADARGS_2(name, __arg1, __arg2); \ - extern void __illegally_sized_syscall_##name##_arg3 (void); \ + extern void __illegally_sized_syscall_arg3 (void); \ if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 8) \ - __illegally_sized_syscall_##name##_arg3 (); \ + __illegally_sized_syscall_arg3 (); \ r5 = arg3 #define LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4) \ long int arg4 = (long int) (__arg4); \ LOADARGS_3(name, __arg1, __arg2, __arg3); \ - extern void __illegally_sized_syscall_##name##_arg4 (void); \ + extern void __illegally_sized_syscall_arg4 (void); \ if (__builtin_classify_type (__arg4) != 5 && sizeof (__arg4) > 8) \ - __illegally_sized_syscall_##name##_arg4 (); \ + __illegally_sized_syscall_arg4 (); \ r6 = arg4 #define LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5) \ long int arg5 = (long int) (__arg5); \ LOADARGS_4(name, __arg1, __arg2, __arg3, __arg4); \ - extern void __illegally_sized_syscall_##name##_arg5 (void); \ + extern void __illegally_sized_syscall_arg5 (void); \ if (__builtin_classify_type (__arg5) != 5 && sizeof (__arg5) > 8) \ - __illegally_sized_syscall_##name##_arg5 (); \ + __illegally_sized_syscall_arg5 (); \ r7 = arg5 #define LOADARGS_6(name, __arg1, __arg2, __arg3, __arg4, __arg5, __arg6) \ long int arg6 = (long int) (__arg6); \ LOADARGS_5(name, __arg1, __arg2, __arg3, __arg4, __arg5); \ - extern void __illegally_sized_syscall_##name##_arg6 (void); \ + extern void __illegally_sized_syscall_arg6 (void); \ if (__builtin_classify_type (__arg6) != 5 && sizeof (__arg6) > 8) \ - __illegally_sized_syscall_##name##_arg6 (); \ + __illegally_sized_syscall_arg6 (); \ r8 = arg6 #define ASM_INPUT_0 "0" (r0) -- cgit 1.4.1