From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Russ Cox" To: 9fans@cse.psu.edu Subject: Re: [9fans] Weirdness with 9660srv and file names (extensions)? MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20020127192906.BC8B6199E4@mail.cse.psu.edu> Date: Sun, 27 Jan 2002 14:29:05 -0500 Topicbox-Message-UUID: 46e4b9fc-eaca-11e9-9e20-41e7f4b1d025 The ISO9660 spec (actually I was reading ECMA 119, which is supposedly identical) is fairly clear about this issue: every file on the volume should have a . and a ; in its name, since they are separators rather than file name characters. That is, every name is supposed to be of the form file name . file extension ; version Most writers (including our very own mk9660) don't put the . and ; in when there is nothing to separate, so our mishandling of the trailing . hadn't been noticed before. Thus I propose replacing p = strchr(d->name, ';'); if(p != 0) { vers = strtoul(p+1, 0, 10); memset(p, 0, NAMELEN-(p-d->name)); } with if(fmt!='9' && !(d->mode&CHDIR)){ /* * ISO 9660 actually requires that you always have a . and a ;, * even if there is no version and no extension. Very few writers * do this. If the version is present, we use it for qid.vers. * If there is no extension but there is a dot, we strip it off. * (DOS heads couldn't comprehend the dot as a file name character * rather than as just a separator between name and extension.) * * We don't do this for directory names because directories are * not allowed to have extensions and versions. */ if((p=strchr(d->name, ';')) != nil){ vers = strtoul(p+1, 0, 0); d->qid.vers = vers; memset(p, 0, NAMELEN-(p-d->name)); } if((p=strchr(d->name, '.')) != nil && *(p+1)=='\0') memset(p, 0, NAMELEN-(p-d->name)); } Russ