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
0000547 [BusyBox] Standards Compliance major always 11-16-05 09:07 01-08-06 19:09
Reporter aforet View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.00
Summary 0000547: tar archive corruption when packing unreadable files
Description When trying to pack a file not readable in a tarball, the Busybox tar applet includes an header describing the file to the tar archive, but with no content. The resulting archive is corrupted.

For instance:

$ id
uid=500(johndoe) gid=100(users) groups=100(users)
$ ls -l file?
-rw-r--r-- 1 johndoe users 20 nov 2 2005 file1
-rw------- 1 root root 20 nov 2 2005 file2
-rw-r--r-- 1 johndoe users 20 nov 2 2005 file3
$ cat file1
this is file 1
$ cat file2
this is file 2
$ cat file3
this is file 3
$ ./busybox tar cvf test.tar file1 file2 file3
file3
file2
tar: file2: Cannot open: Permission non accord
Additional Information BTW, tar reports errors when trying to create the archive, however the returned error code is 0!
Same thing when trying to list the content of the corrupted archived: BB tar failed to fully display it, but it still returns 0 as the error code...
Attached Files  tar_bug547.diff [^] (3,048 bytes) 12-27-05 02:03

- Relationships

- Notes
(0000817)
robang74
12-27-05 02:05
edited on: 12-27-05 02:09

AFTER PATCH:

busybox-1.01$ ./busybox tar cvzf test.tgz test; echo $?
test/
test/uno
tar: test/due: Cannot open: Permission denied
test/tre
tar: Error exit delayed from previous errors
1

busybox-1.01$ ./busybox tar tvzf test.tgz; echo $?
drwxr-xr-x 1309/100 0 2005-12-27 10:36:01 test
-rw-r--r-- 1309/100 10240 2005-12-27 10:20:26 test/uno
-rw-r--r-- 1309/100 10240 2005-12-27 10:20:42 test/tre
0





---- HOW TO REPRODUCE ERROR AND TAR COMPARISON ---


busybox-1.01$ mkdir test && cd test
test$ dd if=busybox of=uno bs=1k count=10
entrati 10+0 record
usciti 10+0 record
test$ cp uno due
test$ cp due tre

test$ chmod a-rwx due
test$ ls -al due
---------- 1 roberto users 10240 dic 27 10:20 due
test$ ..
busybox-1.01$ ./busybox tar cvzf test.tgz test
test/
test/uno
test/due
tar: test/due: Cannot open: Permission denied

test/tre
tar: Error exit delayed from previous errors
busybox-1.01$ echo $?
0

tar archive result corrupted for both bb applet and real tar command

busybox-1.01$ ./busybox tar tvzf test.tgz; echo $?
drwxr-xr-x 1309/100 0 2005-12-27 10:20:54 test
-rw-r--r-- 1309/100 10240 2005-12-27 10:20:26 test/uno
---------- 1309/100 10240 2005-12-27 10:20:39 test/due
tar: Invalid tar magic
1

busybox-1.01$ tar tvzf test.tgz; echo $?
drwxr-xr-x roberto/users 0 2005-12-27 10:20:54 test/
-rw-r--r-- roberto/users 10240 2005-12-27 10:20:26 test/uno
---------- roberto/users 10240 2005-12-27 10:20:39 test/due
tar: Salto alla prossima intestazione
tar: Uscita per errore ritardata dall'errore precedente
2


while real tar command behave better:

busybox-1.01$ tar cvzf test.tgz test; echo $?
test/
test/uno
tar: test/due: Impossibile open: Permission denied
test/tre
tar: Uscita per errore ritardata dall'errore precedente
2

busybox-1.01$ ./busybox tar tvzf test.tgz; echo $?
drwxr-xr-x 1309/100 0 2005-12-27 10:20:54 test
-rw-r--r-- 1309/100 10240 2005-12-27 10:20:26 test/uno
-rw-r--r-- 1309/100 10240 2005-12-27 10:20:42 test/tre
0

 
(0000876)
landley
01-08-06 19:09

svn 13189
 

- Issue History
Date Modified Username Field Change
11-16-05 09:07 aforet New Issue
11-16-05 09:07 aforet Status new => assigned
11-16-05 09:07 aforet Assigned To  => BusyBox
11-17-05 00:52 aforet Issue Monitored: aforet
11-17-05 00:52 aforet Issue End Monitor: aforet
12-27-05 02:02 robang74 Issue Monitored: robang74
12-27-05 02:03 robang74 File Added: tar_bug547.diff
12-27-05 02:05 robang74 Note Added: 0000817
12-27-05 02:08 robang74 Note Edited: 0000817
12-27-05 02:09 robang74 Note Edited: 0000817
01-08-06 19:09 landley Status assigned => closed
01-08-06 19:09 landley Note Added: 0000876
01-08-06 19:09 landley Resolution open => fixed
01-08-06 19:09 landley Fixed in Version  => svn
01-09-06 05:52 robang74 Issue End Monitor: robang74


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker