summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorjasoni <jasoni@cvs.openbsd.org>2000-04-12 04:22:41 +0000
committerjasoni <jasoni@cvs.openbsd.org>2000-04-12 04:22:41 +0000
commit702760c748d018312be23e323c34e8f2541136c5 (patch)
treebce9e9c1d432d6a70616615ea66e0dc18651bdc9 /sys
parentcabd37effc285017205ade2e777b4403d1df045b (diff)
Implement linux's setfsuid and getfsuid (from NetBSD)
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linux/linux_misc.c34
-rw-r--r--sys/compat/linux/syscalls.master6
2 files changed, 36 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 3f1653cd7b8..4c5a58e46eb 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_misc.c,v 1.26 2000/02/28 13:29:30 jasoni Exp $ */
+/* $OpenBSD: linux_misc.c,v 1.27 2000/04/12 04:22:40 jasoni Exp $ */
/* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */
/*
@@ -1440,6 +1440,38 @@ linux_sys_getresuid(p, v, retval)
return (copyout(&pc->p_svuid, SCARG(uap, suid), sizeof(uid_t)));
}
+/*
+ * We have nonexistent fsuid equal to uid.
+ * If modification is requested, refuse.
+ */
+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 sys_nosys(p, v, retval);
+ 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_nice(p, v, retval)
struct proc *p;
diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master
index 21162ac8a98..932f76f9fa5 100644
--- a/sys/compat/linux/syscalls.master
+++ b/sys/compat/linux/syscalls.master
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.21 2000/04/04 05:31:50 jasoni Exp $
+ $OpenBSD: syscalls.master,v 1.22 2000/04/12 04:22:40 jasoni Exp $
; $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -225,8 +225,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, void *dirent, \