Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 1998 22:03:27 -0800 (PST)
From:      Joseph Koshy <jkoshy>
To:        cvs-committers@FreeBSD.ORG
Cc:        Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Subject:   Fix for kern/7272 --> 2.2-STABLE
Message-ID:  <199810270603.WAA13869@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help


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
<jkoshy@freebsd.org>

---------------------------

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810270603.WAA13869>