aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_lookup.c
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-10-22 09:32:48 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-10-22 09:32:48 +0000
commitd68a41903e7e98eb36b24c2678dd1552fabd047a (patch)
tree67d743dd75dac0605db551f3d4f64632e50167ea /sys/kern/vfs_lookup.c
parent6928ec333033faf66d7249b94e941df99e28f031 (diff)
downloadsrc-d68a41903e7e98eb36b24c2678dd1552fabd047a.tar.gz
src-d68a41903e7e98eb36b24c2678dd1552fabd047a.zip
Notes
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-rw-r--r--sys/kern/vfs_lookup.c40
1 files changed, 13 insertions, 27 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 35a7a691d184..0194dd93156a 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
- * $Id: vfs_lookup.c,v 1.8 1995/07/31 00:35:46 bde Exp $
+ * $Id: vfs_lookup.c,v 1.9 1995/08/24 10:16:59 dfr Exp $
*/
#include <sys/param.h>
@@ -422,7 +422,7 @@ unionlookup:
* If creating and at end of pathname, then can consider
* allowing file to be created.
*/
- if (rdonly || (ndp->ni_dvp->v_mount->mnt_flag & MNT_RDONLY)) {
+ if (rdonly) {
error = EROFS;
goto bad;
}
@@ -510,19 +510,12 @@ nextname:
goto dirloop;
}
/*
- * Check for read-only file systems.
+ * Disallow directory write attempts on read-only file systems.
*/
- if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) {
- /*
- * Disallow directory write attempts on read-only
- * file systems.
- */
- if (rdonly || (dp->v_mount->mnt_flag & MNT_RDONLY) ||
- (wantparent &&
- (ndp->ni_dvp->v_mount->mnt_flag & MNT_RDONLY))) {
- error = EROFS;
- goto bad2;
- }
+ if (rdonly &&
+ (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
+ error = EROFS;
+ goto bad2;
}
if (cnp->cn_flags & SAVESTART) {
ndp->ni_startdir = ndp->ni_dvp;
@@ -638,7 +631,7 @@ relookup(dvp, vpp, cnp)
* If creating and at end of pathname, then can consider
* allowing file to be created.
*/
- if (rdonly || (dvp->v_mount->mnt_flag & MNT_RDONLY)) {
+ if (rdonly) {
error = EROFS;
goto bad;
}
@@ -663,19 +656,12 @@ relookup(dvp, vpp, cnp)
#endif
/*
- * Check for read-only file systems.
+ * Disallow directory write attempts on read-only file systems.
*/
- if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) {
- /*
- * Disallow directory write attempts on read-only
- * file systems.
- */
- if (rdonly || (dp->v_mount->mnt_flag & MNT_RDONLY) ||
- (wantparent &&
- (dvp->v_mount->mnt_flag & MNT_RDONLY))) {
- error = EROFS;
- goto bad2;
- }
+ if (rdonly &&
+ (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
+ error = EROFS;
+ goto bad2;
}
/* ASSERT(dvp == ndp->ni_startdir) */
if (cnp->cn_flags & SAVESTART)