Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jul 2009 21:19:45 -0700
From:      Tim Kientzle <kientzle@freebsd.org>
To:        Jung-uk Kim <jkim@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Joliet and release ISOs?
Message-ID:  <4A6A87E1.8030504@freebsd.org>
In-Reply-To: <200907241514.18806.jkim@FreeBSD.org>
References:  <4A615602.4090000@freebsd.org> <200907231903.46474.jkim@FreeBSD.org> <4A694DBB.8080800@freebsd.org> <200907241514.18806.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060103060203010600040401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jung-uk Kim wrote:
> 
> Still, there is one minor annoyance:
> 
> %ls -l test
> total 0
> lrwxr-xr-x  1 jkim  staff  1  7 24 14:54 link1 -> /
> lrwxr-xr-x  1 jkim  staff  2  7 24 14:55 link2 -> //
> lrwxr-xr-x  1 jkim  staff  2  7 24 14:55 link3 -> /.
> lrwxr-xr-x  1 jkim  staff  2  7 24 14:55 link4 -> ./
> lrwxr-xr-x  1 jkim  staff  2  7 24 14:55 link5 -> ..
> lrwxr-xr-x  1 jkim  staff  4  7 24 14:56 link6 -> /tmp
> lrwxr-xr-x  1 jkim  staff  5  7 24 14:56 link7 -> //tmp
> lrwxr-xr-x  1 jkim  staff  4  7 24 14:56 link8 -> tmp/
> lrwxr-xr-x  1 jkim  staff  5  7 24 14:56 link9 -> /tmp/
> %tar -t --options=\!joliet -v -f test.iso
> drwx------  0 0      0        2048  7 24 14:56 .
> lr-xr-xr-x  1 0      0           0  7 24 14:56 link9 -> //tmp/
> lr-xr-xr-x  1 0      0           0  7 24 14:56 link8 -> tmp/
> lr-xr-xr-x  1 0      0           0  7 24 14:56 link7 -> ///tmp
> lr-xr-xr-x  1 0      0           0  7 24 14:56 link6 -> //tmp
> lr-xr-xr-x  1 0      0           0  7 24 14:55 link5 -> ..
> lr-xr-xr-x  1 0      0           0  7 24 14:55 link4 -> ./
> lr-xr-xr-x  1 0      0           0  7 24 14:55 link3 -> //.
> lr-xr-xr-x  1 0      0           0  7 24 14:55 link2 -> ///
> lr-xr-xr-x  1 0      0           0  7 24 14:54 link1 -> /
> 
> Note there is an additional `/' when the link has a leading `/' (but 
> not just `/'), i.e., `//' => `///', `/.' => `//.', `/tmp' => `//tmp', 
> `//tmp' => `///tmp'.  For FreeBSD CD-ROMs, `stand -> /rescue' becomes 
> `stand -> //rescue', etc.

Here's another patch for you to try; this changes how
libarchive parses Rockridge "SL" extensions.

Cheers,

Tim

P.S.  Could you email me privately the "test.iso" image
you created on your machine?  I tried creating one here
and get slightly different behavior.  Also, what version
of mkisofs do you have installed on your machine?


--------------060103060203010600040401
Content-Type: text/x-patch;
 name="libarchive_iso9660_symlink.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="libarchive_iso9660_symlink.patch"

Index: archive_read_support_format_iso9660.c
===================================================================
--- archive_read_support_format_iso9660.c	(revision 195838)
+++ archive_read_support_format_iso9660.c	(working copy)
@@ -1174,12 +1175,12 @@
 parse_rockridge_SL1(struct file_info *file, const unsigned char *data,
     int data_length)
 {
-	int component_continues = 1;
+	const char *separator = "";
 
-	if (!file->symlink_continues)
+	if (!file->symlink_continues || file->symlink.length < 1)
 		archive_string_empty(&file->symlink);
-	else
-		archive_strcat(&file->symlink, "/");
+	else if (file->symlink.s[file->symlink.length - 1] != '/')
+		separator = "/";
 	file->symlink_continues = 0;
 
 	/*
@@ -1216,9 +1217,8 @@
 		unsigned char nlen = *data++;
 		data_length -= 2;
 
-		if (!component_continues)
-			archive_strcat(&file->symlink, "/");
-		component_continues = 0;
+		archive_strcat(&file->symlink, separator);
+		separator = "/";
 
 		switch(flag) {
 		case 0: /* Usual case, this is text. */
@@ -1232,7 +1232,7 @@
 				return;
 			archive_strncat(&file->symlink,
 			    (const char *)data, nlen);
-			component_continues = 1;
+			separator = "";
 			break;
 		case 0x02: /* Current dir. */
 			archive_strcat(&file->symlink, ".");
@@ -1243,6 +1243,7 @@
 		case 0x08: /* Root of filesystem. */
 			archive_string_empty(&file->symlink);
 			archive_strcat(&file->symlink, "/");
+			separator = "";
 			break;
 		case 0x10: /* Undefined (historically "volume root" */
 			archive_string_empty(&file->symlink);

--------------060103060203010600040401--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A6A87E1.8030504>