summaryrefslogtreecommitdiffstats
path: root/sys/isofs/cd9660/cd9660_lookup.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-10-22 09:32:48 +0000
committerdg <dg@FreeBSD.org>1995-10-22 09:32:48 +0000
commitb5341559e2be008ac6cd1e40a68bdd77a3ec8b63 (patch)
tree67d743dd75dac0605db551f3d4f64632e50167ea /sys/isofs/cd9660/cd9660_lookup.c
parent67678134fdc677845e30d947c441374ac61106a6 (diff)
downloadFreeBSD-src-b5341559e2be008ac6cd1e40a68bdd77a3ec8b63.zip
FreeBSD-src-b5341559e2be008ac6cd1e40a68bdd77a3ec8b63.tar.gz
Moved the filesystem read-only check out of the syscalls and into the
filesystem layer, as was done in lite-2. Merged in some other cosmetic changes while I was at it. Rewrote most of msdosfs_access() to be more like ufs_access() and to include the FS read-only check. Obtained from: partially from 4.4BSD-lite2
Diffstat (limited to 'sys/isofs/cd9660/cd9660_lookup.c')
-rw-r--r--sys/isofs/cd9660/cd9660_lookup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c
index e035ce0..9c359d1 100644
--- a/sys/isofs/cd9660/cd9660_lookup.c
+++ b/sys/isofs/cd9660/cd9660_lookup.c
@@ -38,7 +38,7 @@
* from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91
*
* @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_lookup.c,v 1.6 1995/01/16 17:03:23 joerg Exp $
+ * $Id: cd9660_lookup.c,v 1.7 1995/05/30 08:04:57 rgrimes Exp $
*/
#include <sys/param.h>
@@ -142,6 +142,9 @@ cd9660_lookup(ap)
return (ENOTDIR);
if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc)))
return (error);
+ if ((flags & ISLASTCN) && (vdp->v_mount->mnt_flag & MNT_RDONLY) &&
+ (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME))
+ return (EROFS);
/*
* We now have a segment name to search for, and a directory to search.
OpenPOWER on IntegriCloud