BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001509 [BusyBox] Other minor always 09-24-07 06:54 02-13-08 08:34
Reporter Dwight Engen View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version svn
Summary 0001509: tar does not remove leading / from hard link target
Description Since busybox tar does not strip the leading slash when saving a hard link, attempting to restore a tar with hard links in it on a mounted volume results in EXDEV from link(2). A patch is provided which fixes the problem.
Additional Information
Attached Files  tar.patch [^] (1,107 bytes) 09-24-07 06:54
 6.patch [^] (2,333 bytes) 09-24-07 12:06

- Relationships

- Notes
(0002792)
vda
09-24-07 11:44

In an empty directory with busybox's executable only:

$ ln busybox busybox_z
$ ./busybox tar cf ../z.tar *
$ mkdir z; cd z
$ ../busybox tar xf ../../z.tar
$ ls -li
total 1528
7340110 -rwxr-xr-x 2 vda eng 775788 Sep 24 19:28 busybox
7340110 -rwxr-xr-x 2 vda eng 775788 Sep 24 19:28 busybox_z

Please provide a testcase where it fails.
 
(0002793)
vda
09-24-07 12:06

I managed to reproduce this.

Please test attached patch.
 
(0002794)
Dwight Engen
09-24-07 14:16

Sorry I wasn't clear about the test case: you must attempt to tar giving /something as the files to tar up. For example:

$ mkdir /foo
$ cd /foo
$ touch bar
$ ln bar baz
$ tar cf /tmp/test.tar /foo

hexdump'ing /tmp/test.tar would show foo/baz's link target to be /foo/bar.

I tested your patch and it works fine, I hadn't noticed that slash skipping loop in writeFileToTarball, much cleaner place to fix. I think the first part of the third hunk is just whitespace? Thanks for the fix.
 
(0004434)
vda
02-13-08 08:34

Fixed sometime ago.
 

- Issue History
Date Modified Username Field Change
09-24-07 06:54 Dwight Engen New Issue
09-24-07 06:54 Dwight Engen Status new => assigned
09-24-07 06:54 Dwight Engen Assigned To  => BusyBox
09-24-07 06:54 Dwight Engen File Added: tar.patch
09-24-07 11:44 vda Note Added: 0002792
09-24-07 12:06 vda File Added: 6.patch
09-24-07 12:06 vda Note Added: 0002793
09-24-07 14:16 Dwight Engen Note Added: 0002794
02-13-08 08:34 vda Status assigned => closed
02-13-08 08:34 vda Note Added: 0004434
02-13-08 08:34 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker