diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-08-02 19:59:02 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-08-02 19:59:02 +0000 |
commit | b05d78c8384122b9c7a7adfefba1f40fe59df121 (patch) | |
tree | 19e93f84b12703aee70581a09b34fa24a1fd6dbb /sys/kern | |
parent | d3d27a33a4e8344324828d20b82f22692b4297fb (diff) |
Return EINVAL for invalid mode flags to access(2)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 760742ee5ce..788aa3b2ed0 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.9 1996/06/02 16:24:42 niklas Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.10 1996/08/02 19:59:01 tholo Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -1164,6 +1164,8 @@ sys_access(p, v, retval) int error, flags, t_gid, t_uid; struct nameidata nd; + if (SCARG(uap, flags) & ~(R_OK | W_OK | X_OK)) + return (EINVAL); t_uid = cred->cr_uid; t_gid = cred->cr_gid; cred->cr_uid = p->p_cred->p_ruid; |