summaryrefslogtreecommitdiff
path: root/sys/isofs
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-03-21 13:44:05 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-03-21 13:44:05 +0000
commit03c6166378b767783215ed2591b98c3664a878e8 (patch)
tree4db1fa0a07918910ff78eda2653798de8afee156 /sys/isofs
parent0ffc3492dbf1a836c5da2f58639ebee32f48c3bc (diff)
Add support for mounting arbitrary sessions, from Enache Adrian
OK deraadt@ mjc@ canacar@ krw@, with much input from Enache himself
Diffstat (limited to 'sys/isofs')
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 95a2d6f45a3..ed51eaf31cb 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vfsops.c,v 1.42 2006/08/07 15:50:42 pedro Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.43 2007/03/21 13:44:04 pedro Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
@@ -236,7 +236,7 @@ iso_mountfs(devvp, mp, p, argp)
struct iso_supplementary_descriptor *sup = NULL;
struct iso_directory_record *rootp;
int logical_block_size;
- int sess = 0;
+ int sess;
if (!ronly)
return (EROFS);
@@ -259,16 +259,25 @@ iso_mountfs(devvp, mp, p, argp)
return (error);
needclose = 1;
- /* This is the "logical sector size". The standard says this
+ /*
+ * This is the "logical sector size". The standard says this
* should be 2048 or the physical sector size on the device,
* whichever is greater. For now, we'll just use a constant.
*/
iso_bsize = ISO_DEFAULT_BLOCK_SIZE;
- error = VOP_IOCTL(devvp, CDIOREADMSADDR, (caddr_t)&sess, 0, FSCRED, p);
- if (error)
+ if (argp->flags & ISOFSMNT_SESS) {
+ sess = argp->sess;
+ if (sess < 0)
+ sess = 0;
+ } else {
sess = 0;
-
+ error = VOP_IOCTL(devvp, CDIOREADMSADDR, (caddr_t)&sess, 0,
+ FSCRED, p);
+ if (error)
+ sess = 0;
+ }
+
joliet_level = 0;
for (iso_blknum = 16; iso_blknum < 100; iso_blknum++) {
if ((error = bread(devvp,