From owner-cvs-all Mon Oct 26 22:03:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA13878 for cvs-all-outgoing; Mon, 26 Oct 1998 22:03:31 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: (from jkoshy@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA13869; Mon, 26 Oct 1998 22:03:27 -0800 (PST) (envelope-from jkoshy) Date: Mon, 26 Oct 1998 22:03:27 -0800 (PST) From: Joseph Koshy Message-Id: <199810270603.WAA13869@hub.freebsd.org> X-Mailer: exmh version 2.0.2 2/24/98 To: cvs-committers@FreeBSD.ORG cc: Andre Albsmeier Subject: Fix for kern/7272 --> 2.2-STABLE Mime-Version: 1.0 Content-Type: text/plain Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Unless someone has grave objections I will soon be merging the fix for kern/7272 (see rev 1.100 "src/sys/ufs/ufs/ufs_vnops.c") to the -STABLE branch. This fix prevents a mounted-on directory from being removed over an NFS mount. Regards, Koshy --------------------------- The following patch has been tested by Andre Albsmeier and myself on -STABLE: *** sys/ufs/ufs/ufs_vnops.c.ORI Wed Sep 30 07:37:48 1998 --- sys/ufs/ufs/ufs_vnops.c Wed Sep 30 07:47:32 1998 *************** *** 1438,1443 **** --- 1438,1447 ---- * ".." will contain a reference to * the current directory and thus be * non-empty.) + * Do not allow the removal of mounted on + * directories (this can happen when an NFS + * exported filesystem tries to remove a locally + * mounted on directory). */ error = 0; if (ip->i_nlink != 2 || *************** *** 1453,1458 **** --- 1457,1466 ---- if ((dp->i_flags & APPEND) || (ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND))) { error = EPERM; + goto out; + } + if (vp->v_mountedhere != 0) { + error = EINVAL; goto out; } /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message