diff options
author | dg <dg@FreeBSD.org> | 1995-11-12 10:16:53 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-11-12 10:16:53 +0000 |
commit | 3f429c5533b604bcf6397dea6ad49e7cf6c7b8ff (patch) | |
tree | a59c2918b630f1fdd66be9df10be77c984e38f25 /sys/isofs/cd9660/cd9660_vnops.c | |
parent | 867529addcb60d59dfa383c4c693cc4c5b802ff6 (diff) | |
download | FreeBSD-src-3f429c5533b604bcf6397dea6ad49e7cf6c7b8ff.zip FreeBSD-src-3f429c5533b604bcf6397dea6ad49e7cf6c7b8ff.tar.gz |
Fix isoilk hang caused by not checking for read-onlyness in several places.
The fix for this in Lite-2 is more complete, but these quick hacks of mine
are safer for now. I plan to integrate the additional Lite-2 stuff at some
later time. Should completely fix PR810.
Diffstat (limited to 'sys/isofs/cd9660/cd9660_vnops.c')
-rw-r--r-- | sys/isofs/cd9660/cd9660_vnops.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 074de85..0296eca 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.18 1995/10/31 12:13:47 phk Exp $ + * $Id: cd9660_vnops.c,v 1.19 1995/11/09 08:13:37 bde Exp $ */ #include <sys/param.h> @@ -183,6 +183,22 @@ cd9660_access(ap) struct proc *a_p; } */ *ap; { + /* + * Disallow write attempts on read-only file systems; + * unless the file is a socket, fifo, or a block or + * character device resident on the file system. + */ + if (ap->a_mode & VWRITE) { + switch (ap->a_vp->v_type) { + case VDIR: + case VLNK: + case VREG: + if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + return (EROFS); + break; + } + } + return (0); } |