From 702760c748d018312be23e323c34e8f2541136c5 Mon Sep 17 00:00:00 2001 From: jasoni Date: Wed, 12 Apr 2000 04:22:41 +0000 Subject: Implement linux's setfsuid and getfsuid (from NetBSD) --- sys/compat/linux/linux_misc.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'sys/compat/linux/linux_misc.c') 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; -- cgit v1.2.3