-----BEGIN PGP SIGNED MESSAGE----- Index: kern/vfs_syscalls.c =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.51.2.7 retrieving revision 1.51.2.8 diff -u -r1.51.2.7 -r1.51.2.8 --- vfs_syscalls.c 1998/07/03 03:50:31 1.51.2.7 +++ vfs_syscalls.c 1999/08/04 18:58:56 1.51.2.8 @@ -1439,6 +1439,17 @@ if (error) return (error); vp = nd.ni_vp; + if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))) + return (error); + /* + * Prevent non-root users from setting flags on devices. When + * a device is reused, users can retain ownership of the device + * if they are allowed to set flags and programs assume that + * chown can't fail when done as root. + */ + if ((vp->v_type == VCHR || vp->v_type == VBLK) && + ((error = suser(p->p_ucred, &p->p_acflag)) != 0)) + return (error); LEASE_CHECK(vp, p, p->p_ucred, LEASE_WRITE); VOP_LOCK(vp); VATTR_NULL(&vattr); -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia Charset: noconv Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface iQCVAwUBN9CBLFUuHi5z0oilAQGGLwQAmm+H0NOZodXFnbxhUIeVzaP4yHPH4v5o 5t39iCFwkFxK6P7JKxghh+Bnyc0OcZjRr3esGT5NWzLDbST0WcPE4d9QO8cvAIBX QBdR4/ENyjib2VkR8SEz12k6IewzCYtyv4nT+s18QzJII9MAL0f5thusgQTYre0d L6XPX52O3Y0= =8jMr -----END PGP SIGNATURE-----