Apply by doing:
cd /usr/src/sys/kern
patch -p0 < 007_chflags.patch
And then rebuild your kernel.
Index: vfs_syscalls.c
===================================================================
RCS file: /cvs/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.56
diff -u -r1.56 vfs_syscalls.c
--- vfs_syscalls.c 1999/02/26 04:51:17 1.56
+++ vfs_syscalls.c 1999/07/30 21:21:44
@@ -1530,10 +1530,19 @@
else if (SCARG(uap, flags) == VNOVAL)
error = EINVAL;
else {
+ if (suser(p->p_ucred, &p->p_acflag)) {
+ if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0)
+ goto out;
+ if (vattr.va_type == VCHR || vattr.va_type == VBLK) {
+ error = EINVAL;
+ goto out;
+ }
+ }
VATTR_NULL(&vattr);
vattr.va_flags = SCARG(uap, flags);
error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
}
+out:
vput(vp);
return (error);
}
@@ -1567,10 +1576,20 @@
else if (SCARG(uap, flags) == VNOVAL)
error = EINVAL;
else {
+ if (suser(p->p_ucred, &p->p_acflag)) {
+ if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))
+ != 0)
+ goto out;
+ if (vattr.va_type == VCHR || vattr.va_type == VBLK) {
+ error = EINVAL;
+ goto out;
+ }
+ }
VATTR_NULL(&vattr);
vattr.va_flags = SCARG(uap, flags);
error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
}
+out:
VOP_UNLOCK(vp, 0, p);
return (error);
}