diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-18 04:33:34 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-18 04:33:34 +0000 |
commit | 0482576eec37874110782f0bae6dd0e1b4a357c6 (patch) | |
tree | 87c6c9880dffc5f89b1fc716b52136ee4c72d844 /sysdeps/unix/sysv/linux/sparc/sparc32 | |
parent | d316a91962f62fb44c713feac0e82241e8cec1cd (diff) |
Update.
2000-01-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/ipc.h: New file.
* sysdeps/unix/sysv/linux/bits/sem.h: New file.
* sysdeps/unix/sysv/linux/bits/shm.h: New file.
* sysdeps/unix/sysv/linux/bits/msg.h: New file.
* sysdeps/unix/sysv/linux/bits/alpha/ipc.h: Update for new ipc.
* sysdeps/unix/sysv/linux/bits/alpha/sem.h: New file.
* sysdeps/unix/sysv/linux/bits/alpha/shm.h: New file.
* sysdeps/unix/sysv/linux/bits/alpha/msg.h: New file.
* sysdeps/unix/sysv/linux/bits/sparc/ipc.h: New file.
* sysdeps/unix/sysv/linux/bits/sparc/sem.h: New file.
* sysdeps/unix/sysv/linux/bits/sparc/shm.h: New file.
* sysdeps/unix/sysv/linux/bits/sparc/msg.h: New file.
* sysdeps/unix/sysv/linux/msgctl.c (__old_msgctl):
Renamed from msgctl.
(__new_msgctl): New function.
* sysdeps/unix/sysv/linux/semctl.c (__old_semctl):
Renamed from semctl.
(__new_semctl): New function.
* sysdeps/unix/sysv/linux/shmctl.c (__old_shmctl):
Renamed from shmctl.
(__new_shmctl): New function.
* sysdeps/unix/sysv/linux/msgget.c: Define __LIBC_IPC_INTERNAL.
* sysdeps/unix/sysv/linux/msgrcv.c: Likewise.
* sysdeps/unix/sysv/linux/semget.c: Likewise.
* sysdeps/unix/sysv/linux/msgsnd.c: Likewise.
* sysdeps/unix/sysv/linux/semop.c: Likewise.
* sysdeps/unix/sysv/linux/shmat.c: Likewise.
* sysdeps/unix/sysv/linux/shmdt.c: Likewise.
* sysdeps/unix/sysv/linux/shmget.c: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c: New file.
* sysdeps/unix/sysv/linux/Versions: Add msgctl, semctl, shmctl.
2000-01-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/Dist: Remove setres[ug]id.
* sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c: Kill warnings.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Define needed
syscalls.
* sysdeps/unix/sysv/linux/pwrite64.c: Use proper prototype.
* sysdeps/unix/sysv/linux/truncate64.c: Likewise.
* sysdeps/unix/sysv/linux/kernel-features.h: [gs]etres[ug]id are
available on sparc since 2.3.39.
* sysdeps/unix/sysv/linux/execve.c: Kill warnings.
2000-01-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/chown.c (__syscall_chown): Use proper
prototype.
(__real_chown): Return EINVAL if owner or group are out of the range
-1U .. 65534.
* sysdeps/unix/sysv/linux/i386/lchown.c (__lchown): Likewise.
* sysdeps/unix/sysv/linux/i386/fchown.c (__fchown): Likewise.
* sysdeps/unix/sysv/linux/i386/setresuid.c (__setresuid): Return
EINVAL if ruid, euid or suid are out of the range -1U .. 65534.
* sysdeps/unix/sysv/linux/i386/setresgid.c (__setresgid): Similarly.
* sysdeps/unix/sysv/linux/i386/setreuid.c (__setreuid): Simplify.
* sysdeps/unix/sysv/linux/i386/setregid.c (__setregid): Likewise.
* sysdeps/unix/sysv/linux/m68k/chown.c (__syscall_chown): Use proper
prototype.
Don't include non-existant header.
(__chown): Return EINVAL if owner or group are out of the range
-1U .. 65534.
* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (setresuid,
setresgid): Inherit standard linux/syscalls.list definitions.
* sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c: Remove.
* sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c: Remove.
* sysdeps/unix/sysv/linux/syscalls.list (setresgid): Provide
__setresgid symbol.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sparc/sparc32')
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/Dist | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c | 52 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c | 56 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list | 28 |
7 files changed, 136 insertions, 12 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Dist b/sysdeps/unix/sysv/linux/sparc/sparc32/Dist index 28968fd133..24b16852e6 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/Dist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Dist @@ -1,7 +1,5 @@ clone.S kernel_stat.h init-first.h -setresuid.c -setresgid.c setfsuid.c setfsgid.c diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c index c9e7653c89..6a77e28a8a 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c @@ -28,7 +28,7 @@ #include "kernel-features.h" #ifdef __NR_mmap2 -extern int __syscall_mmap2(__ptr_t, size_t, int, int, int, off_t); +extern __ptr_t __syscall_mmap2(__ptr_t, size_t, int, int, int, off_t); #ifndef __ASSUME_MMAP2_SYSCALL static int have_no_mmap2; #endif @@ -48,11 +48,11 @@ __mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset) int saved_errno = errno; #endif /* This will be always 12, no matter what page size is. */ - int result = INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, - fd, (off_t) (offset >> 12)); + __ptr_t result = INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, + fd, (off_t) (offset >> 12)); #ifndef __ASSUME_MMAP2_SYSCALL - if (result != -1 || errno != ENOSYS) + if (result != (__ptr_t) -1 || errno != ENOSYS) #endif return result; diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c index 2e3a54c893..f822b0902e 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c @@ -1 +1,51 @@ -#include <sysdeps/unix/sysv/linux/i386/setegid.c> +/* Copyright (C) 1998, 2000 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 + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <sys/syscall.h> +#include <sys/types.h> +#include <unistd.h> + +#ifdef __NR_setresgid32 + +extern int __setresgid (gid_t rgid, gid_t egid, gid_t sgid); + +int +setegid (gid_t gid) +{ + int result; + + if (gid == (gid_t) ~0) + { + __set_errno (EINVAL); + return -1; + } + + /* First try the syscall. */ + result = __setresgid (-1, gid, -1); + if (result == -1 && errno == ENOSYS) + /* No system call available. Use emulation. This may not work + since `setregid' also sets the saved group ID when GID is not + equal to the real group ID, making it impossible to switch back. */ + result = __setregid (-1, gid); + + return result; +} +#else +# include <sysdeps/unix/bsd/setegid.c> +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c index 18e41d08c1..0b3c700924 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c @@ -1 +1,55 @@ -#include <sysdeps/unix/sysv/linux/i386/seteuid.c> +/* Copyright (C) 1998, 1999, 2000 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 + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <sys/syscall.h> +#include <sys/types.h> +#include <unistd.h> + +#include "kernel-features.h" + +#if defined __NR_setresuid32 || __ASSUME_SETRESUID_SYSCALL > 0 + +extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid); + +int +seteuid (uid_t uid) +{ + int result; + + if (uid == (uid_t) ~0) + { + __set_errno (EINVAL); + return -1; + } + + /* First try the syscall. */ + result = __setresuid (-1, uid, -1); +# if __ASSUME_SETRESUID_SYSCALL == 0 + if (result == -1 && errno == ENOSYS) + /* No system call available. Use emulation. This may not work + since `setreuid' also sets the saved user ID when UID is not + equal to the real user ID, making it impossible to switch back. */ + result = __setreuid (-1, uid); +# endif + + return result; +} +#else +# include <sysdeps/unix/bsd/seteuid.c> +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c deleted file mode 100644 index daca1a4833..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setresgid.c> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c b/sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c deleted file mode 100644 index 3aeabe9ad7..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdeps/unix/sysv/linux/i386/setresuid.c> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list index 07333a72b6..5f472d56c7 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list @@ -8,12 +8,14 @@ s_setfsuid setfsuid setfsuid 1 __syscall_setfsuid s_setgid setgid setgid 1 __syscall_setgid s_setgroups setgroups setgroups 2 __syscall_setgroups s_setregid setregid setregid 2 __syscall_setregid -s_setresgid setresgid setresgid 3 __syscall_setresgid -s_setresuid setresuid setresuid 3 __syscall_setresuid s_setreuid setreuid setreuid 2 __syscall_setreuid s_setrlimit setrlimit setrlimit 3 __syscall_setrlimit s_ipc msgget ipc 5 __syscall_ipc s_setuid setuid setuid 1 __syscall_setuid +setresuid EXTRA setresuid32 3 __setresuid setresuid +setresgid EXTRA setresgid32 3 __setresgid setresgid +getresuid EXTRA getresuid32 3 getresuid +getresgid EXTRA getresgid32 3 getresgid # System calls with wrappers. rt_sigaction - rt_sigaction 4 __syscall_rt_sigaction @@ -52,3 +54,25 @@ sys_mknod xmknod mknod 3 __syscall_mknod sys_readv readv readv 3 __syscall_readv sys_stat xstat stat 2 __syscall_stat sys_writev writev writev 3 __syscall_writev +s_chown chown chown 3 __syscall_chown +s_chown32 chown chown32 3 __syscall_chown32 +s_fchown fchown fchown 3 __syscall_fchown +s_fchown32 fchown fchown32 3 __syscall_fchown32 +s_lchown lchown lchown 3 __syscall_lchown +s_lchown32 lchown lchown32 3 __syscall_lchown32 +s_getgid getgid getgid 0 __syscall_getgid +s_getgid32 getgid getgid32 0 __syscall_getgid32 +s_getuid getuid getuid 0 __syscall_getuid +s_getuid32 getuid getuid32 0 __syscall_getuid32 +s_getgroups32 getgroups getgroups32 2 __syscall_getgroups32 +s_setgroups32 setgroups setgroups32 2 __syscall_setgroups32 +s_setfsgid32 setfsgid setfsgid32 1 __syscall_setfsgid32 +s_setfsuid32 setfsuid setfsuid32 1 __syscall_setfsuid32 +s_setregid32 setregid setregid32 2 __syscall_setregid32 +s_setreuid32 setreuid setreuid32 2 __syscall_setreuid32 +s_getegid getegid getegid 0 __syscall_getegid +s_geteuid geteuid geteuid 0 __syscall_geteuid +s_getegid32 getegid getegid32 0 __syscall_getegid32 +s_geteuid32 geteuid geteuid32 0 __syscall_geteuid32 +s_setgid32 setgid setgid32 1 __syscall_setgid32 +s_setuid32 setuid setuid32 1 __syscall_setuid32 |