- Fix setfsuid to return uid on success.
- Replace getfsuid, which never existed on Linux, by correct setfsgid syscall. ok by christos and dsl.
This commit is contained in:
parent
4ec3c2b1cd
commit
035a2e040b
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.59 2007/12/20 23:02:51 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.60 2007/12/21 22:26:20 njoly Exp $
|
||||
;
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
|||
; (i.e. reboot, msgrcv? )
|
||||
; make sure linux_foo() matches expected prototypes in .c files.
|
||||
; kill not used functions. (ifdef the actual code)
|
||||
; fix getfsuid in linux_misc.c
|
||||
; make linux_sys_sigreturn in linux_machdep.c use frame.extramask
|
||||
;
|
||||
; NOT USED = This syscall is not really used in Linux, except in its
|
||||
|
@ -519,7 +518,7 @@
|
|||
323 STD { int linux_sys_times(struct times *tms); }
|
||||
324 STD { int linux_sys_personality(int per); }
|
||||
325 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
326 UNIMPL setfsgid
|
||||
326 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
327 UNIMPL ustat
|
||||
328 STD { int linux_sys_statfs(const char *path, \
|
||||
struct linux_statfs *sp); }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.20 2007/12/20 23:02:52 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.21 2007/12/21 22:26:21 njoly Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
|
@ -272,7 +272,7 @@
|
|||
gid_t *sgid); }
|
||||
121 STD { int linux_sys_getpgid(int pid); }
|
||||
122 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
123 STD { int linux_sys_getfsuid(void); }
|
||||
123 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
124 NOARGS { pid_t sys_getsid(pid_t pid); }
|
||||
125 UNIMPL capget
|
||||
126 UNIMPL capset
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.30 2007/12/20 23:02:52 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.31 2007/12/21 22:26:21 njoly Exp $
|
||||
|
||||
; Derived from sys/compat/linux/arch/*/syscalls.master
|
||||
; and from Linux 2.4.12 arch/arm/kernel/calls.S
|
||||
|
@ -236,7 +236,7 @@
|
|||
136 STD { int linux_sys_personality(int per); }
|
||||
137 UNIMPL afs_syscall
|
||||
138 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
139 NOARGS { int linux_sys_getfsuid(void); }
|
||||
139 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \
|
||||
u_int32_t olow, void *res, int whence); }
|
||||
141 STD { int linux_sys_getdents(int fd, \
|
||||
|
@ -367,7 +367,7 @@
|
|||
213 NOARGS setuid32 { int sys_setuid(uid_t uid); }
|
||||
214 NOARGS setgid32 { int sys_setgid(gid_t gid); }
|
||||
215 NOARGS setfsuid32 { int linux_sys_setfsuid(uid_t uid); }
|
||||
216 NOARGS getfsuid32 { int linux_sys_getfsuid(void); }
|
||||
216 NOARGS setfsgid32 { int linux_sys_setfsgid(gid_t gid); }
|
||||
217 STD { int linux_sys_getdents64(int fd, \
|
||||
struct linux_dirent64 *dent, unsigned int count); }
|
||||
218 UNIMPL pivot_root
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.86 2007/12/20 23:02:52 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.87 2007/12/21 22:26:21 njoly Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
|
@ -248,7 +248,7 @@
|
|||
136 STD { int linux_sys_personality(int per); }
|
||||
137 UNIMPL afs_syscall
|
||||
138 NOARGS linux_setfsuid16 { int linux_sys_setfsuid(uid_t uid); }
|
||||
139 NOARGS linux_getfsuid16 { int linux_sys_getfsuid(void); }
|
||||
139 NOARGS linux_setfsgid16 { int linux_sys_setfsgid(gid_t gid); }
|
||||
140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \
|
||||
u_int32_t olow, void *res, int whence); }
|
||||
141 STD { int linux_sys_getdents(int fd, \
|
||||
|
@ -374,7 +374,7 @@
|
|||
213 NOARGS { int sys_setuid(uid_t uid); }
|
||||
214 NOARGS { int sys_setgid(gid_t gid); }
|
||||
215 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
216 NOARGS { int linux_sys_getfsuid(void); }
|
||||
216 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
217 UNIMPL pivot_root
|
||||
218 NOARGS { int sys_mincore(void *addr, size_t len, char *vec); }
|
||||
219 NOARGS { int sys_madvise(void *addr, size_t len, int behav); }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.56 2007/12/20 23:02:53 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.57 2007/12/21 22:26:21 njoly Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
|
@ -253,7 +253,7 @@
|
|||
136 STD { int linux_sys_personality(int per); }
|
||||
137 UNIMPL afs_syscall
|
||||
138 NOARGS linux_setfsuid16 { int linux_sys_setfsuid(uid_t uid); }
|
||||
139 NOARGS linux_getfsuid16 { int linux_sys_getfsuid(void); }
|
||||
139 NOARGS linux_setfsgid16 { int linux_sys_setfsgid(gid_t gid); }
|
||||
140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \
|
||||
u_int32_t olow, void *res, int whence); }
|
||||
141 STD { int linux_sys_getdents(int fd, \
|
||||
|
@ -379,7 +379,7 @@
|
|||
213 NOARGS { int sys_setuid(uid_t uid); }
|
||||
214 NOARGS { int sys_setgid(gid_t gid); }
|
||||
215 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
216 NOARGS { int linux_sys_getfsuid(void); }
|
||||
216 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
217 UNIMPL /* unused */
|
||||
218 UNIMPL /* unused */
|
||||
219 UNIMPL /* unused */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.25 2007/12/20 23:02:53 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.26 2007/12/21 22:26:21 njoly Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
|
@ -240,7 +240,7 @@
|
|||
136 STD { int linux_sys_personality(int per); }
|
||||
137 UNIMPL afs_syscall
|
||||
138 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
139 NOARGS { int linux_sys_getfsuid(void); }
|
||||
139 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \
|
||||
u_int32_t olow, void *res, int whence); }
|
||||
141 STD { int linux_sys_getdents(int fd, \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.33 2007/12/20 23:02:53 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.34 2007/12/21 22:26:22 njoly Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
|
||||
|
@ -269,7 +269,7 @@
|
|||
136 STD { int linux_sys_personality(int per); }
|
||||
137 UNIMPL afs_syscall
|
||||
138 STD { int linux_sys_setfsuid(uid_t uid); }
|
||||
139 NOARGS { int linux_sys_getfsuid(void); }
|
||||
139 STD { int linux_sys_setfsgid(gid_t gid); }
|
||||
140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \
|
||||
u_int32_t olow, void *res, int whence); }
|
||||
141 STD { int linux_sys_getdents(int fd, \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_misc.c,v 1.190 2007/12/20 23:02:55 dsl Exp $ */
|
||||
/* $NetBSD: linux_misc.c,v 1.191 2007/12/21 22:26:22 njoly Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -64,7 +64,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.190 2007/12/20 23:02:55 dsl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.191 2007/12/21 22:26:22 njoly Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_ptrace.h"
|
||||
|
@ -1159,18 +1159,26 @@ linux_sys_setfsuid(struct lwp *l, const struct linux_sys_setfsuid_args *uap, reg
|
|||
uid = SCARG(uap, uid);
|
||||
if (kauth_cred_getuid(l->l_cred) != uid)
|
||||
return sys_nosys(l, uap, retval);
|
||||
else
|
||||
return (0);
|
||||
|
||||
*retval = uid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* XXX XXX XXX */
|
||||
# ifndef alpha
|
||||
int
|
||||
linux_sys_getfsuid(struct lwp *l, const void *uap, register_t *retval)
|
||||
linux_sys_setfsgid(struct lwp *l, const struct linux_sys_setfsgid_args *uap, register_t *retval)
|
||||
{
|
||||
return sys_getuid(l, uap, retval);
|
||||
/* {
|
||||
syscallarg(gid_t) gid;
|
||||
} */
|
||||
gid_t gid;
|
||||
|
||||
gid = SCARG(uap, gid);
|
||||
if (kauth_cred_getgid(l->l_cred) != gid)
|
||||
return sys_nosys(l, uap, retval);
|
||||
|
||||
*retval = gid;
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
int
|
||||
linux_sys_setresuid(struct lwp *l, const struct linux_sys_setresuid_args *uap, register_t *retval)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: syscalls.master,v 1.21 2007/12/20 23:02:57 dsl Exp $
|
||||
$NetBSD: syscalls.master,v 1.22 2007/12/21 22:26:22 njoly Exp $
|
||||
|
||||
; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
|
||||
; (See syscalls.conf to see what it is processed into.)
|
||||
|
@ -236,7 +236,7 @@
|
|||
136 UNIMPL personality
|
||||
137 UNIMPL afs_syscall
|
||||
138 NOARGS setfsuid16 { int linux32_sys_setfsuid(uid_t uid); }
|
||||
139 NOARGS getfsuid16 { int linux_sys_getfsuid(void); }
|
||||
139 NOARGS setfsgid16 { int linux32_sys_setfsgid(gid_t gid); }
|
||||
140 STD { int linux32_sys_llseek(int fd, u_int32_t ohigh, \
|
||||
u_int32_t olow, netbsd32_caddr_t res, int whence); }
|
||||
141 STD { int linux32_sys_getdents(int fd, \
|
||||
|
@ -352,7 +352,7 @@
|
|||
213 NOARGS { int netbsd32_setuid(uid_t uid); }
|
||||
214 NOARGS { int netbsd32_setgid(gid_t gid); }
|
||||
215 STD { int linux32_sys_setfsuid(uid_t uid); }
|
||||
216 NOARGS { int linux_sys_getfsuid(void); }
|
||||
216 STD { int linux32_sys_setfsgid(gid_t gid); }
|
||||
217 UNIMPL pivot_root
|
||||
218 UNIMPL mincore
|
||||
219 NOARGS { int netbsd32_madvise(netbsd32_voidp addr, \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux32_unistd.c,v 1.17 2007/12/20 23:02:59 dsl Exp $ */
|
||||
/* $NetBSD: linux32_unistd.c,v 1.18 2007/12/21 22:26:22 njoly Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.17 2007/12/20 23:02:59 dsl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.18 2007/12/21 22:26:22 njoly Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -576,6 +576,19 @@ linux32_sys_setfsuid(struct lwp *l, const struct linux32_sys_setfsuid_args *uap,
|
|||
return linux_sys_setfsuid(l, &ua, retval);
|
||||
}
|
||||
|
||||
int
|
||||
linux32_sys_setfsgid(struct lwp *l, const struct linux32_sys_setfsgid_args *uap, register_t *retval)
|
||||
{
|
||||
/* {
|
||||
syscallarg(gid_t) gid;
|
||||
} */
|
||||
struct linux_sys_setfsgid_args ua;
|
||||
|
||||
NETBSD32TO64_UAP(gid);
|
||||
|
||||
return linux_sys_setfsgid(l, &ua, retval);
|
||||
}
|
||||
|
||||
int
|
||||
linux32_sys_setreuid16(struct lwp *l, const struct linux32_sys_setreuid16_args *uap, register_t *retval)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue