about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/setuid.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-16 16:33:36 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-16 16:33:36 +0000
commit9ffbb61221fd5d0ee2b7989d2e5c785efee8cc02 (patch)
tree5c9b303b79c188e0f33571a09c2975ae8eb0e3ce /sysdeps/unix/sysv/linux/i386/setuid.c
parent39e4f7f84ec269a2d86a060d417ceaeb21f53305 (diff)
downloadglibc-9ffbb61221fd5d0ee2b7989d2e5c785efee8cc02.tar.gz
glibc-9ffbb61221fd5d0ee2b7989d2e5c785efee8cc02.tar.xz
glibc-9ffbb61221fd5d0ee2b7989d2e5c785efee8cc02.zip
Update.
	* sysdeps/unix/opendir.c: Use O_DIRECTORY if available.  If not
	available double check to verify it's a directory.

	* sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Add O_DIRECTORY.
	* sysdeps/unix/sysv/linux/mips/bits/fcntl: Likewise.
	* sysdeps/unix/sysv/linux/bits/fcntl.h: Remove O_* constants which
	are not generally available.
	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: New file.

	* sysdeps/unix/sysv/linux/i386/setgroups.c: Add range check for values.
	* sysdeps/unix/sysv/linux/arm/Makefile: New file.
	* sysdeps/unix/sysv/linux/arm/setegid.c: New file.
	* sysdeps/unix/sysv/linux/arm/seteuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setfsgid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setfsuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setgid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setgroups.c: New file.
	* sysdeps/unix/sysv/linux/arm/setresgid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setresuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/setuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setegid.c: New file.
	* sysdeps/unix/sysv/linux/i386/seteuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setfsgid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setfsuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setgid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setgroups.c: New file.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/setuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setegid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/seteuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setfsgid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setfsuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setgid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setgroups.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setresgid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setresuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/setuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setfsgid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setfsuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c: New file.
	* 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/setuid.c: New file.

	* sysdeps/unix/sysv/linux/arm/syscalls.list: Add s_setgid, s_setresuid,
	s_setresgid, and s_setuid.
	* sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/i386/Makefile [subdir=misc]
	(sysdep_routines): Add setfsgid, setfsuid, setresgid, and setresuid.
	* sysdeps/unix/sysv/linux/m68k/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/Makefile: Likewise.

1998-10-16  Ulrich Drepper  <drepper@cygnus.com>

	* iconv/skeleton.c: Include ELF header only of STATIC_GCONV is not
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/setuid.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/setuid.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setuid.c b/sysdeps/unix/sysv/linux/i386/setuid.c
new file mode 100644
index 0000000000..3379114384
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/setuid.c
@@ -0,0 +1,40 @@
+/* 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/syscall.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <linux/posix_types.h>
+
+extern int __syscall_setuid (__kernel_uid_t);
+
+int
+__setuid (uid_t uid)
+{
+  if (uid == (uid_t) ~0
+      || uid != (uid_t) ((__kernel_uid_t) uid))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return __syscall_setuid (uid);
+}
+weak_alias (__setuid, setuid)