bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] USTAR interoperability with Solaris 10 /bin/tar


From: Henrik Grubbström
Subject: [Bug-tar] USTAR interoperability with Solaris 10 /bin/tar
Date: Thu, 28 Sep 2006 16:04:47 +0200 (CEST)


Hi.

I need to create tar archives with deep paths on a Linux machine that Solaris 10's system tar (ie /bin/tar) can extract. If I read the manuals correctly, this should be achievable by using the USTAR format.

$ gtar --format=ustar --record-size=512 -cvf gtar.ustar.512 long_path_name_so_we_dont_need_to_recurse_so_much/
long_path_name_so_we_dont_need_to_recurse_so_much/
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/foo

Unfortunately, it seems Solaris tar bails out at the first path longer than 100 characters:

 $ /bin/tar tvf gtar.ustar.512
tar: blocksize = 7
drwxr-xr-x 1053/1053      0 Sep 28 15:42 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/
drwxr-xr-x 1053/1053      0 Sep 28 15:43 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/

Solaris tar does support long deep paths:

 $ /bin/tar cvf solaris.tar long_path_name_so_we_dont_need_to_recurse_so_much
a long_path_name_so_we_dont_need_to_recurse_so_much/ 0K
a 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
 0K
a 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
 0K
a 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
 0K
a 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/foo
 0K
 $ /bin/tar tvf solaris.tar
tar: blocksize = 7
drwxr-xr-x 1053/1053      0 Sep 28 15:42 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/
drwxr-xr-x 1053/1053      0 Sep 28 15:43 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
drwxr-xr-x 1053/1053      0 Sep 28 15:43 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
drwxr-xr-x 1053/1053      0 Sep 28 14:32 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/
-rw-r--r-- 1053/1053      0 Sep 28 14:32 2006 
long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/long_path_name_so_we_dont_need_to_recurse_so_much/foo

Comparing the two archives until the first significant difference gives:

 $ ls -l gtar.ustar.512 solaris.tar
-rw-r--r--   1 grubba   grubba      3584 Sep 28 15:44 gtar.ustar.512
-rw-r--r--   1 grubba   grubba      3584 Sep 28 15:47 solaris.tar
 $ od -cx gtar.ustar.512 >gtar.ustar.512.od
 $ od -cx solaris.tar >solaris.tar.od
 $ diff -u gtar.ustar.512.od solaris.tar.od | head -69
--- gtar.ustar.512.od   Thu Sep 28 15:51:11 2006
+++ solaris.tar.od      Thu Sep 28 15:51:27 2006
@@ -15,8 +15,8 @@
            3330    0035    3030    3230    3330    0035    3030    3030
 0000200   0   0   0   0   0   0   0  \0   1   0   5   0   6   7   5   0
            3030    3030    3030    0030    3031    3035    3736    3035
-0000220   5   4   2  \0   0   2   3   7   7   7  \0       5  \0  \0  \0
-           3435    0032    3230    3733    3737    2000    0035    0000
+0000220   5   4   2  \0   0   0   2   4   0   1   1  \0   5  \0  \0  \0
+           3435    0032    3030    3432    3130    0031    0035    0000
 0000240  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
            0000    0000    0000    0000    0000    0000    0000    0000
 *
@@ -28,10 +28,10 @@
            0000    0000    0000    0000    6700    7572    6262    0061
 0000460  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
            0000    0000    0000    0000    0000    0000    0000    0000
-0000500  \0  \0  \0  \0  \0  \0  \0  \0  \0   0   0   0   0   0   0   0
-           0000    0000    0000    0000    3000    3030    3030    3030
-0000520  \0   0   0   0   0   0   0   0  \0  \0  \0  \0  \0  \0  \0  \0
-           3000    3030    3030    3030    0000    0000    0000    0000
+0000500  \0  \0  \0  \0  \0  \0  \0  \0  \0   0   0   0   0   4   2   2
+           0000    0000    0000    0000    3000    3030    3430    3232
+0000520  \0   0   0   0   0   0   0   2  \0  \0  \0  \0  \0  \0  \0  \0
+           3000    3030    3030    3230    0000    0000    0000    0000
 0000540  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
            0000    0000    0000    0000    0000    0000    0000    0000
 *
@@ -53,8 +53,8 @@
            3330    0035    3030    3230    3330    0035    3030    3030
 0001200   0   0   0   0   0   0   0  \0   1   0   5   0   6   7   5   0
            3030    3030    3030    0030    3031    3035    3736    3035
-0001220   5   4   7  \0   0   3   6   1   4   1  \0       5  \0  \0  \0
-           3435    0037    3330    3136    3134    2000    0035    0000
+0001220   5   4   7  \0   0   0   3   6   1   5   3  \0   5  \0  \0  \0
+           3435    0037    3030    3633    3531    0033    0035    0000
 0001240  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
            0000    0000    0000    0000    0000    0000    0000    0000
 *
@@ -66,13 +66,24 @@
            0000    0000    0000    0000    6700    7572    6262    0061
 0001460  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
            0000    0000    0000    0000    0000    0000    0000    0000
-0001500  \0  \0  \0  \0  \0  \0  \0  \0  \0   0   0   0   0   0   0   0
-           0000    0000    0000    0000    3000    3030    3030    3030
-0001520  \0   0   0   0   0   0   0   0  \0  \0  \0  \0  \0  \0  \0  \0
-           3000    3030    3030    3030    0000    0000    0000    0000
+0001500  \0  \0  \0  \0  \0  \0  \0  \0  \0   0   0   0   0   4   2   2
+           0000    0000    0000    0000    3000    3030    3430    3232
+0001520  \0   0   0   0   0   0   0   2  \0  \0  \0  \0  \0  \0  \0  \0
+           3000    3030    3030    3230    0000    0000    0000    0000
 0001540  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
            0000    0000    0000    0000    0000    0000    0000    0000
 *
+0002000   l   o   n   g   _   p   a   t   h   _   n   a   m   e   _   s
+           6f6c    676e    705f    7461    5f68    616e    656d    735f
+0002020   o   _   w   e   _   d   o   n   t   _   n   e   e   d   _   t
+           5f6f    6577    645f    6e6f    5f74    656e    6465    745f
+0002040   o   _   r   e   c   u   r   s   e   _   s   o   _   m   u   c
+           5f6f    6572    7563    7372    5f65    6f73    6d5f    6375
+0002060   h   /  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+           2f68    0000    0000    0000    0000    0000    0000    0000
+0002100  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+           0000    0000    0000    0000    0000    0000    0000    0000
+*
 0002140  \0  \0  \0  \0   0   0   0   0   7   5   5  \0   0   0   0   2
            0000    0000    3030    3030    3537    0035    3030    3230
 0002160   0   3   5  \0   0   0   0   2   0   3   5  \0   0   0   0   0
@@ -79,8 +90,8 @@

So the main difference seems to be that the file name is missing in the record for the first long path in the gnutar case.

Any suggestions for a patch?

--
Henrik Grubbström                                       address@hidden
Roxen Internet Software AB

reply via email to

[Prev in Thread] Current Thread [Next in Thread]