summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-18 07:00:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-18 07:00:00 +0000
commit6880f3a4d4a660d40ce8c44fc24d9ff5217a691d (patch)
treeed7f40ffbca5dcafc3b74e4857366cfcc194b904 /sys/kern/vfs_syscalls.c
parente7c3e90b700ff86218d17c25e72ed42c8c3c5306 (diff)
Use 0177777, not 07777 as the mask to check for EINVAL. This allows
one to use the st_mode field in struct stat as an argument to f?chmod().
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index c73c3e1bd16..d444fea36e9 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.30 1997/11/17 07:46:24 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.31 1997/11/18 06:59:59 millert Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -1529,7 +1529,7 @@ sys_chmod(p, v, retval)
int error;
struct nameidata nd;
- if (SCARG(uap, mode) & ~ALLPERMS)
+ if (SCARG(uap, mode) & ~(S_IFMT | ALLPERMS))
return (EINVAL);
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
@@ -1568,7 +1568,7 @@ sys_fchmod(p, v, retval)
struct file *fp;
int error;
- if (SCARG(uap, mode) & ~ALLPERMS)
+ if (SCARG(uap, mode) & ~(S_IFMT | ALLPERMS))
return (EINVAL);
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)