Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux/common Add seperate entries for 16 bit uid/...



details:   https://anonhg.NetBSD.org/src/rev/a7009026d3ff
branches:  trunk
changeset: 500767:a7009026d3ff
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon Dec 18 14:40:02 2000 +0000

description:
Add seperate entries for 16 bit uid/gid calls, so that border cases
like 0xffff can be handled better (not done yet).

diffstat:

 sys/compat/linux/common/linux_file.c |  14 +++---
 sys/compat/linux/common/linux_misc.c |  66 +++++++++++++++++++++++++++++++++--
 2 files changed, 68 insertions(+), 12 deletions(-)

diffs (156 lines):

diff -r f07dcc168be6 -r a7009026d3ff sys/compat/linux/common/linux_file.c
--- a/sys/compat/linux/common/linux_file.c      Mon Dec 18 14:37:36 2000 +0000
+++ b/sys/compat/linux/common/linux_file.c      Mon Dec 18 14:40:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_file.c,v 1.30 2000/12/01 12:28:33 jdolecek Exp $ */
+/*     $NetBSD: linux_file.c,v 1.31 2000/12/18 14:40:02 fvdl Exp $     */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -643,12 +643,12 @@
 }
 
 int
-linux_sys_chown(p, v, retval)
+linux_sys_chown16(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
 {
-       struct linux_sys_chown_args /* {
+       struct linux_sys_chown16_args /* {
                syscallarg(const char *) path;
                syscallarg(int) uid;
                syscallarg(int) gid;
@@ -668,12 +668,12 @@
 }
 
 int
-linux_sys_fchown(p, v, retval)
+linux_sys_fchown16(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
 {
-       struct linux_sys_fchown_args /* {
+       struct linux_sys_fchown16_args /* {
                syscallarg(int) fd;
                syscallarg(int) uid;
                syscallarg(int) gid;
@@ -690,12 +690,12 @@
 }
 
 int
-linux_sys_lchown(p, v, retval)
+linux_sys_lchown16(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
 {
-       struct linux_sys_lchown_args /* {
+       struct linux_sys_lchown16_args /* {
                syscallarg(char *) path;
                syscallarg(int) uid;
                syscallarg(int) gid;
diff -r f07dcc168be6 -r a7009026d3ff sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Mon Dec 18 14:37:36 2000 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Mon Dec 18 14:40:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.77 2000/12/13 21:41:23 augustss Exp $ */
+/*     $NetBSD: linux_misc.c,v 1.78 2000/12/18 14:40:03 fvdl Exp $     */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -871,12 +871,12 @@
  * The calls are here because of type conversions.
  */
 int
-linux_sys_setreuid(p, v, retval)
+linux_sys_setreuid16(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
 {
-       struct linux_sys_setreuid_args /* {
+       struct linux_sys_setreuid16_args /* {
                syscallarg(int) ruid;
                syscallarg(int) euid;
        } */ *uap = v;
@@ -891,12 +891,12 @@
 }
 
 int
-linux_sys_setregid(p, v, retval)
+linux_sys_setregid16(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
 {
-       struct linux_sys_setregid_args /* {
+       struct linux_sys_setregid16_args /* {
                syscallarg(int) rgid;
                syscallarg(int) egid;
        } */ *uap = v;
@@ -1071,6 +1071,62 @@
        return (copyout(&pc->p_svuid, SCARG(uap, suid), sizeof(uid_t)));
 }
 
+/*
+ * XXX fix these for 0xffff == -1 for old Linux uids return case.
+ */
+int
+linux_sys_setuid16(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       return sys_setuid(p, v, retval);
+}
+
+int
+linux_sys_getuid16(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       return sys_getuid(p, v, retval);
+}
+int
+linux_sys_setgid16(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       return sys_setgid(p, v, retval);
+}
+
+int
+linux_sys_getgid16(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       return sys_getgid(p, v, retval);
+}
+
+int
+linux_sys_geteuid16(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       return sys_geteuid(p, v, retval);
+}
+
+int
+linux_sys_getegid16(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       return sys_getegid(p, v, retval);
+}
+
 int
 linux_sys_ptrace(p, v, retval)
        struct proc *p;



Home | Main Index | Thread Index | Old Index