From nobody  Fri Nov 14 00:15:43 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.7/8.8.7) id AAA10355;
          Fri, 14 Nov 1997 00:15:43 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199711140815.AAA10355@hub.freebsd.org>
Date: Fri, 14 Nov 1997 00:15:43 -0800 (PST)
From: keith@email.gcn.net.tw
To: freebsd-gnats-submit@freebsd.org
Subject: FreeBSD can't read MS Joliet CDs.
X-Send-Pr-Version: www-1.0

>Number:         5038
>Category:       kern
>Synopsis:       FreeBSD can't read MS Joliet CDs.
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    dcs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 14 00:20:02 PST 1997
>Closed-Date:    Sat Apr 24 10:58:41 PDT 1999
>Last-Modified:  Sat Apr 24 11:00:22 PDT 1999
>Originator:     Keith Jang
>Release:        FreeBSD 3.0-current
>Organization:
private site
>Environment:
FreeBSD 3.0-CURRENT #36: Fri Nov 14 03:27:44 CST 1997
>Description:
FreeBSD can't read the long filenames on Joliet CDs.
>How-To-Repeat:
Just insert a Joliet CD, and the filenames are changed to xxx~1.	
>Fix:
I modified some code under /sys/isofs/cd9660, and it can read the long
filenames, though Unicode is not implemented yet.
>Release-Note:
>Audit-Trail:

From: Keith Jang <keith@keith.private>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/5038
Date: Sat, 15 Nov 1997 14:32:48 +0800 (CST)

 The following are three files with a patch for reading joliet.
 
 /sys/isofs/cd9660/cd9660_joliet.h:
 
 begin 644 cd9660_joliet.h.gz
 M'XL("`E9;#0``V-D.38V,%]J;VQI970N:`!U4FUKVS`8_.Y?<3`86_'RNI:$
 M?NIB=Z1X-#0A7\8HBOPX%E,L(\EMPMA_WR,EA<(2,+*MTYWN3NI?);C"#R6M
 M<:;R>#!:D4>^]SUX@_GR<7IS,\`L@VM)JDI)X95I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GSCPDW&@[`/>E,#1O%+&"5"5IGH&820)%^!,-'N-5*OMM=\X
 M?]^QO'D8#&S8:W7E7+M0^[FFK4H/32-B5"94$;_2-'Z<$5[[URA]X21\[^CV
 MIE'.[[DR8%7MPJE`OFE8]88-!G6<@UG^X\&)5)S67OKFX=2NIV1+TO:F"Y7G
 M*<D(E2%N>TQ$Q),<-Q\<L8W+5=;M67@=S?`YS+&JJ>YK\>LI>'Q:+N:_@\4/
 M/?ZJJB.VVV=[=NV[^$ADM#F6>*MF+E&(7K74R_F?^=*]^]>QZP-TS#TI\!J!
 I]U^"FT9P<RR(R3I4J;PKOBO.",MH<8K!')I-;M-P,G\!MVX89J$%```I
 `
 end
 
 /sys/isofs/cd9660/iso_joliet.h:
 
 begin 644 iso_joliet.h.gz
 M'XL("`E9;#0``VES;U]J;VQI970N:`!UD,U.PS`0A,_Q4ZS$!:**AOY)54]`
 M`DI)Z:'`U0KVFAJE=F1OJO+VV#WUX/IB:;X9SZ['.8,<-EHXZZTB6-M.(T%U
 MHGL@"_5NNUPL"G@NP?<HM-*B)6U-"(T9NY&HM,'HXNMM4U<?O"X?H#A-YFDV
 MB4RE6%-]54V,SHJK.*9GTZMX&O$\.=7+^^9Q]Q:X"B?I**NGSU?&M"$0,J[,
 M?\\_P7^03'O`6T]N$`3:6RZU0T'6_?%P6R<A#VH01RS+,@"Q;QWD=J#O08U@
 MX'YO'9V%#LW=*M'1X1&[RP8_]'V'!S34AA:)7CC=AT;(_5&&)_X!ZD!VR;8!
 "``!O
 `
 end
 
 patch for /sys:
 
 diff -c -r sys/conf/files sys.keith/conf/files
 *** sys/conf/files	Thu Nov 13 03:25:21 1997
 --- sys.keith/conf/files	Fri Nov 14 22:03:23 1997
 ***************
 *** 61,66 ****
 --- 61,67 ----
   isofs/cd9660/cd9660_util.c	optional cd9660
   isofs/cd9660/cd9660_vfsops.c	optional cd9660
   isofs/cd9660/cd9660_vnops.c	optional cd9660
 + isofs/cd9660/cd9660_joliet.c	optional cd9660
   kern/imgact_aout.c	standard
   kern/imgact_elf.c	standard
   kern/imgact_gzip.c	optional gzip
 diff -c -r sys/conf/files.newconf sys.keith/conf/files.newconf
 *** sys/conf/files.newconf	Thu Nov 13 03:25:21 1997
 --- sys.keith/conf/files.newconf	Fri Nov 14 22:03:23 1997
 ***************
 *** 39,44 ****
 --- 39,45 ----
   file	isofs/cd9660/cd9660_util.c	cd9660
   file	isofs/cd9660/cd9660_vfsops.c	cd9660
   file	isofs/cd9660/cd9660_vnops.c	cd9660
 + file	isofs/cd9660/cd9660_joliet.c	cd9660
   file	kern/init_main.c
   file	kern/init_sysent.c
   file	kern/kern_acct.c
 Only in sys.keith/isofs/cd9660: cd9660_joliet.c
 Only in sys.keith/isofs/cd9660: cd9660_joliet.h
 diff -c -r sys/isofs/cd9660/cd9660_lookup.c sys.keith/isofs/cd9660/cd9660_lookup.c
 *** sys/isofs/cd9660/cd9660_lookup.c	Thu Nov 13 03:26:37 1997
 --- sys.keith/isofs/cd9660/cd9660_lookup.c	Fri Nov 14 22:03:43 1997
 ***************
 *** 50,56 ****
 --- 50,58 ----
   
   #include <isofs/cd9660/iso.h>
   #include <isofs/cd9660/cd9660_node.h>
 + #include <isofs/cd9660/cd9660_joliet.h>
   #include <isofs/cd9660/iso_rrip.h>
 + #include <isofs/cd9660/iso_joliet.h>
   
   /*
    * Convert a component of a pathname into a pointer to a locked inode.
 ***************
 *** 267,272 ****
 --- 269,287 ----
   				goto found;
   			ino = 0;
   			break;
 + 		case ISO_FTYPE_JOLIET:
 + 		  if (isonum_711(ep->flags)&2)
 + 		    ino = isodirino(ep, imp);
 + 		  else
 + 		    ino = dbtob(bp->b_blkno) + entryoffsetinblock;
 + 
 + 		  dp->i_ino = ino;
 + 		  cd9660_joliet_getname(ep,altname,&namelen);
 + 		  if (namelen == cnp->cn_namelen
 + 		      && !bcmp(name, altname, namelen))
 + 		    goto found;
 + 		  ino = 0;
 + 		  break;
   		}
   		dp->i_offset += reclen;
   		entryoffsetinblock += reclen;
 diff -c -r sys/isofs/cd9660/cd9660_mount.h sys.keith/isofs/cd9660/cd9660_mount.h
 *** sys/isofs/cd9660/cd9660_mount.h	Thu Nov 13 03:26:37 1997
 --- sys.keith/isofs/cd9660/cd9660_mount.h	Fri Nov 14 22:03:43 1997
 ***************
 *** 47,52 ****
   	int	flags;			/* mounting flags, see below */
   	int	ssector;		/* starting sector, 0 for 1st session */
   };
 ! #define	ISOFSMNT_NORRIP	0x00000001	/* disable Rock Ridge Ext.*/
 ! #define	ISOFSMNT_GENS	0x00000002	/* enable generation numbers */
 ! #define	ISOFSMNT_EXTATT	0x00000004	/* enable extended attributes */
 --- 47,53 ----
   	int	flags;			/* mounting flags, see below */
   	int	ssector;		/* starting sector, 0 for 1st session */
   };
 ! #define	ISOFSMNT_NORRIP   0x00000001	/* disable Rock Ridge Ext.*/
 ! #define	ISOFSMNT_GENS     0x00000002	/* enable generation numbers */
 ! #define	ISOFSMNT_EXTATT   0x00000004	/* enable extended attributes */
 ! #define ISOFSMNT_NOJOLIET 0x00000008    /* disable Microsoft Joliet Ext.*/
 diff -c -r sys/isofs/cd9660/cd9660_vfsops.c sys.keith/isofs/cd9660/cd9660_vfsops.c
 *** sys/isofs/cd9660/cd9660_vfsops.c	Thu Nov 13 03:26:37 1997
 --- sys.keith/isofs/cd9660/cd9660_vfsops.c	Fri Nov 14 22:03:43 1997
 ***************
 *** 55,61 ****
 --- 55,63 ----
   #include <sys/stat.h>
   
   #include <isofs/cd9660/iso.h>
 + #include <isofs/cd9660/iso_joliet.h>
   #include <isofs/cd9660/iso_rrip.h>
 + #include <isofs/cd9660/cd9660_joliet.h>
   #include <isofs/cd9660/cd9660_node.h>
   #include <isofs/cd9660/cd9660_mount.h>
   
 ***************
 *** 261,267 ****
   	struct iso_args *argp;
   {
   	register struct iso_mnt *isomp = (struct iso_mnt *)0;
 ! 	struct buf *bp = NULL;
   	dev_t dev = devvp->v_rdev;
   	int error = EINVAL;
   	int needclose = 0;
 --- 263,269 ----
   	struct iso_args *argp;
   {
   	register struct iso_mnt *isomp = (struct iso_mnt *)0;
 ! 	struct buf *bp = NULL, *joliet_bp = NULL;
   	dev_t dev = devvp->v_rdev;
   	int error = EINVAL;
   	int needclose = 0;
 ***************
 *** 271,279 ****
 --- 273,283 ----
   	int iso_blknum;
   	struct iso_volume_descriptor *vdp = 0;
   	struct iso_primary_descriptor *pri;
 + 	struct iso_supplementary_descriptor *sup = NULL;
   	struct iso_sierra_primary_descriptor *pri_sierra;
   	struct iso_directory_record *rootp;
   	int logical_block_size;
 + 	int joliet_level = -1;
   
   	if (!ronly)
   		return EROFS;
 ***************
 *** 316,321 ****
 --- 320,344 ----
   				goto out;
   			} else
   				high_sierra = 1;
 + 		} else {
 + 		  /*
 + 		   * We know it's ISO9660 fs, now get Supplementary Volume
 + 		   * Descriptor to check if it's Microsoft Joliet format.
 + 		   */
 + 		  if (error = bread(devvp, (1 + iso_blknum) * btodb(iso_bsize),
 + 				    iso_bsize, NOCRED, &joliet_bp))
 + 		    goto out;
 + 
 + 		  sup = (struct iso_supplementary_descriptor *)joliet_bp->b_data;
 + 		  joliet_level = cd9660_joliet_level(sup);
 + 
 + 		  if (joliet_level < 0) {
 + 		    argp->flags |= ISOFSMNT_NOJOLIET;
 + 		  } else {
 + 		    argp->flags |= ISOFSMNT_NORRIP;
 + 		    argp->flags &= ~ISOFSMNT_GENS;
 + 		  }
 + 		  break;
   		}
   
   		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) {
 ***************
 *** 328,340 ****
   		brelse(bp);
   	}
   
 ! 	if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) {
   		error = EINVAL;
   		goto out;
   	}
   
 - 	pri = (struct iso_primary_descriptor *)vdp;
   	pri_sierra = (struct iso_sierra_primary_descriptor *)vdp;
   
   	logical_block_size =
   		isonum_723 (high_sierra?
 --- 351,363 ----
   		brelse(bp);
   	}
   
 ! 	if ((isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) && (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_SUPPLEMENTARY)) {
   		error = EINVAL;
   		goto out;
   	}
   
   	pri_sierra = (struct iso_sierra_primary_descriptor *)vdp;
 + 	pri = (struct iso_primary_descriptor *)vdp;
   
   	logical_block_size =
   		isonum_723 (high_sierra?
 ***************
 *** 350,356 ****
   	rootp = (struct iso_directory_record *)
   		(high_sierra?
   		 pri_sierra->root_directory_record:
 ! 		 pri->root_directory_record);
   
   	isomp = malloc(sizeof *isomp, M_ISOFSMNT, M_WAITOK);
   	bzero((caddr_t)isomp, sizeof *isomp);
 --- 373,381 ----
   	rootp = (struct iso_directory_record *)
   		(high_sierra?
   		 pri_sierra->root_directory_record:
 ! 		 ((joliet_level < 0)?
 ! 		  pri->root_directory_record:
 ! 		  sup->root_directory_record));
   
   	isomp = malloc(sizeof *isomp, M_ISOFSMNT, M_WAITOK);
   	bzero((caddr_t)isomp, sizeof *isomp);
 ***************
 *** 380,385 ****
 --- 405,412 ----
   	bp->b_flags |= B_AGE;
   	brelse(bp);
   	bp = NULL;
 + 	brelse(joliet_bp);
 + 	joliet_bp = NULL;
   
   	mp->mnt_data = (qaddr_t)isomp;
   	mp->mnt_stat.f_fsid.val[0] = (long)dev;
 ***************
 *** 416,439 ****
   		brelse(bp);
   		bp = NULL;
   	}
 ! 	isomp->im_flags = argp->flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS|ISOFSMNT_EXTATT);
   
   	if(high_sierra)
   		/* this effectively ignores all the mount flags */
   		isomp->iso_ftype = ISO_FTYPE_HIGH_SIERRA;
   	else
 ! 		switch (isomp->im_flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS)) {
   		  default:
   			  isomp->iso_ftype = ISO_FTYPE_DEFAULT;
   			  break;
 ! 		  case ISOFSMNT_GENS|ISOFSMNT_NORRIP:
   			  isomp->iso_ftype = ISO_FTYPE_9660;
   			  break;
 ! 		  case 0:
   			  isomp->iso_ftype = ISO_FTYPE_RRIP;
   			  break;
   		}
 - 
   	return 0;
   out:
   	if (bp)
 --- 443,469 ----
   		brelse(bp);
   		bp = NULL;
   	}
 ! 	isomp->im_flags = argp->flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS|ISOFSMNT_EXTATT|ISOFSMNT_NOJOLIET);
   
   	if(high_sierra)
   		/* this effectively ignores all the mount flags */
   		isomp->iso_ftype = ISO_FTYPE_HIGH_SIERRA;
   	else
 ! 		switch (isomp->im_flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS|
 ! 					 ISOFSMNT_NOJOLIET)) {
   		  default:
   			  isomp->iso_ftype = ISO_FTYPE_DEFAULT;
   			  break;
 ! 		  case ISOFSMNT_GENS|ISOFSMNT_NORRIP|ISOFSMNT_NOJOLIET:
   			  isomp->iso_ftype = ISO_FTYPE_9660;
   			  break;
 ! 		  case ISOFSMNT_NOJOLIET:
   			  isomp->iso_ftype = ISO_FTYPE_RRIP;
   			  break;
 + 		  case ISOFSMNT_NORRIP:
 + 		          isomp->iso_ftype = ISO_FTYPE_JOLIET;
 + 			  break;
   		}
   	return 0;
   out:
   	if (bp)
 ***************
 *** 507,513 ****
   	struct iso_directory_record *dp =
   	    (struct iso_directory_record *)imp->root;
   	ino_t ino = isodirino(dp, imp);
 ! 	
   	/*
   	 * With RRIP we must use the `.' entry of the root directory.
   	 * Simply tell vget, that it's a relocated directory.
 --- 537,543 ----
   	struct iso_directory_record *dp =
   	    (struct iso_directory_record *)imp->root;
   	ino_t ino = isodirino(dp, imp);
 ! 
   	/*
   	 * With RRIP we must use the `.' entry of the root directory.
   	 * Simply tell vget, that it's a relocated directory.
 diff -c -r sys/isofs/cd9660/cd9660_vnops.c sys.keith/isofs/cd9660/cd9660_vnops.c
 *** sys/isofs/cd9660/cd9660_vnops.c	Thu Nov 13 03:26:37 1997
 --- sys.keith/isofs/cd9660/cd9660_vnops.c	Fri Nov 14 22:03:43 1997
 ***************
 *** 56,61 ****
 --- 56,62 ----
   #include <isofs/cd9660/iso.h>
   #include <isofs/cd9660/cd9660_node.h>
   #include <isofs/cd9660/iso_rrip.h>
 + #include <isofs/cd9660/iso_joliet.h>
   
   static int cd9660_setattr __P((struct vop_setattr_args *));
   static int cd9660_access __P((struct vop_access_args *));
 ***************
 *** 540,545 ****
 --- 541,552 ----
   			if (idp->current.d_namlen)
   				error = iso_uiodir(idp,&idp->current,idp->curroff);
   			break;
 + 		case ISO_FTYPE_JOLIET:
 + 		  cd9660_joliet_getname(ep,idp->current.d_name, &namelen);
 + 		  idp->current.d_namlen = (u_char)namelen;
 + 		  if (idp->current.d_namlen)
 + 		    error = iso_uiodir(idp,&idp->current,idp->curroff);
 + 		  break;
   		default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 || ISO_FTYPE_HIGH_SIERRA*/
   			strcpy(idp->current.d_name,"..");
   			switch (ep->name[0]) {
 diff -c -r sys/isofs/cd9660/iso.h sys.keith/isofs/cd9660/iso.h
 *** sys/isofs/cd9660/iso.h	Thu Nov 13 03:26:37 1997
 --- sys.keith/isofs/cd9660/iso.h	Fri Nov 14 22:03:43 1997
 ***************
 *** 54,59 ****
 --- 54,60 ----
   
   /* volume descriptor types */
   #define ISO_VD_PRIMARY 1
 + #define ISO_VD_SUPPLEMENTARY 2
   #define ISO_VD_END 255
   
   #define ISO_STANDARD_ID "CD001"
 ***************
 *** 98,103 ****
 --- 99,145 ----
   };
   #define ISO_DEFAULT_BLOCK_SIZE		2048
   
 + /*
 +  * Used by Microsoft Joliet extension to ISO9660. Almost the same
 +  * as PVD, but byte position 8 is a flag, and 89-120 is for escape.
 +  */
 + 
 + struct iso_supplementary_descriptor {
 + 	char type			[ISODCL (  1,	1)]; /* 711 */
 + 	char id				[ISODCL (  2,	6)];
 + 	char version			[ISODCL (  7,	7)]; /* 711 */
 + 	char flags			[ISODCL (  8,	8)];
 + 	char system_id			[ISODCL (  9,  40)]; /* achars */
 + 	char volume_id			[ISODCL ( 41,  72)]; /* dchars */
 + 	char unused2			[ISODCL ( 73,  80)];
 + 	char volume_space_size		[ISODCL ( 81,  88)]; /* 733 */
 + 	char escape			[ISODCL ( 89, 120)];
 + 	char volume_set_size		[ISODCL (121, 124)]; /* 723 */
 + 	char volume_sequence_number	[ISODCL (125, 128)]; /* 723 */
 + 	char logical_block_size		[ISODCL (129, 132)]; /* 723 */
 + 	char path_table_size		[ISODCL (133, 140)]; /* 733 */
 + 	char type_l_path_table		[ISODCL (141, 144)]; /* 731 */
 + 	char opt_type_l_path_table	[ISODCL (145, 148)]; /* 731 */
 + 	char type_m_path_table		[ISODCL (149, 152)]; /* 732 */
 + 	char opt_type_m_path_table	[ISODCL (153, 156)]; /* 732 */
 + 	char root_directory_record	[ISODCL (157, 190)]; /* 9.1 */
 + 	char volume_set_id		[ISODCL (191, 318)]; /* dchars */
 + 	char publisher_id		[ISODCL (319, 446)]; /* achars */
 + 	char preparer_id		[ISODCL (447, 574)]; /* achars */
 + 	char application_id		[ISODCL (575, 702)]; /* achars */
 + 	char copyright_file_id		[ISODCL (703, 739)]; /* 7.5 dchars */
 + 	char abstract_file_id		[ISODCL (740, 776)]; /* 7.5 dchars */
 + 	char bibliographic_file_id	[ISODCL (777, 813)]; /* 7.5 dchars */
 + 	char creation_date		[ISODCL (814, 830)]; /* 8.4.26.1 */
 + 	char modification_date		[ISODCL (831, 847)]; /* 8.4.26.1 */
 + 	char expiration_date		[ISODCL (848, 864)]; /* 8.4.26.1 */
 + 	char effective_date		[ISODCL (865, 881)]; /* 8.4.26.1 */
 + 	char file_structure_version	[ISODCL (882, 882)]; /* 711 */
 + 	char unused4			[ISODCL (883, 883)];
 + 	char application_data		[ISODCL (884, 1395)];
 + 	char unused5			[ISODCL (1396, 2048)];
 + };
 + 
   struct iso_sierra_primary_descriptor {
   	char unknown1			[ISODCL (  1,	8)]; /* 733 */
   	char type			[ISODCL (  9,	9)]; /* 711 */
 ***************
 *** 175,181 ****
   
   /* CD-ROM Format type */
   enum ISO_FTYPE	{ ISO_FTYPE_DEFAULT, ISO_FTYPE_9660, ISO_FTYPE_RRIP,
 ! 		  ISO_FTYPE_ECMA, ISO_FTYPE_HIGH_SIERRA };
   
   #ifndef	ISOFSMNT_ROOT
   #define	ISOFSMNT_ROOT	0
 --- 217,223 ----
   
   /* CD-ROM Format type */
   enum ISO_FTYPE	{ ISO_FTYPE_DEFAULT, ISO_FTYPE_9660, ISO_FTYPE_RRIP,
 ! 		  ISO_FTYPE_JOLIET, ISO_FTYPE_ECMA, ISO_FTYPE_HIGH_SIERRA };
   
   #ifndef	ISOFSMNT_ROOT
   #define	ISOFSMNT_ROOT	0
 Only in sys.keith/isofs/cd9660: iso_joliet.h

From: Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
To: freebsd-gnats-submit@freebsd.org, keith@email.gcn.net.tw
Cc:  Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sun, 22 Mar 1998 19:47:44 +0100 (CET)

 Hi,
 
 this is a new diff from /usr/src to support Joliet FS extensions to
 CD9660. It will also run with RRIP, either like this or with minor
 modifications. I can do this as soon as someone supplies me with a
 documentation about mixing RRIP and Joliet (which is expressedly
 allowed in the Joliet documentation) or supplies me with a sample CD.
 
 This diff is to be used _instead_ of the diff in the original PR.
 
 This is expected to close PR bin/5567 when merged back to -stable.
 
 cu Jo
 
 ---------------------------------------------------------------------
 FreeBSD: The Power to Serve                  <http://www.freebsd.org>
 Joachim Kuebart
 Tel: +49 711 653706          Replicants are like any other machine --
 Germany                      they're either a benefit or a hazard.
 
 
 Index: sbin/mount_cd9660/mount_cd9660.8
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sbin/mount_cd9660/mount_cd9660.8,v
 retrieving revision 1.5
 diff -u -r1.5 mount_cd9660.8
 --- mount_cd9660.8	1997/12/29 07:03:46	1.5
 +++ mount_cd9660.8	1998/03/22 10:27:36
 @@ -67,6 +67,8 @@
  only the last one will be listed.)
  In either case, files may be opened without explicitly stating a
  version number.
 +.It Fl j
 +Do not use any Joliet extensions included in the filesystem.
  .It Fl o
  Options are specified with a
  .Fl o
 Index: sbin/mount_cd9660/mount_cd9660.c
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sbin/mount_cd9660/mount_cd9660.c,v
 retrieving revision 1.12
 diff -u -r1.12 mount_cd9660.c
 --- mount_cd9660.c	1997/04/29 15:56:40	1.12
 +++ mount_cd9660.c	1998/03/16 18:41:59
 @@ -73,6 +73,7 @@
  	{ "extatt", 0, ISOFSMNT_EXTATT, 1 },
  	{ "gens", 0, ISOFSMNT_GENS, 1 },
  	{ "rrip", 1, ISOFSMNT_NORRIP, 1 },
 +	{ "joliet", 1, ISOFSMNT_NOJOLIET, 1 },
  	{ NULL }
  };
  
 @@ -91,13 +92,16 @@
  	mntflags = opts = verbose = 0;
  	memset(&args, 0, sizeof args);
  	args.ssector = -1;
 -	while ((ch = getopt(argc, argv, "ego:rs:v")) != -1)
 +	while ((ch = getopt(argc, argv, "egjo:rs:v")) != -1)
  		switch (ch) {
  		case 'e':
  			opts |= ISOFSMNT_EXTATT;
  			break;
  		case 'g':
  			opts |= ISOFSMNT_GENS;
 +			break;
 +		case 'j':
 +			opts |= ISOFSMNT_NOJOLIET;
  			break;
  		case 'o':
  			getmntopts(optarg, mopts, &mntflags, &opts);
 Index: sys/isofs/cd9660/cd9660_lookup.c
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/cd9660_lookup.c,v
 retrieving revision 1.20
 diff -u -r1.20 cd9660_lookup.c
 --- cd9660_lookup.c	1997/11/07 08:52:50	1.20
 +++ cd9660_lookup.c	1998/03/16 18:14:07
 @@ -237,8 +237,7 @@
  					if (namelen != 1
  					    || ep->name[0] != 0)
  						goto notfound;
 -				} else if (!(res = isofncmp(name,len,
 -							    ep->name,namelen))) {
 +				} else if (!(res = isofncmp(name,len,ep->name,namelen,imp->joliet_level))) {
  					if (isoflags & 2)
  						ino = isodirino(ep, imp);
  					else
 Index: sys/isofs/cd9660/cd9660_mount.h
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/cd9660_mount.h,v
 retrieving revision 1.2
 diff -u -r1.2 cd9660_mount.h
 --- cd9660_mount.h	1997/04/29 15:52:53	1.2
 +++ cd9660_mount.h	1998/03/16 18:42:48
 @@ -50,3 +50,4 @@
  #define	ISOFSMNT_NORRIP	0x00000001	/* disable Rock Ridge Ext.*/
  #define	ISOFSMNT_GENS	0x00000002	/* enable generation numbers */
  #define	ISOFSMNT_EXTATT	0x00000004	/* enable extended attributes */
 +#define	ISOFSMNT_NOJOLIET 0x00000008	/* disable Joliet Ext. */
 Index: sys/isofs/cd9660/cd9660_rrip.c
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/cd9660_rrip.c,v
 retrieving revision 1.13
 diff -u -r1.13 cd9660_rrip.c
 --- cd9660_rrip.c	1997/08/02 14:31:19	1.13
 +++ cd9660_rrip.c	1998/03/22 18:05:34
 @@ -298,18 +298,19 @@
  	struct iso_directory_record *isodir;
  	ISO_RRIP_ANALYZE *ana;
  {
 -	strcpy(ana->outbuf,"..");
 -	switch (*isodir->name) {
 +	isofntrans(isodir->name,isonum_711(isodir->name_len),
 +		   ana->outbuf,ana->outlen,
 +		   1,isonum_711(isodir->flags)&4,
 +		   ana->imp->joliet_level);
 +	switch (*ana->outbuf) {
  	default:
 -		isofntrans(isodir->name,isonum_711(isodir->name_len),
 -			   ana->outbuf,ana->outlen,
 -			   1,isonum_711(isodir->flags)&4);
  		break;
 -	case 0:
 -		*ana->outlen = 1;
 -		break;
  	case 1:
  		*ana->outlen = 2;
 +		/* fall through */
 +	case 0:
 +		/* outlen is 1 already */
 +		strcpy(ana->outbuf,"..");
  		break;
  	}
  }
 @@ -498,6 +499,7 @@
  	register ISO_SUSP_HEADER *pend;
  	struct buf *bp = NULL;
  	char *pwhead;
 +	u_char c;
  	int result;
  
  	/*
 @@ -505,12 +507,11 @@
  	 *	 it will be padding 1 byte after the name
  	 */
  	pwhead = isodir->name + isonum_711(isodir->name_len);
 -	if (!(isonum_711(isodir->name_len)&1))
 -		pwhead++;
 +	isochar(isodir->name, pwhead, ana->imp->joliet_level, &c);
 +	pwhead += isonum_711(isodir->name_len) & 1;
  
  	/* If it's not the '.' entry of the root dir obey SP field */
 -	if (*isodir->name != 0
 -	    || isonum_733(isodir->extent) != ana->imp->root_extent)
 +	if (c != 0 || isonum_733(isodir->extent) != ana->imp->root_extent)
  		pwhead += ana->imp->rr_skip;
  	else
  		pwhead += ana->imp->rr_skip0;
 @@ -633,6 +634,7 @@
  {
  	ISO_RRIP_ANALYZE analyze;
  	RRIP_TABLE *tab;
 +	u_char c;
  
  	analyze.outbuf = outbuf;
  	analyze.outlen = outlen;
 @@ -642,9 +644,10 @@
  	analyze.fields = ISO_SUSP_ALTNAME|ISO_SUSP_RELDIR|ISO_SUSP_CLINK|ISO_SUSP_PLINK;
  	*outlen = 0;
  
 +	isochar(isodir->name, isodir->name + isonum_711(isodir->name_len),
 +		imp->joliet_level, &c);
  	tab = rrip_table_getname;
 -	if (*isodir->name == 0
 -	    || *isodir->name == 1) {
 +	if (c == 0 || c == 1) {
  		cd9660_rrip_defname(isodir,&analyze);
  
  		analyze.fields &= ~ISO_SUSP_ALTNAME;
 Index: sys/isofs/cd9660/cd9660_util.c
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/cd9660_util.c,v
 retrieving revision 1.10
 diff -u -r1.10 cd9660_util.c
 --- cd9660_util.c	1997/04/10 14:35:11	1.10
 +++ cd9660_util.c	1998/03/17 09:52:35
 @@ -5,7 +5,8 @@
   * This code is derived from software contributed to Berkeley
   * by Pace Willisson (pace@blitz.com).  The Rock Ridge Extension
   * Support code is derived from software contributed to Berkeley
 - * by Atsushi Murai (amurai@spec.co.jp).
 + * by Atsushi Murai (amurai@spec.co.jp). Joliet support was added by
 + * Joachim Kuebart (joki@kuebart.stuttgart.netsurf.de).
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
 @@ -46,37 +47,63 @@
  #include <isofs/cd9660/iso.h>
  
  /*
 + * Get one character out of an iso filename
 + * Obey joliet_level
 + * Return number of bytes consumed
 + */
 +int
 +isochar(isofn, isoend, joliet_level, c)
 +	u_char *isofn;
 +	u_char *isoend;
 +	int joliet_level;
 +	u_char *c;
 +{
 +	*c = *isofn++;
 +	if (joliet_level == 0 || isofn == isoend)
 +		/* (00) and (01) are one byte in Joliet, too */
 +		return 1;
 +
 +	/* No Unicode support yet :-( */
 +	switch (*c) {
 +	default:
 +		*c = '?';
 +		break;
 +	case '\0':
 +		*c = *isofn;
 +		break;
 +	}
 +	return 2;
 +}
 +
 +/*
   * translate and compare a filename
 + * returns (fn - isofn)
   * Note: Version number plus ';' may be omitted.
   */
  int
 -isofncmp(fn, fnlen, isofn, isolen)
 +isofncmp(fn, fnlen, isofn, isolen, joliet_level)
  	u_char *fn;
  	int fnlen;
  	u_char *isofn;
  	int isolen;
 +	int joliet_level;
  {
  	int i, j;
 -	unsigned char c;
 +	u_char c, *fnend = fn + fnlen, *isoend = isofn + isolen;
  
 -	while (--fnlen >= 0) {
 -		if (--isolen < 0)
 +	for (; fn != fnend; fn++) {
 +		if (isofn == isoend)
  			return *fn;
 -		if ((c = *isofn++) == ';') {
 -			switch (*fn++) {
 -			default:
 -				return *--fn;
 -			case 0:
 -				return 0;
 -			case ';':
 -				break;
 -			}
 -			for (i = 0; --fnlen >= 0; i = i * 10 + *fn++ - '0') {
 -				if (*fn < '0' || *fn > '9') {
 +		isofn += isochar(isofn, isoend, joliet_level, &c);
 +		if (c == ';') {
 +			if (*fn++ != ';')
 +				return fn[-1];
 +			for (i = 0; fn != fnend; i = i * 10 + *fn++ - '0')
 +				if (*fn < '0' || *fn > '9')
  					return -1;
 -				}
 -			}
 -			for (j = 0; --isolen >= 0; j = j * 10 + *isofn++ - '0');
 +			for (j = 0; isofn != isoend; j = j * 10 + c - '0')
 +				isofn += isochar(isofn, isoend,
 +					joliet_level, &c);
  			return i - j;
  		}
  		if (c != *fn) {
 @@ -90,15 +117,19 @@
  			} else
  				return *fn - c;
  		}
 -		fn++;
  	}
 -	if (isolen > 0) {
 -		switch (*isofn) {
 +	if (isofn != isoend) {
 +		isofn += isochar(isofn, isoend, joliet_level, &c);
 +		switch (c) {
  		default:
 -			return -1;
 +			return -c;
  		case '.':
 -			if (isofn[1] != ';')
 -				return -1;
 +			if (isofn != isoend) {
 +				isochar(isofn, isoend, joliet_level, &c);
 +				if (c == ';')
 +					return 0;
 +			}
 +			return -1;
  		case ';':
  			return 0;
  		}
 @@ -107,35 +138,36 @@
  }
  
  /*
 - * translate a filename
 + * translate a filename of length > 0
   */
  void
 -isofntrans(infn, infnlen, outfn, outfnlen, original, assoc)
 +isofntrans(infn, infnlen, outfn, outfnlen, original, assoc, joliet_level)
  	u_char *infn;
  	int infnlen;
  	u_char *outfn;
  	u_short *outfnlen;
  	int original;
  	int assoc;
 +	int joliet_level;
  {
  	int fnidx = 0;
 +	u_char c, d = '\0', *infnend = infn + infnlen;
  
  	if (assoc) {
  		*outfn++ = ASSOCCHAR;
  		fnidx++;
 -		infnlen++;
  	}
 -	for (; fnidx < infnlen; fnidx++) {
 -		char c = *infn++;
 +	for (; infn != infnend; fnidx++) {
 +		infn += isochar(infn, infnend, joliet_level, &c);
  
  		if (!original && c >= 'A' && c <= 'Z')
  			*outfn++ = c + ('a' - 'A');
 -		else if (!original && c == '.' && *infn == ';')
 -			break;
 -		else if (!original && c == ';')
 +		else if (!original && c == ';') {
 +			fnidx -= (d == '.');
  			break;
 -		else
 +		} else
  			*outfn++ = c;
 +		d = c;
  	}
  	*outfnlen = fnidx;
  }
 Index: sys/isofs/cd9660/cd9660_vfsops.c
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/cd9660_vfsops.c,v
 retrieving revision 1.35
 diff -u -r1.35 cd9660_vfsops.c
 --- cd9660_vfsops.c	1998/03/08 09:56:41	1.35
 +++ cd9660_vfsops.c	1998/03/16 19:07:13
 @@ -271,9 +271,12 @@
  	int ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
  	int iso_bsize;
  	int iso_blknum;
 +	int pri_blknum;
 +	int joliet_level;
  	struct iso_volume_descriptor *vdp = 0;
  	struct iso_primary_descriptor *pri;
  	struct iso_sierra_primary_descriptor *pri_sierra;
 +	struct iso_supplementary_descriptor *supp;
  	struct iso_directory_record *rootp;
  	int logical_block_size;
  
 @@ -303,6 +306,8 @@
  	 */
  	iso_bsize = ISO_DEFAULT_BLOCK_SIZE;
  
 +	joliet_level = 0;
 +	pri_blknum = -1;
  	for (iso_blknum = 16 + argp->ssector;
  	     iso_blknum < 100 + argp->ssector;
  	     iso_blknum++) {
 @@ -320,19 +325,42 @@
  				high_sierra = 1;
  		}
  
 -		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) {
 -			error = EINVAL;
 -			goto out;
 -		}
 +		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END)
 +			break;
  
  		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_PRIMARY)
 -			break;
 +			pri_blknum = iso_blknum;
 +
 +		if (!(argp->flags & ISOFSMNT_NOJOLIET) &&
 +		    isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_SUPPLEMENTARY) {
 +			supp = (struct iso_supplementary_descriptor *)vdp;
 +			if (bcmp(supp->escape, "%/@", 3) == 0)
 +				joliet_level = 1;
 +			if (bcmp(supp->escape, "%/C", 3) == 0)
 +				joliet_level = 2;
 +			if (bcmp(supp->escape, "%/E", 3) == 0)
 +				joliet_level = 3;
 +			if (isonum_711 (supp->flags) & 1)
 +				joliet_level = 0;
 +			if (joliet_level)
 +				break;
 +		}
 +			
  		brelse(bp);
  	}
  
 -	if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) {
 -		error = EINVAL;
 -		goto out;
 +	if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_SUPPLEMENTARY) {
 +		if (pri_blknum == -1) {
 +			error = EINVAL;
 +			goto out;
 +		}
 +
 +		brelse(bp);
 +		if (error = bread(devvp, pri_blknum * btodb(iso_bsize),
 +				  iso_bsize, NOCRED, &bp))
 +			goto out;
 +		vdp = (struct iso_volume_descriptor *)bp->b_data;
 +		argp->flags |= ISOFSMNT_NOJOLIET;
  	}
  
  	pri = (struct iso_primary_descriptor *)vdp;
 @@ -361,6 +389,7 @@
  		isonum_733 (high_sierra?
  			    pri_sierra->volume_space_size:
  			    pri->volume_space_size);
 +	isomp->joliet_level = joliet_level;
  	/*
  	 * Since an ISO9660 multi-session CD can also access previous
  	 * sessions, we have to include them into the space consider-
 @@ -375,9 +404,7 @@
  	isomp->root_size = isonum_733 (rootp->size);
  
  	isomp->im_bmask = logical_block_size - 1;
 -	isomp->im_bshift = 0;
 -	while ((1 << isomp->im_bshift) < isomp->logical_block_size)
 -		isomp->im_bshift++;
 +	isomp->im_bshift = ffs(logical_block_size) - 1;
  
  	bp->b_flags |= B_AGE;
  	brelse(bp);
 @@ -418,7 +445,8 @@
  		brelse(bp);
  		bp = NULL;
  	}
 -	isomp->im_flags = argp->flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS|ISOFSMNT_EXTATT);
 +	isomp->im_flags = argp->flags & (ISOFSMNT_NORRIP | ISOFSMNT_GENS |
 +					ISOFSMNT_EXTATT | ISOFSMNT_NOJOLIET);
  
  	if(high_sierra)
  		/* this effectively ignores all the mount flags */
 Index: sys/isofs/cd9660/cd9660_vnops.c
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/cd9660_vnops.c,v
 retrieving revision 1.52
 diff -u -r1.52 cd9660_vnops.c
 --- cd9660_vnops.c	1998/03/06 09:46:14	1.52
 +++ cd9660_vnops.c	1998/03/16 18:16:01
 @@ -549,26 +549,23 @@
  			break;
  		default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 || ISO_FTYPE_HIGH_SIERRA*/
  			strcpy(idp->current.d_name,"..");
 -			switch (ep->name[0]) {
 -			case 0:
 +			if (idp->current.d_namlen == 1 && ep->name[0] == 0) {
  				idp->current.d_namlen = 1;
  				error = iso_uiodir(idp,&idp->current,idp->curroff);
 -				break;
 -			case 1:
 +			} else if (idp->current.d_namlen == 1 && ep->name[0] == 1) {
  				idp->current.d_namlen = 2;
  				error = iso_uiodir(idp,&idp->current,idp->curroff);
 -				break;
 -			default:
 +			} else {
  				isofntrans(ep->name,idp->current.d_namlen,
  					   idp->current.d_name, &namelen,
  					   imp->iso_ftype == ISO_FTYPE_9660,
 -					   isonum_711(ep->flags)&4);
 +					   isonum_711(ep->flags)&4,
 +					   imp->joliet_level);
  				idp->current.d_namlen = (u_char)namelen;
  				if (imp->iso_ftype == ISO_FTYPE_DEFAULT)
  					error = iso_shipdir(idp);
  				else
  					error = iso_uiodir(idp,&idp->current,idp->curroff);
 -				break;
  			}
  		}
  		if (error)
 Index: sys/isofs/cd9660/iso.h
 ===================================================================
 RCS file: /usr/CVS-Repository/src/sys/isofs/cd9660/iso.h,v
 retrieving revision 1.16
 diff -u -r1.16 iso.h
 --- iso.h	1997/05/07 13:23:04	1.16
 +++ iso.h	1998/03/16 19:10:03
 @@ -54,6 +54,7 @@
  
  /* volume descriptor types */
  #define ISO_VD_PRIMARY 1
 +#define ISO_VD_SUPPLEMENTARY 2
  #define ISO_VD_END 255
  
  #define ISO_STANDARD_ID "CD001"
 @@ -135,6 +136,42 @@
  	char unused4			[ISODCL (856, 2048)];
  };
  
 +struct iso_supplementary_descriptor {
 +	char type			[ISODCL (  1,	1)]; /* 711 */
 +	char id				[ISODCL (  2,	6)];
 +	char version			[ISODCL (  7,	7)]; /* 711 */
 +	char flags			[ISODCL (  8,	8)]; /* 711? */
 +	char system_id			[ISODCL (  9,  40)]; /* achars */
 +	char volume_id			[ISODCL ( 41,  72)]; /* dchars */
 +	char unused2			[ISODCL ( 73,  80)];
 +	char volume_space_size		[ISODCL ( 81,  88)]; /* 733 */
 +	char escape			[ISODCL ( 89, 120)];
 +	char volume_set_size		[ISODCL (121, 124)]; /* 723 */
 +	char volume_sequence_number	[ISODCL (125, 128)]; /* 723 */
 +	char logical_block_size		[ISODCL (129, 132)]; /* 723 */
 +	char path_table_size		[ISODCL (133, 140)]; /* 733 */
 +	char type_l_path_table		[ISODCL (141, 144)]; /* 731 */
 +	char opt_type_l_path_table	[ISODCL (145, 148)]; /* 731 */
 +	char type_m_path_table		[ISODCL (149, 152)]; /* 732 */
 +	char opt_type_m_path_table	[ISODCL (153, 156)]; /* 732 */
 +	char root_directory_record	[ISODCL (157, 190)]; /* 9.1 */
 +	char volume_set_id		[ISODCL (191, 318)]; /* dchars */
 +	char publisher_id		[ISODCL (319, 446)]; /* achars */
 +	char preparer_id		[ISODCL (447, 574)]; /* achars */
 +	char application_id		[ISODCL (575, 702)]; /* achars */
 +	char copyright_file_id		[ISODCL (703, 739)]; /* 7.5 dchars */
 +	char abstract_file_id		[ISODCL (740, 776)]; /* 7.5 dchars */
 +	char bibliographic_file_id	[ISODCL (777, 813)]; /* 7.5 dchars */
 +	char creation_date		[ISODCL (814, 830)]; /* 8.4.26.1 */
 +	char modification_date		[ISODCL (831, 847)]; /* 8.4.26.1 */
 +	char expiration_date		[ISODCL (848, 864)]; /* 8.4.26.1 */
 +	char effective_date		[ISODCL (865, 881)]; /* 8.4.26.1 */
 +	char file_structure_version	[ISODCL (882, 882)]; /* 711 */
 +	char unused4			[ISODCL (883, 883)];
 +	char application_data		[ISODCL (884, 1395)];
 +	char unused5			[ISODCL (1396, 2048)];
 +};
 +
  struct iso_directory_record {
  	char length			[ISODCL (1, 1)]; /* 711 */
  	char ext_attr_length		[ISODCL (2, 2)]; /* 711 */
 @@ -202,6 +239,8 @@
  
  	int rr_skip;
  	int rr_skip0;
 +
 +	int joliet_level;
  };
  
  #define VFSTOISOFS(mp)	((struct iso_mnt *)((mp)->mnt_data))
 @@ -221,8 +260,9 @@
  extern vop_t **cd9660_specop_p;
  extern vop_t **cd9660_fifoop_p;
  
 -int isofncmp __P((u_char *, int, u_char *, int));
 -void isofntrans __P((u_char *, int, u_char *, u_short *, int, int));
 +int isochar __P((u_char *, u_char *, int, u_char *));
 +int isofncmp __P((u_char *, int, u_char *, int, int));
 +void isofntrans __P((u_char *, int, u_char *, u_short *, int, int, int));
  ino_t isodirino __P((struct iso_directory_record *, struct iso_mnt *));
  
  #endif /* KERNEL */

From: "Philip J. May" <dukat@hedgehog.highway1.com.au>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs
Date: Fri, 7 Aug 1998 19:35:00 +0800 (WST)

 I have attempted to install the second patch, on the following installs. 
 2.2.5-REL 2.2.6-REL 2.2CAM-19980716 3.0CAM-19980712
 
 On each the src tree for the patch gets hunks failing, and as a reult the
 kernel wont compile....
 
 Has anyone successfully made joliet cd-roms work under freebsd, and will
 this kind of support be moved into the next 2.2-stable or 2.2.RELEASE?????
 

From: Alex Vasylenko <lxv@nest.org>
To: freebsd-gnats-submit@freebsd.org,
        Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
Cc:  Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sat, 31 Oct 1998 14:53:34 -0800

 hi,
 
 below is a diff from -stable (as of 10/30) sources to support Joliet
 extensions to cd9660 filesystem (author Joachim Kuebart 
 <joki@kuebart.stuttgart.netsurf.de>) ...
 
 --Alex.
 
 
 ===== ~/s/src/sys/isofs/cd9660
 diff -u orig/cd9660_lookup.c ./cd9660_lookup.c
 --- orig/cd9660_lookup.c	Sun Aug 17 06:28:32 1997
 +++ ./cd9660_lookup.c	Fri Oct 30 23:41:48 1998
 @@ -308,8 +308,7 @@
  					if (namelen != 1
  					    || ep->name[0] != 0)
  						goto notfound;
 -				} else if (!(res = isofncmp(name,len,
 -							    ep->name,namelen))) {
 +				} else if (!(res = isofncmp(name,len,ep->name,namelen,imp->joliet_level))) {
  					if (isoflags & 2)
  						isodirino(&ino,ep,imp);
  					else
 diff -u orig/cd9660_mount.h ./cd9660_mount.h
 --- orig/cd9660_mount.h	Sun Aug 17 06:28:33 1997
 +++ ./cd9660_mount.h	Fri Oct 30 23:45:01 1998
 @@ -50,3 +50,4 @@
  #define	ISOFSMNT_NORRIP	0x00000001	/* disable Rock Ridge Ext.*/
  #define	ISOFSMNT_GENS	0x00000002	/* enable generation numbers */
  #define	ISOFSMNT_EXTATT	0x00000004	/* enable extended attributes */
 +#define	ISOFSMNT_NOJOLIET 0x00000008	/* disable Joliet Ext. */
 diff -u orig/cd9660_rrip.c ./cd9660_rrip.c
 --- orig/cd9660_rrip.c	Sun Aug 17 06:28:37 1997
 +++ ./cd9660_rrip.c	Fri Oct 30 23:48:14 1998
 @@ -306,18 +306,19 @@
  	struct iso_directory_record *isodir;
  	ISO_RRIP_ANALYZE *ana;
  {
 -	strcpy(ana->outbuf,"..");
 -	switch (*isodir->name) {
 +	isofntrans(isodir->name,isonum_711(isodir->name_len),
 +		   ana->outbuf,ana->outlen,
 +		   1,isonum_711(isodir->flags)&4,
 +		   ana->imp->joliet_level);
 +	switch (*ana->outbuf) {
  	default:
 -		isofntrans(isodir->name,isonum_711(isodir->name_len),
 -			   ana->outbuf,ana->outlen,
 -			   1,isonum_711(isodir->flags)&4);
 -		break;
 -	case 0:
 -		*ana->outlen = 1;
  		break;
  	case 1:
  		*ana->outlen = 2;
 +		/* fall through */
 +	case 0:
 +		/* outlen is 1 already */
 +		strcpy(ana->outbuf,"..");
  		break;
  	}
  }
 @@ -509,6 +510,7 @@
  	register ISO_SUSP_HEADER *pend;
  	struct buf *bp = NULL;
  	char *pwhead;
 +	u_char c;
  	int result;
  
  	/*
 @@ -516,12 +518,11 @@
  	 *	 it will be padding 1 byte after the name
  	 */
  	pwhead = isodir->name + isonum_711(isodir->name_len);
 -	if (!(isonum_711(isodir->name_len)&1))
 -		pwhead++;
 +	isochar(isodir->name, pwhead, ana->imp->joliet_level, &c);
 +	pwhead += isonum_711(isodir->name_len) & 1;
  
  	/* If it's not the '.' entry of the root dir obey SP field */
 -	if (*isodir->name != 0
 -	    || isonum_733(isodir->extent) != ana->imp->root_extent)
 +	if (c != 0 || isonum_733(isodir->extent) != ana->imp->root_extent)
  		pwhead += ana->imp->rr_skip;
  	else
  		pwhead += ana->imp->rr_skip0;
 @@ -635,6 +636,7 @@
  {
  	ISO_RRIP_ANALYZE analyze;
  	RRIP_TABLE *tab;
 +	u_char c;
  
  	analyze.outbuf = outbuf;
  	analyze.outlen = outlen;
 @@ -644,9 +646,10 @@
  	analyze.fields = ISO_SUSP_ALTNAME|ISO_SUSP_RELDIR|ISO_SUSP_CLINK|ISO_SUSP_PLINK;
  	*outlen = 0;
  
 +	isochar(isodir->name, isodir->name + isonum_711(isodir->name_len),
 +		imp->joliet_level, &c);
  	tab = rrip_table_getname;
 -	if (*isodir->name == 0
 -	    || *isodir->name == 1) {
 +	if (c == 0 || c == 1) {
  		cd9660_rrip_defname(isodir,&analyze);
  
  		analyze.fields &= ~ISO_SUSP_ALTNAME;
 diff -u orig/cd9660_util.c ./cd9660_util.c
 --- orig/cd9660_util.c	Sun Aug 17 06:28:39 1997
 +++ ./cd9660_util.c	Sat Oct 31 01:26:58 1998
 @@ -5,7 +5,8 @@
   * This code is derived from software contributed to Berkeley
   * by Pace Willisson (pace@blitz.com).  The Rock Ridge Extension
   * Support code is derived from software contributed to Berkeley
 - * by Atsushi Murai (amurai@spec.co.jp).
 + * by Atsushi Murai (amurai@spec.co.jp). Joliet support was added by
 + * Joachim Kuebart (joki@kuebart.stuttgart.netsurf.de).
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
 @@ -153,33 +154,63 @@
  #endif	/* __notanymore__ */
  
  /*
 + * Get one character out of an iso filename
 + * Obey joliet_level
 + * Return number of bytes consumed
 + */
 +int
 +isochar(isofn, isoend, joliet_level, c)
 +	u_char *isofn;
 +	u_char *isoend;
 +	int joliet_level;
 +	u_char *c;
 +{
 +	*c = *isofn++;
 +	if (joliet_level == 0 || isofn == isoend)
 +		/* (00) and (01) are one byte in Joliet, too */
 +		return 1;
 +
 +	/* No Unicode support yet :-( */
 +	switch (*c) {
 +	default:
 +		*c = '?';
 +		break;
 +	case '\0':
 +		*c = *isofn;
 +		break;
 +	}
 +	return 2;
 +}
 +
 +/*
   * translate and compare a filename
 + * returns (fn - isofn)
   * Note: Version number plus ';' may be omitted.
   */
  int
 -isofncmp(unsigned char *fn,int fnlen,unsigned char *isofn,int isolen)
 +isofncmp(fn, fnlen, isofn, isolen, joliet_level)
 +	u_char *fn;
 +	int fnlen;
 +	u_char *isofn;
 +	int isolen;
 +	int joliet_level;
  {
  	int i, j;
 -	unsigned char c;
 +	u_char c, *fnend = fn + fnlen, *isoend = isofn + isolen;
  
 -	while (--fnlen >= 0) {
 -		if (--isolen < 0)
 +	for (; fn != fnend; fn++) {
 +		if (isofn == isoend)
  			return *fn;
 -		if ((c = *isofn++) == ';') {
 -			switch (*fn++) {
 -			default:
 -				return *--fn;
 -			case 0:
 -				return 0;
 -			case ';':
 -				break;
 -			}
 -			for (i = 0; --fnlen >= 0; i = i * 10 + *fn++ - '0') {
 -				if (*fn < '0' || *fn > '9') {
 +		isofn += isochar(isofn, isoend, joliet_level, &c);
 +		if (c == ';') {
 +			if (*fn++ != ';')
 +				return fn[-1];
 +			for (i = 0; fn != fnend; i = i * 10 + *fn++ - '0')
 +				if (*fn < '0' || *fn > '9')
  					return -1;
 -				}
 -			}
 -			for (j = 0; --isolen >= 0; j = j * 10 + *isofn++ - '0');
 +			for (j = 0; isofn != isoend; j = j * 10 + c - '0')
 +				isofn += isochar(isofn, isoend,
 +					joliet_level, &c);
  			return i - j;
  		}
  		if (c != *fn) {
 @@ -193,15 +224,19 @@
  			} else
  				return *fn - c;
  		}
 -		fn++;
  	}
 -	if (isolen > 0) {
 -		switch (*isofn) {
 +	if (isofn != isoend) {
 +		isofn += isochar(isofn, isoend, joliet_level, &c);
 +		switch (c) {
  		default:
 -			return -1;
 +			return -c;
  		case '.':
 -			if (isofn[1] != ';')
 -				return -1;
 +			if (isofn != isoend) {
 +				isochar(isofn, isoend, joliet_level, &c);
 +				if (c == ';')
 +					return 0;
 +			}
 +			return -1;
  		case ';':
  			return 0;
  		}
 @@ -210,31 +245,36 @@
  }
  
  /*
 - * translate a filename
 + * translate a filename of length > 0
   */
  void
 -isofntrans(unsigned char *infn,int infnlen,
 -	   unsigned char *outfn,unsigned short *outfnlen,
 -	   int original,int assoc)
 +isofntrans(infn, infnlen, outfn, outfnlen, original, assoc, joliet_level)
 +	u_char *infn;
 +	int infnlen;
 +	u_char *outfn;
 +	u_short *outfnlen;
 +	int original;
 +	int assoc;
 +	int joliet_level;
  {
  	int fnidx = 0;
 +	u_char c, d = '\0', *infnend = infn + infnlen;
  
  	if (assoc) {
  		*outfn++ = ASSOCCHAR;
  		fnidx++;
 -		infnlen++;
  	}
 -	for (; fnidx < infnlen; fnidx++) {
 -		char c = *infn++;
 +	for (; infn != infnend; fnidx++) {
 +		infn += isochar(infn, infnend, joliet_level, &c);
  
  		if (!original && c >= 'A' && c <= 'Z')
  			*outfn++ = c + ('a' - 'A');
 -		else if (!original && c == '.' && *infn == ';')
 -			break;
 -		else if (!original && c == ';')
 +		else if (!original && c == ';') {
 +			fnidx -= (d == '.');
  			break;
 -		else
 +		} else
  			*outfn++ = c;
 +		d = c;
  	}
  	*outfnlen = fnidx;
  }
 diff -u orig/cd9660_vfsops.c ./cd9660_vfsops.c
 --- orig/cd9660_vfsops.c	Sun Mar 29 03:10:36 1998
 +++ ./cd9660_vfsops.c	Sat Oct 31 00:31:56 1998
 @@ -294,9 +294,12 @@
  	int ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
  	int iso_bsize;
  	int iso_blknum;
 -	struct iso_volume_descriptor *vdp;
 +	int pri_blknum;
 +	int joliet_level;
 +	struct iso_volume_descriptor *vdp = 0;
  	struct iso_primary_descriptor *pri;
  	struct iso_sierra_primary_descriptor *pri_sierra;
 +	struct iso_supplementary_descriptor *supp;
  	struct iso_directory_record *rootp;
  	int logical_block_size;
  
 @@ -326,6 +329,8 @@
  	 */
  	iso_bsize = ISO_DEFAULT_BLOCK_SIZE;
  
 +	joliet_level = 0;
 +	pri_blknum = -1;
  	for (iso_blknum = 16 + argp->ssector;
  	     iso_blknum < 100 + argp->ssector;
  	     iso_blknum++) {
 @@ -343,19 +348,42 @@
  				high_sierra = 1;
  		}
  
 -		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) {
 -			error = EINVAL;
 -			goto out;
 -		}
 +		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END)
 +			break;
  
  		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_PRIMARY)
 -			break;
 +			pri_blknum = iso_blknum;
 +
 +		if (!(argp->flags & ISOFSMNT_NOJOLIET) &&
 +		    isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_SUPPLEMENTARY) {
 +			supp = (struct iso_supplementary_descriptor *)vdp;
 +			if (bcmp(supp->escape, "%/@", 3) == 0)
 +				joliet_level = 1;
 +			if (bcmp(supp->escape, "%/C", 3) == 0)
 +				joliet_level = 2;
 +			if (bcmp(supp->escape, "%/E", 3) == 0)
 +				joliet_level = 3;
 +			if (isonum_711 (supp->flags) & 1)
 +				joliet_level = 0;
 +			if (joliet_level)
 +				break;
 +		}
 +			
  		brelse(bp);
  	}
  
 -	if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) {
 -		error = EINVAL;
 -		goto out;
 +	if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_SUPPLEMENTARY) {
 +		if (pri_blknum == -1) {
 +			error = EINVAL;
 +			goto out;
 +		}
 +
 +		brelse(bp);
 +		if (error = bread(devvp, pri_blknum * btodb(iso_bsize),
 +				  iso_bsize, NOCRED, &bp))
 +			goto out;
 +		vdp = (struct iso_volume_descriptor *)bp->b_data;
 +		argp->flags |= ISOFSMNT_NOJOLIET;
  	}
  
  	pri = (struct iso_primary_descriptor *)vdp;
 @@ -384,6 +412,7 @@
  		isonum_733 (high_sierra?
  			    pri_sierra->volume_space_size:
  			    pri->volume_space_size);
 +	isomp->joliet_level = joliet_level;
  	/*
  	 * Since an ISO9660 multi-session CD can also access previous
  	 * sessions, we have to include them into the space consider-
 @@ -398,9 +427,7 @@
  	isomp->root_size = isonum_733 (rootp->size);
  
  	isomp->im_bmask = logical_block_size - 1;
 -	isomp->im_bshift = 0;
 -	while ((1 << isomp->im_bshift) < isomp->logical_block_size)
 -		isomp->im_bshift++;
 +	isomp->im_bshift = ffs(logical_block_size) - 1;
  
  	bp->b_flags |= B_AGE;
  	brelse(bp);
 @@ -441,7 +468,8 @@
  		brelse(bp);
  		bp = NULL;
  	}
 -	isomp->im_flags = argp->flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS|ISOFSMNT_EXTATT);
 +	isomp->im_flags = argp->flags & (ISOFSMNT_NORRIP | ISOFSMNT_GENS |
 +					ISOFSMNT_EXTATT | ISOFSMNT_NOJOLIET);
  
  	if(high_sierra)
  		/* this effectively ignores all the mount flags */
 diff -u orig/cd9660_vnops.c ./cd9660_vnops.c
 --- orig/cd9660_vnops.c	Sun Aug 17 06:28:42 1997
 +++ ./cd9660_vnops.c	Sat Oct 31 01:23:04 1998
 @@ -679,26 +679,23 @@
  			break;
  		default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 || ISO_FTYPE_HIGH_SIERRA*/
  			strcpy(idp->current.d_name,"..");
 -			switch (ep->name[0]) {
 -			case 0:
 +			if (idp->current.d_namlen == 1 && ep->name[0] == 0) {
  				idp->current.d_namlen = 1;
  				error = iso_uiodir(idp,&idp->current,idp->curroff);
 -				break;
 -			case 1:
 +			} else if (idp->current.d_namlen == 1 && ep->name[0] == 1) {
  				idp->current.d_namlen = 2;
  				error = iso_uiodir(idp,&idp->current,idp->curroff);
 -				break;
 -			default:
 +			} else {
  				isofntrans(ep->name,idp->current.d_namlen,
  					   idp->current.d_name, &elen,
  					   imp->iso_ftype == ISO_FTYPE_9660,
 -					   isoflags & 4);
 +					   isoflags & 4,
 +					   imp->joliet_level);
  				idp->current.d_namlen = (u_char)elen;
  				if (imp->iso_ftype == ISO_FTYPE_DEFAULT)
  					error = iso_shipdir(idp);
  				else
  					error = iso_uiodir(idp,&idp->current,idp->curroff);
 -				break;
  			}
  		}
  		if (error)
 diff -u orig/iso.h ./iso.h
 --- orig/iso.h	Tue Jul  7 11:11:16 1998
 +++ ./iso.h	Sat Oct 31 01:39:39 1998
 @@ -54,6 +54,7 @@
  
  /* volume descriptor types */
  #define ISO_VD_PRIMARY 1
 +#define ISO_VD_SUPPLEMENTARY 2
  #define ISO_VD_END 255
  
  #define ISO_STANDARD_ID "CD001"
 @@ -135,6 +136,42 @@
  	char unused4			[ISODCL (856, 2048)];
  };
  
 +struct iso_supplementary_descriptor {
 +	char type			[ISODCL (  1,	1)]; /* 711 */
 +	char id				[ISODCL (  2,	6)];
 +	char version			[ISODCL (  7,	7)]; /* 711 */
 +	char flags			[ISODCL (  8,	8)]; /* 711? */
 +	char system_id			[ISODCL (  9,  40)]; /* achars */
 +	char volume_id			[ISODCL ( 41,  72)]; /* dchars */
 +	char unused2			[ISODCL ( 73,  80)];
 +	char volume_space_size		[ISODCL ( 81,  88)]; /* 733 */
 +	char escape			[ISODCL ( 89, 120)];
 +	char volume_set_size		[ISODCL (121, 124)]; /* 723 */
 +	char volume_sequence_number	[ISODCL (125, 128)]; /* 723 */
 +	char logical_block_size		[ISODCL (129, 132)]; /* 723 */
 +	char path_table_size		[ISODCL (133, 140)]; /* 733 */
 +	char type_l_path_table		[ISODCL (141, 144)]; /* 731 */
 +	char opt_type_l_path_table	[ISODCL (145, 148)]; /* 731 */
 +	char type_m_path_table		[ISODCL (149, 152)]; /* 732 */
 +	char opt_type_m_path_table	[ISODCL (153, 156)]; /* 732 */
 +	char root_directory_record	[ISODCL (157, 190)]; /* 9.1 */
 +	char volume_set_id		[ISODCL (191, 318)]; /* dchars */
 +	char publisher_id		[ISODCL (319, 446)]; /* achars */
 +	char preparer_id		[ISODCL (447, 574)]; /* achars */
 +	char application_id		[ISODCL (575, 702)]; /* achars */
 +	char copyright_file_id		[ISODCL (703, 739)]; /* 7.5 dchars */
 +	char abstract_file_id		[ISODCL (740, 776)]; /* 7.5 dchars */
 +	char bibliographic_file_id	[ISODCL (777, 813)]; /* 7.5 dchars */
 +	char creation_date		[ISODCL (814, 830)]; /* 8.4.26.1 */
 +	char modification_date		[ISODCL (831, 847)]; /* 8.4.26.1 */
 +	char expiration_date		[ISODCL (848, 864)]; /* 8.4.26.1 */
 +	char effective_date		[ISODCL (865, 881)]; /* 8.4.26.1 */
 +	char file_structure_version	[ISODCL (882, 882)]; /* 711 */
 +	char unused4			[ISODCL (883, 883)];
 +	char application_data		[ISODCL (884, 1395)];
 +	char unused5			[ISODCL (1396, 2048)];
 +};
 +
  struct iso_directory_record {
  	char length			[ISODCL (1, 1)]; /* 711 */
  	char ext_attr_length		[ISODCL (2, 2)]; /* 711 */
 @@ -203,6 +240,8 @@
  
  	int rr_skip;
  	int rr_skip0;
 +
 +	int joliet_level;
  };
  
  #define VFSTOISOFS(mp)	((struct iso_mnt *)((mp)->mnt_data))
 @@ -227,9 +266,9 @@
  
  extern vop_t **cd9660_vnodeop_p;
  
 -int isofncmp __P((unsigned char *, int, unsigned char *, int));
 -void isofntrans __P((unsigned char *, int, unsigned char *, unsigned short *,
 -		     int, int));
 +int isochar __P((u_char *, u_char *, int, u_char *));
 +int isofncmp __P((u_char *, int, u_char *, int, int));
 +void isofntrans __P((u_char *, int, u_char *, u_short *, int, int, int));
  
  #endif /* KERNEL */
  
 ===== ~/s/src/sys/sys
 diff -u orig/mount.h ./mount.h
 --- orig/mount.h	Tue Jul 21 10:50:37 1998
 +++ ./mount.h	Sat Oct 31 10:36:45 1998
 @@ -420,6 +420,7 @@
  #define ISOFSMNT_NORRIP		0x00000001 /* disable Rock Ridge Ext.*/
  #define ISOFSMNT_GENS		0x00000002 /* enable generation numbers */
  #define ISOFSMNT_EXTATT		0x00000004 /* enable extended attributes */
 +#define ISOFSMNT_NOJOLIET	0x00000008 /* disable Joliet Ext. */
  #endif /* CD9660 */
  
  #ifdef NFS
 ===== ~/s/src/sbin/mount_cd9660
 diff -u orig/mount_cd9660.8 ./mount_cd9660.8
 --- orig/mount_cd9660.8	Tue Jul 21 10:48:07 1998
 +++ ./mount_cd9660.8	Sat Oct 31 01:48:25 1998
 @@ -67,6 +67,8 @@
  only the last one will be listed.)
  In either case, files may be opened without explicitly stating a
  version number.
 +.It Fl j
 +Do not use any Joliet extensions included in the filesystem.
  .It Fl o
  Options are specified with a
  .Fl o
 diff -u orig/mount_cd9660.c ./mount_cd9660.c
 --- orig/mount_cd9660.c	Sun Aug 17 06:30:23 1997
 +++ ./mount_cd9660.c	Sat Oct 31 01:49:31 1998
 @@ -73,6 +73,7 @@
  	{ "extatt", 0, ISOFSMNT_EXTATT, 1 },
  	{ "gens", 0, ISOFSMNT_GENS, 1 },
  	{ "rrip", 1, ISOFSMNT_NORRIP, 1 },
 +	{ "joliet", 1, ISOFSMNT_NOJOLIET, 1 },
  	{ NULL }
  };
  
 @@ -91,13 +92,16 @@
  	mntflags = opts = verbose = 0;
  	memset(&args, 0, sizeof args);
  	args.ssector = -1;
 -	while ((ch = getopt(argc, argv, "ego:rs:v")) != -1)
 +	while ((ch = getopt(argc, argv, "egjo:rs:v")) != -1)
  		switch (ch) {
  		case 'e':
  			opts |= ISOFSMNT_EXTATT;
  			break;
  		case 'g':
  			opts |= ISOFSMNT_GENS;
 +			break;
 +		case 'j':
 +			opts |= ISOFSMNT_NOJOLIET;
  			break;
  		case 'o':
  			getmntopts(optarg, mopts, &mntflags, &opts);

From: Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
To: lxv@nest.org
Cc: freebsd-gnats-submit@freebsd.org, joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sun, 1 Nov 1998 11:52:48 +0100 (CET)

 Alex Vasylenko wrote:
 > hi,
 > 
 > below is a diff from -stable (as of 10/30) sources to support Joliet
 > extensions to cd9660 filesystem (author Joachim Kuebart 
 > <joki@kuebart.stuttgart.netsurf.de>) ...
 > 
 > --Alex.
 > 
 > 
 > ===== ~/s/src/sys/isofs/cd9660
 > diff -u orig/cd9660_rrip.c ./cd9660_rrip.c
 > --- orig/cd9660_rrip.c	Sun Aug 17 06:28:37 1997
 > +++ ./cd9660_rrip.c	Fri Oct 30 23:48:14 1998
 > @@ -516,12 +518,11 @@
 >  	 *	 it will be padding 1 byte after the name
 >  	 */
 >  	pwhead = isodir->name + isonum_711(isodir->name_len);
 > -	if (!(isonum_711(isodir->name_len)&1))
 > -		pwhead++;
 > +	isochar(isodir->name, pwhead, ana->imp->joliet_level, &c);
 > +	pwhead += isonum_711(isodir->name_len) & 1;
 >  
 >  	/* If it's not the '.' entry of the root dir obey SP field */
 > -	if (*isodir->name != 0
 > -	    || isonum_733(isodir->extent) != ana->imp->root_extent)
 > +	if (c != 0 || isonum_733(isodir->extent) != ana->imp->root_extent)
 >  		pwhead += ana->imp->rr_skip;
 >  	else
 >  		pwhead += ana->imp->rr_skip0;
 
 This patch broke RRIP for me. It should be:
 
 ===== ~/s/src/sys/isofs/cd9660
 diff -u orig/cd9660_rrip.c ./cd9660_rrip.c
 --- orig/cd9660_rrip.c	Sun Aug 17 06:28:37 1997
 +++ ./cd9660_rrip.c	Fri Oct 30 23:48:14 1998
 @@ -518,10 +520,10 @@
  	pwhead = isodir->name + isonum_711(isodir->name_len);
 	if (!(isonum_711(isodir->name_len)&1))
 		pwhead++;
 +	isochar(isodir->name, pwhead, ana->imp->joliet_level, &c);
  
  	/* If it's not the '.' entry of the root dir obey SP field */
 -	if (*isodir->name != 0
 -	    || isonum_733(isodir->extent) != ana->imp->root_extent)
 +	if (c != 0 || isonum_733(isodir->extent) != ana->imp->root_extent)
  		pwhead += ana->imp->rr_skip;
  	else
  		pwhead += ana->imp->rr_skip0;
 
 I'm sorry I forgot to submit a follow-up when I noticed that. This
 applies to the -current patch as well, of course.
 
 cu Jo
 
 ---------------------------------------------------------------------
 Pray that there's intelligent life                    Joachim Kuebart
 Somewhere up in space                              Stuttgart, Germany
 'Cause there's bugger all down here on earth.
                               --- Monty Python

From: Byung Yang <byung@wam.umd.edu>
To: freebsd-gnats-submit@freebsd.org, keith@email.gcn.net.tw
Cc:  
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Thu, 07 Jan 1999 01:42:43 -0500

 I manually patched my kernel files with old release of joliet
 patch that I got from one of the previous posts.
 If you are using 3.0-RELEASE kernel, there won't be any problem
 for this patch. copy this patch to /usr/src and just patch
 from that point.  For some reason, additional files(that were
 not originally included in the kernel, such as *joliet.c and h)
 are created in /usr/src.  just copy them to:
 /usr/src/sys/isofs/cd9660 and recompile your kernel.
 With this patch, I was able to see long file names and 
 non-english characters(such as korean&chinese) so i believe it 
 does support unicode as long as your locale is set correctly.
 
 -Byung Yang
 
 -----------------------------------------------------------------
 begin 644 joliet.patch.gz
 M'XL(")Y4E#8``VIO;&EE="YP871C:`#56WMSVS82_UOY%&@[XTHV[?`EB9+K
 MW+B6DG/KU]A.>G>=#H<B(8L7BN3QX<9M?)_]=@&^"=%RFN;N/*UC`;L_+!:+
 MW<4"<MSEDNS;T06)'^*7=N`O7RY=C\;X\>"?@>?2Q`RMQ%Y1I]+[8G=WM\'0
 M^XDZY-).B*(359W*RE2?$&4R,5[L[^]WH_5N5RGYP?()&1-9GLK:5#:0=8+#
 M5'_8L,I$DY2)05@#8O.&"8&_]U\0XL;!$@1S)J.1G/UCIHGK'=B]($S<P+<\
 MPILW$-\OXR",MR?WQ=1[0FJN!"'X>QKY+]WUG64GIA6D2!0GEN]8D=/HI=YR
 M<^?=;VY8Q<?/+YS:,G<))EJJ+OK"%#IGB\8QHS;1%%BN*2ZR#'^,)IN,HQ.L
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C5.2U*B]
 M2%D%K6R=GYP?2^*3%,^D61UAZ4,^73Z&N[Z\O'TA>"2'[3V9/UI1QI*J:O43
 MQI><&#]\2W_R5+O/B=M_;Z9*O/'4^)F^,5-#:CS;'$V5CJ)5[>LRROBS?EWF
 M?_W[!D*:UQ?GQS<_`LT2?C92S>;?OWWSXHM]B_10.,XSOX-W^.(_N-7C7QT_
 "``#[
 `
 end
 --------------------------------------------------------------

From: Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
To: freebsd-gnats-submit@freebsd.org, keith@email.gcn.net.tw
Cc: byung@wam.umd.edu, joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Thu, 08 Apr 1999 12:25:33 +0900

 Hi.
 
 I have tried Byung's Joliet Patch(PR:kern/5038).
 
 This patch (and its ancestors) has the problem that 
 'ls -la' shows strange outputs for some CD-Rs.
 
 Note, there can be 2 or more PVDs, SVDs, and Boot records.
 The patch assumes that the SVD is the next sector to the PVD.
 This is wrong.
 On El Torito Bootable CD-ROMs, the first (#16) sector is PVD,
 and the second (#17) sector is *BOOT record*.
 Furthermore, there are some CD-Rs which have 2 PVDs and 2 SVDs.
 
 The following is the patch to Byung's considering multiple PVD/SVD/BOOTs.
 First, apply the Byung's patch at /usr/src (3.0-RELEASE or 3.1-STABLE),
 and then, apply this patch at /usr/src/sys/isofs/cd9660.
 
 --- cd9660_vfsops.c.prev	Thu Apr  8 09:30:53 1999
 +++ cd9660_vfsops.c	Thu Apr  8 11:04:33 1999
 @@ -283,7 +283,8 @@
  	struct iso_args *argp;
  {
  	register struct iso_mnt *isomp = (struct iso_mnt *)0;
 -	struct buf *bp = NULL, *joliet_bp = NULL;
 +	struct buf *bp = NULL;
 +	struct buf *pribp = NULL, *supbp = NULL;
  	dev_t dev = devvp->v_rdev;
  	int error = EINVAL;
  	int needclose = 0;
 @@ -292,9 +293,9 @@
  	int iso_bsize;
  	int iso_blknum;
  	struct iso_volume_descriptor *vdp = 0;
 -	struct iso_primary_descriptor *pri;
 +	struct iso_primary_descriptor *pri = NULL;
  	struct iso_supplementary_descriptor *sup = NULL;
 -	struct iso_sierra_primary_descriptor *pri_sierra;
 +	struct iso_sierra_primary_descriptor *pri_sierra = NULL;
  	struct iso_directory_record *rootp;
  	int logical_block_size;
  	int joliet_level = -1;
 @@ -334,6 +335,7 @@
  			goto out;
  		
  		vdp = (struct iso_volume_descriptor *)bp->b_data;
 +		high_sierra = 0;
  		if (bcmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) != 0) {
  			if (bcmp (vdp->id_sierra, ISO_SIERRA_ID,
  				  sizeof vdp->id) != 0) {
 @@ -341,45 +343,50 @@
  				goto out;
  			} else
  				high_sierra = 1;
 -		} else {
 -			/*
 -			 * We know it's ISO9660 fs, now get Supplementary Volume
 -			 * Descriptor to check if it's Microsoft Joliet format.
 -			 */
 -			if (error = bread(devvp, (1 + iso_blknum) * btodb(iso_bsize),
 -					  iso_bsize, NOCRED, &joliet_bp))
 -			  goto out;
 -
 -			sup = (struct iso_supplementary_descriptor *)joliet_bp->b_data;
 -			joliet_level = cd9660_joliet_level(sup);
 -
 -			if (joliet_level < 0) {
 -			  argp->flags |= ISOFSMNT_NOJOLIET;
 -			} else {
 -			  argp->flags |= ISOFSMNT_NORRIP;
 -			  argp->flags &= ~ISOFSMNT_GENS;
 -			}
 -			break;
 -		}
 -		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) {
 -			error = EINVAL;
 -			goto out;
  		}
 +		switch (isonum_711 (high_sierra? vdp->type_sierra: vdp->type)){
 +		case ISO_VD_PRIMARY:
 +			if (pribp == NULL) {
 +				pribp = bp;
 +				pri = (struct iso_primary_descriptor *)vdp;
 +				pri_sierra =
 +				  (struct iso_sierra_primary_descriptor *)vdp;
 +			} else
 +				brelse(bp);
 +			break;
  
 -		if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_PRIMARY)
 +		case ISO_VD_SUPPLEMENTARY:
 +			if (supbp == NULL) {
 +				supbp = bp;
 +				sup = (struct iso_supplementary_descriptor *)vdp;
 +				joliet_level = cd9660_joliet_level(sup);
 +
 +				if (joliet_level < 0) {
 +					argp->flags |= ISOFSMNT_NOJOLIET;
 +				} else {
 +					argp->flags |= ISOFSMNT_NORRIP;
 +					argp->flags &= ~ISOFSMNT_GENS;
 +				}
 +			} else
 +				brelse(bp);
  			break;
 -		brelse(bp);
 +
 +		case ISO_VD_END:
 +			brelse(bp);
 +			bp = NULL;
 +			goto vd_end;
 +
 +		default:
 +			brelse(bp);
 +		}
  	}
 + vd_end:
  
 -	if ((isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) && (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_SUPPLEMENTARY)){
 +	if (pri == NULL) {
  		error = EINVAL;
  		goto out;
  	}
  
 -	pri = (struct iso_primary_descriptor *)vdp;
 -	pri_sierra = (struct iso_sierra_primary_descriptor *)vdp;
 -
 -
  	logical_block_size =
  		isonum_723 (high_sierra?
  			    pri_sierra->logical_block_size:
 @@ -422,12 +429,14 @@
  	while ((1 << isomp->im_bshift) < isomp->logical_block_size)
  		isomp->im_bshift++;
  
 -	bp->b_flags |= B_AGE;
 -	brelse(bp);
 -	bp = NULL;
 -	brelse(joliet_bp);
 -	joliet_bp = NULL;
 -
 +	pribp->b_flags |= B_AGE;
 +	brelse(pribp);
 +	pribp = NULL;
 +	if (supbp) {
 +		if (joliet_level > 0) supbp->b_flags |= B_AGE;
 +		brelse(supbp);
 +		supbp = NULL;
 +	}
  
  	mp->mnt_data = (qaddr_t)isomp;
  	mp->mnt_stat.f_fsid.val[0] = (long)dev;
 @@ -494,6 +503,10 @@
  	devvp->v_specmountpoint = NULL;
  	if (bp)
  		brelse(bp);
 +	if (pribp)
 +		brelse(pribp);
 +	if (supbp)
 +		brelse(supbp);
  	if (needclose)
  		(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
  	if (isomp) {
 
 
 -- 
 Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
 Dept. of Biological Science, Fuculty of Sciences, Univ. of Tokyo, Japan
 
 
 

From: Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
To: freebsd-gnats-submit@freebsd.org, keith@email.gcn.net.tw
Cc: byung@wam.umd.edu, joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Wed, 14 Apr 1999 15:12:57 +0900

 I have changed on Joachim's patch.
 (Because Joachim's doesn't need patch to /sys/conf/files.)
 
 * The DEFAULT is now RockRidge for disks which have
    both Joliet and RockRidge.
 
 I have tested this new patch for the ISO image file,
 created by mkisofs 1.12b4, via vnconfig(8).
 
 The patch gzip+uuencoded is following.
 
 begin 664 joliet.patch.gz
 M'XL("%TC%#<"`VIO;&EE="YP871C:`"T/&UWVD:SG_&OF.0YUP8C"`)AWI(T
 M-":-6\?.L9WTMGUZ.$((HQ@D'DDX=1/?WWYG9G>EE7A->F\^&+2:G9V=]YT=
 M<NG/'L#S(0J=+LP?JK[[N?HIF'EN7%W8L3,]&'N3"53")4%4@]"[?1:-//_9
 M/%CZ\=`9=TY.:IF':IL@=P(=5"J5_5$6;J9+>&>'8';`/.E:S6ZSAM\[[8-R
 MN;S7>H5W@0_]!6*H0[W6K;>ZS1/"T#EX]0HJ)RWC!,KXMPVO7AU`0$R)IR[,
 M["C&)Q<^>[,9C'#`BV)W7"T=P)D/KH<P(3AVY!HP\69N!'/[@<""A>N[8YP5
 M3X-E#.Y?BYGG>#%BC6([]OQ;L`_@W@TC#ZGRE_.1&U8/RM6S&-[,X--!^30`
 M/XAA&;E@^P_P,PL$T<2N3U,BE)@S6XYQ"10=$<JK/R!M\^H!2#S!`5PN8@:W
 M0Q>BA>MX$T^21014&>B;!>SLPW#GFP3L%'Y%ND@\C1K4:BB;KL4";NTK8"<O
 MX$[7K*4";C5(P/BWQ0(N?(&GR$T[CI\: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*:*9(U0N]0`D!Q>"E]6#S)&_EB6*]WQ,0VTP<'K=WUC?3F`LN)R%EK]5Q)[
 MSZ=\W)OXF%JGOW^^NKR\6?.S:!HNU$0O34VT"5F6_*V/:J9)?S&G/=;$Q<.:
 MUAA)@$SL/[ZYOKGDY8KS1:E07&TK*M*+]`*B5!+48*)"OR]&:Q+=$Y3AASZ&
 MF\409QW+4@X5UG"$J%L/,/$F@00XJ,C6'NZYA^'P?;&HVA:IS2XV(/-8HM,C
 ME<T@/>/OF)4T/<HW$DM9+LQ@.0P;<.G3]J0W7>X?$YV@PL]@&*?_P8%`M;6$
 C;*RTE)7$/=V_7!^=.EG:+_\[UR`_5Q]0[@(`$,AK^Z=(``!@
 `
 end
 
 
 
 -- 
 Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
 Dept. of Biological Science, Fuculty of Sciences, Univ. of Tokyo, Japan
 
 
 

From: Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
To: freebsd-gnats-submit@freebsd.org, keith@email.gcn.net.tw,
	dcs@newsguy.com
Cc: byung@wam.umd.edu, joki@kuebart.stuttgart.netsurf.de,
	freebsd-current@freebsd.org
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sat, 17 Apr 1999 20:31:51 +0900

 Hey!
 
 I've add UNICODE support to the Joliet patch.
 
 It contains few charsets now, but to add other charsets is very easy.
 Currently, iso8859-1 and euc-jp is included.
 
 Mixture of Joliet/RockRidge Extension is also available, however untested.
 
 
 How to use:
 
 1. Pick up the patch from the URL.
 
    http://triaez.kaisei.org/~mzaki/joliet/joliet.unicode.patch.gz
 
    It contains huge table which provides conversion
     from unicode character to euc-jp, so that the gzip'ed size is 36k.
    So I give up to attach the patch to this mail.
 
 2. Apply the patch to the source tree.
 
    #cd /usr/src
    #zcat /tmp/joliet.unicode.patch.gz|patch -p1
 
 3. Make and install new mount_cd9660(8)
 
    #cd /usr/src/sbin/mount_cd9660
    #make; make install
 
 4. Reconfig and reinstall your kernel and reboot.
 
 5. Tell your kernel the charset you prefer.
 
    #sysctl -w vfs.charset=iso8859-1
 
    Currently, only 'none', 'iso8859-1' and 'euc-jp' is available.
 
        none      : The filenames are assumed to have 8bit character ONLY.
                    This is not recommended.
 
        iso8859-1 : 8bit characters.
                    All 16bit characters (include russian, greek, chinese, etc.)
                     are replaced with numerical ('0'-'9').
 
        euc-jp    : Japanese characters. 
                    This corresponds to the userland locale 'ja_JP.EUC'.
                    All characters unable to express are 
                     replaced with numerical ('0'-'9').
 
 
 How to use other charsets:
 
 1. Look at the /sys/isofs.
    charset and encoding directories are added.
 
    For Europians, to make new charset/*.c is sufficient.
    For Asians (Chinese, Korean, Japanese and so on),
     to make new encoding/*.c is also required.
 
    charset/*.c should contains Code Conversion Table.
    Currently, only 'UNICODE -> local charset' conversion is needed.
    (in future, reverse conversion may needed for msdosfs and ntfs.)
 
    encoding/*.c should contains multibyte encoding routines.
    These are subset of rune(3) at /usr/src/lib/libc/locale/
    At least, MSKanji is required for ja_JP.SJIS, BIG5 for zh_TW.BIG5, 
     also UTF-8 for all UNICODE locale.
 
 2. Add new file entries to /sys/conf/files
 
 3. Reconfig and reinstall your kernel and reboot.
    
 
 More documents are now scheduled in some days at the URL
 
        http://triaez.kaisei.org/~mzaki/joliet/
 
 
 -- 
 Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
 Dept. of Biological Science, Fuculty of Sciences, Univ. of Tokyo, Japan
 

From: Luoqi Chen <luoqi@watermarkgroup.com>
To: dcs@newsguy.com, freebsd-gnats-submit@FreeBSD.ORG,
	keith@email.gcn.net.tw, mzaki@e-mail.ne.jp
Cc: byung@wam.umd.edu, freebsd-current@FreeBSD.ORG,
	joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sat, 17 Apr 1999 11:49:01 -0400 (EDT)

 > Hey!
 > 
 > I've add UNICODE support to the Joliet patch.
 > 
 > It contains few charsets now, but to add other charsets is very easy.
 > Currently, iso8859-1 and euc-jp is included.
 > 
 > Mixture of Joliet/RockRidge Extension is also available, however untested.
 > 
 Cool! I think NTFS and VFATFS could use this code too, is it possible to
 move the code to place like libkern/unicode?
 
 > 
 > -- 
 > Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
 > Dept. of Biological Science, Fuculty of Sciences, Univ. of Tokyo, Japan
 > 
 
 -lq
 

From: "Daniel C. Sobral" <dcs@newsguy.com>
To: Luoqi Chen <luoqi@watermarkgroup.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG, keith@email.gcn.net.tw,
	mzaki@e-mail.ne.jp, byung@wam.umd.edu, freebsd-current@FreeBSD.ORG,
	joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sun, 18 Apr 1999 04:31:19 +0900

 Luoqi Chen wrote:
 > 
 > > I've add UNICODE support to the Joliet patch.
 > >
 > > It contains few charsets now, but to add other charsets is very easy.
 > > Currently, iso8859-1 and euc-jp is included.
 > >
 > > Mixture of Joliet/RockRidge Extension is also available, however untested.
 > >
 > Cool! I think NTFS and VFATFS could use this code too, is it possible to
 > move the code to place like libkern/unicode?
 
 I'm concerned about the possible size of GENERIC with this code.
 Remember, it has to fit in the install floppy. (Well, not really,
 with loader, but I'm not the one who is getting killed because of a
 three-disks install.)
 
 Also, it adds a sysctl node, isn't that so? Directly under vfs,
 even, so it applies to all filesystems. Ideally, this should apply
 on a per-mount basis, and not even be in a sysctl.
 
 --
 Daniel C. Sobral			(8-DCS)
 dcs@newsguy.com
 dcs@freebsd.org
 
 	"Well, Windows works, using a loose definition of 'works'..."
 

From: Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
To: dcs@newsguy.com
Cc: luoqi@watermarkgroup.com, freebsd-gnats-submit@FreeBSD.ORG,
	byung@wam.umd.edu, freebsd-current@FreeBSD.ORG,
	joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sun, 18 Apr 1999 13:55:58 +0900

 From: "Daniel C. Sobral" <dcs@newsguy.com>
 > Luoqi Chen wrote:
 > > 
 > > > I've add UNICODE support to the Joliet patch.
 > > >
 > > > It contains few charsets now, but to add other charsets is very easy.
 > > > Currently, iso8859-1 and euc-jp is included.
 > > >
 > > Cool! I think NTFS and VFATFS could use this code too, is it possible to
 > > move the code to place like libkern/unicode?
 > 
 > I'm concerned about the possible size of GENERIC with this code.
 > Remember, it has to fit in the install floppy. (Well, not really,
 > with loader, but I'm not the one who is getting killed because of a
 > three-disks install.)
 
 The UNICODE routines consist of these files.
 
 charset/charset.c   mandatory
         iso8859-1.c recommended
         euc-jp.c    optional    <-- BIG! the object file has 53k bytes
 
 encoding/encoding.c mandatory
          euc.c      optional
 
 The 'mandatory + recommended' object size is no more than 5 kbytes.
 The GENERIC kernel does not require necessarily 
 the euc-jp support or any other charsets.
 I think the iso8859-1 support alone is sufficient for GENERIC.
 
 The custom kernels can have the euc-jp support through
 the CHARSET_EUC_JP and ENCODING_EUC kernel configure option.
 (They are currently defined at the top of the source files.)
 
 
 > Also, it adds a sysctl node, isn't that so? Directly under vfs,
 > even, so it applies to all filesystems. Ideally, this should apply
 > on a per-mount basis, and not even be in a sysctl.
 
 Yes. sysctl is not the best idea.
 
 I think the charset preferences should apply on per-process basis ideally.
 
 The operator mounts some disks.
 The users access the disks in their own preferred charset.
 
 The UNICODE is a multiligual codeset, 
 so we shoud not suppose any specific charset on the disk.
 Therefore, a per-mount basis is not enough.
 
 If the routines can refer the users' environment 'LC_CTYPE',
 it is fine idea. But it can't, I suppose.
 
 -- 
 Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
 Dept. of Biological Science, Fuculty of Sciences, Univ. of Tokyo, Japan
 

From: "Daniel C. Sobral" <dcs@newsguy.com>
To: Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
Cc: luoqi@watermarkgroup.com, freebsd-gnats-submit@FreeBSD.ORG,
	byung@wam.umd.edu, freebsd-current@FreeBSD.ORG,
	joki@kuebart.stuttgart.netsurf.de
Subject: Re: kern/5038: FreeBSD can't read MS Joliet CDs.
Date: Sun, 18 Apr 1999 20:24:15 +0900

 Motomichi Matsuzaki wrote:
 > 
 > The 'mandatory + recommended' object size is no more than 5 kbytes.
 > The GENERIC kernel does not require necessarily
 > the euc-jp support or any other charsets.
 > I think the iso8859-1 support alone is sufficient for GENERIC.
 > 
 > The custom kernels can have the euc-jp support through
 > the CHARSET_EUC_JP and ENCODING_EUC kernel configure option.
 > (They are currently defined at the top of the source files.)
 
 But are they set by default to include euc-jp? Well, that's a minor
 point.
 
 > Yes. sysctl is not the best idea.
 > 
 > I think the charset preferences should apply on per-process basis ideally.
 > 
 > The operator mounts some disks.
 > The users access the disks in their own preferred charset.
 > 
 > The UNICODE is a multiligual codeset,
 > so we shoud not suppose any specific charset on the disk.
 > Therefore, a per-mount basis is not enough.
 > 
 > If the routines can refer the users' environment 'LC_CTYPE',
 > it is fine idea. But it can't, I suppose.
 
 Yeah, Terry Lambert has preached on this before. My point is that I
 can't get the patch committed with it using a sysctl node.
 
 --
 Daniel C. Sobral			(8-DCS)
 dcs@newsguy.com
 dcs@freebsd.org
 
 	"Well, Windows works, using a loose definition of 'works'..."
 
 
 
Responsible-Changed-From-To: freebsd-bugs->dcs 
Responsible-Changed-By: dcs 
Responsible-Changed-When: Sun Apr 18 06:55:13 PDT 1999 
Responsible-Changed-Why:  
I'm taking care of it. 
State-Changed-From-To: open->closed 
State-Changed-By: dcs 
State-Changed-When: Sat Apr 24 10:58:41 PDT 1999 
State-Changed-Why:  
Changes were applied to -current and -stable. Unicode support is 
still very limited. Interested parties should open a separate PR 
to deal with that. Thanks for everyone who contributed. 
>Unformatted:
