about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/setreuid.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-21 15:29:52 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-21 15:29:52 +0000
commit0dee67386c1ef99baee307ab01d20c79739cbc2a (patch)
tree1acb6c95fc9c50e0e13312a564b1bab44f1d13cb /sysdeps/unix/sysv/linux/i386/setreuid.c
parent6c6270e0a91140a5bb4a76ebfd2681067592aaf8 (diff)
downloadglibc-0dee67386c1ef99baee307ab01d20c79739cbc2a.tar.gz
glibc-0dee67386c1ef99baee307ab01d20c79739cbc2a.tar.xz
glibc-0dee67386c1ef99baee307ab01d20c79739cbc2a.zip
Update.
1998-10-21 14:38  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysdep.h (INLINE_SYSCALL): New macro.  Simply call
	__syscall_* function.
	* sysdeps/unix/sysv/linux/aio_sigqueue.c: Use INLINE_SYSCALL instead
	of calling __syscall_* function.
	* sysdeps/unix/sysv/linux/fxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/fxstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/getcwd.c: Likewise.
	* sysdeps/unix/sysv/linux/getdents.c: Likewise.
	* sysdeps/unix/sysv/linux/getpriority.c: Likewise.
	* sysdeps/unix/sysv/linux/getresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/lxstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/poll.c: Likewise.
	* sysdeps/unix/sysv/linux/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/ptrace.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Likewise.
	* sysdeps/unix/sysv/linux/reboot.c: Likewise.
	* sysdeps/unix/sysv/linux/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/siglist.h: Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c: Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.
	* sysdeps/unix/sysv/linux/sigqueue.c: Likewise.
	* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
	* sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.
	* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
	* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/sysctl.c: Likewise.
	* sysdeps/unix/sysv/linux/ustat.c: Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.
	* sysdeps/unix/sysv/linux/xmknod.c: Likewise.
	* sysdeps/unix/sysv/linux/xstat.c: Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.

	* sysdeps/unix/sysv/linux/i386/sysdep.h: Define INLINE_SYSCALL using
	inline assembler.
	* sysdeps/unix/sysv/linux/i386/syscalls.list: Remove various
	__syscall_* definitions.

	* sysdeps/unix/sysv/linux/syscalls.list: Move various __syscall_*
	definitions to...
	* sysdeps/unix/sysv/linux/alpha/syscalls.list: ...here...
	* sysdeps/unix/sysv/linux/arm/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/m68k/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/mips/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/powerpc/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: ...and here...
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: ...and here.

	* sysdeps/unix/sysv/linux/i386/Makefile [subdir=misc]
	(sysdep_routines): Remove s_pread64 and s_pwrite64.

	* sysdeps/unix/sysv/linux/i386/pread.c: New file.
	* sysdeps/unix/sysv/linux/i386/pread64.c: New file.
	* sysdeps/unix/sysv/linux/i386/pwrite.c: New file.
	* sysdeps/unix/sysv/linux/i386/pwrite64.c: New file.
	* sysdeps/unix/sysv/linux/i386/s_pread64.S: Removed.
	* sysdeps/unix/sysv/linux/i386/s_pwrite64.S: Removed.

1998-10-21  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/unix/sysv/linux/siglist.h: Fix some typos in these files
	and bring them in synch.
	* sysdeps/unix/siglist.c: Likewise.
	Reported by Vladimir Michl <michlv@risc.upol.cz> [PR libc/832].

1998-10-20  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/i386/setresuid.c: Allow -1 as arguments.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.

	* sysdeps/unix/sysv/linux/i386/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setregid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setregid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setregid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c: New file.
	* sysdeps/unix/sysv/linux/i386/syscalls.list: Add s_setreuid and
	s_setregid.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.

1998-10-20  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* sunrpc/rpc_main.c (close_output, close_input): New functions.
	(c_output, h_output, s_output, l_output, t_output, svc_output,
	clnt_output, mkfile_output): Call them at the end.

1998-10-19  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* db/Makefile (LDFLAGS-db1.so): New variable, to avoid duplicating
	link command.

1998-10-18  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* sysdeps/unix/opendir.c: Check at runtime for kernel support for
	O_DIRECTORY.

1998-10-20  H.J. Lu  <hjl@gnu.org>

	* sysdeps/unix/sysv/linux/i386/setresuid.c (__setresuid): Fix
	argument types.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/setreuid.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/setreuid.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c
new file mode 100644
index 0000000000..f38f136920
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/setreuid.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1998 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/types.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <linux/posix_types.h>
+
+extern int __syscall_setreuid (__kernel_uid_t, __kernel_uid_t);
+
+int
+__setreuid (uid_t ruid, uid_t euid)
+{
+  if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid)
+      || (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return INLINE_SYSCALL (setreuid, 2, ruid, euid);
+}
+weak_alias (__setreuid, setreuid)