Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux Add Linux fsuid system calls - from Witold ...



details:   https://anonhg.NetBSD.org/src/rev/c0c2f0c45312
branches:  trunk
changeset: 481662:c0c2f0c45312
user:      abs <abs%NetBSD.org@localhost>
date:      Thu Feb 03 10:02:59 2000 +0000

description:
Add Linux fsuid system calls - from Witold J. Wnuk in PR kern/9335

diffstat:

 sys/compat/linux/arch/i386/syscalls.master |   6 ++--
 sys/compat/linux/arch/m68k/syscalls.master |   6 ++--
 sys/compat/linux/common/linux_misc.c       |  33 +++++++++++++++++++++++++++++-
 3 files changed, 38 insertions(+), 7 deletions(-)

diffs (87 lines):

diff -r 12800eddfcc6 -r c0c2f0c45312 sys/compat/linux/arch/i386/syscalls.master
--- a/sys/compat/linux/arch/i386/syscalls.master        Thu Feb 03 09:59:22 2000 +0000
+++ b/sys/compat/linux/arch/i386/syscalls.master        Thu Feb 03 10:02:59 2000 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.39 1999/12/12 00:00:17 tron Exp $
+       $NetBSD: syscalls.master,v 1.40 2000/02/03 10:02:59 abs Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -227,8 +227,8 @@
 135    UNIMPL          sysfs
 136    STD             { int linux_sys_personality(int per); }
 137    UNIMPL          afs_syscall
-138    UNIMPL          setfsuid
-139    UNIMPL          getfsuid
+138    STD             { int linux_sys_setfsuid(uid_t uid); }
+139    NOARGS          { int linux_sys_getfsuid(void); }
 140    STD             { int linux_sys_llseek(int fd, u_int32_t ohigh, \
                            u_int32_t olow, caddr_t res, int whence); }
 141    STD             { int linux_sys_getdents(int fd, \
diff -r 12800eddfcc6 -r c0c2f0c45312 sys/compat/linux/arch/m68k/syscalls.master
--- a/sys/compat/linux/arch/m68k/syscalls.master        Thu Feb 03 09:59:22 2000 +0000
+++ b/sys/compat/linux/arch/m68k/syscalls.master        Thu Feb 03 10:02:59 2000 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.12 1999/12/16 15:13:02 tron Exp $
+       $NetBSD: syscalls.master,v 1.13 2000/02/03 10:03:00 abs Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -253,8 +253,8 @@
 135    UNIMPL          sysfs
 136    STD             { int linux_sys_personality(int per); }
 137    UNIMPL          afs_syscall
-138    UNIMPL          setfsuid
-139    UNIMPL          getfsuid
+138    STD             { int linux_sys_setfsuid(uid_t uid); }
+139    NOARGS          { int linux_sys_getfsuid(void); }
 140    STD             { int linux_sys_llseek(int fd, u_int32_t ohigh, \
                            u_int32_t olow, caddr_t res, int whence); }
 141    STD             { int linux_sys_getdents(int fd, \
diff -r 12800eddfcc6 -r c0c2f0c45312 sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Thu Feb 03 09:59:22 2000 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Thu Feb 03 10:02:59 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.62 1999/12/16 15:09:49 tron Exp $     */
+/*     $NetBSD: linux_misc.c,v 1.63 2000/02/03 10:03:01 abs Exp $      */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -906,6 +906,37 @@
        return sys_setregid(p, &bsa, retval);
 }
 
+/*
+ * We have nonexistant fsuid == uid.
+ * If call is no-op return 0, otherwise ENOSYS.
+ */
+int
+linux_sys_setfsuid(p, v, retval)
+        struct proc *p;
+        void *v;
+        register_t *retval;
+{
+        struct linux_sys_setfsuid_args /* {
+                syscallarg(uid_t) uid;
+        } */ *uap = v;
+        uid_t uid;
+
+        uid = SCARG(uap, uid);
+        if (p->p_cred->p_ruid != uid)
+                return (ENOSYS);
+        else
+                return (0);
+}
+
+int
+linux_sys_getfsuid(p, v, retval)
+        struct proc *p;
+        void *v;
+        register_t *retval;
+{
+        return sys_getuid(p, v, retval);
+}
+
 int
 linux_sys___sysctl(p, v, retval)
        struct proc *p;



Home | Main Index | Thread Index | Old Index