From 433fc8eeffa614ac974539d56caf875a8b001065 Mon Sep 17 00:00:00 2001 From: jh Date: Fri, 20 Apr 2012 10:08:30 +0000 Subject: The value of flags matching VNOVAL can't be supported. Return EOPNOTSUPP from setfflags() in this case. This fixes the return value of chflags(path, -1). Discussed with: bde MFC after: 2 weeks --- sys/kern/vfs_syscalls.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/kern/vfs_syscalls.c') diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 613f30d..0400504 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2744,6 +2744,10 @@ setfflags(td, vp, flags) struct mount *mp; struct vattr vattr; + /* We can't support the value matching VNOVAL. */ + if (flags == VNOVAL) + return (EOPNOTSUPP); + /* * Prevent non-root users from setting flags on devices. When * a device is reused, users can retain ownership of the device -- cgit v1.1