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

Bug#233627: CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY disabled



On Thu, Feb 19, 2004 at 10:02:08AM +0100, Bastian Blank wrote:
> tags 233627 unreproducible moreinfo
> severity 233627 important
> thanks
> 
> On Wed, Feb 18, 2004 at 11:29:20AM -0800, Matt Kraai wrote:
> > Recent versions of tar produce archives that BusyBox tar does not
> > support if CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not
> > enabled.  As a result, debootstrap fails under d-i.
> 
> | [..]/busybox-cvs-20040101/debian$ grep OLDGNU config-*
> | config-deb:# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
> | config-static:CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
> | config-udeb:CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
> | config-udeb-linux:CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
> 
> Also current GNU tar sets the old flags but don't realy need them.

Even with CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY enabled, it
fails to handle hard links correctly, which is what breaks d-i:

 $ mkdir foo
 $ touch foo/bar
 $ ln foo/bar foo/baz
 $ tar cf foo.tar foo
 $ busybox tar tvf foo.tar
 drwxr-xr-x 1000/1000         0 2004-02-19 02:30:05 foo
 -rw-r--r-- 1000/1000         0 2004-02-19 02:30:02 foo/bar
 ?rw-r--r-- 1000/1000         0 2004-02-19 02:30:02 foo/baz -> foo/bar

The attached patch makes it handle hard links correctly.

-- 
Matt Kraai            kraai@ftbfs.org            http://ftbfs.org/
diff -ru busybox-cvs-20040101-old/archival/libunarchive/get_header_tar.c busybox-cvs-20040101/archival/libunarchive/get_header_tar.c
--- busybox-cvs-20040101-old/archival/libunarchive/get_header_tar.c	2004-02-19 01:57:35.000000000 -0800
+++ busybox-cvs-20040101/archival/libunarchive/get_header_tar.c	2004-02-19 02:31:52.000000000 -0800
@@ -154,6 +154,7 @@
 	/* hard links are detected as regular files with 0 size and a link name */
 	case '1':
 		file_header->mode &= (S_IFREG | 07777);
+		file_header->mode |= S_IFREG;
 		break;
 # ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
 	case 'L': {

Reply to: