Thread: Kobo Bug thread
View Single Post
Old 12-14-2014, 10:34 AM   #571
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Busybox zcat does not throw any errors at all.

Real zcat would throw an error, unless the cutoff happened to be a valid boundary.

tar throws an error unless it would happen to be cut off at a valid boundary for both gzip and tar. Whether that is likely to exist depends on how the tgz was created.

Code:
[root@(none) shm]# tar cfz Test.tgz /usr/local/Kobo/
tar: removing leading '/' from member names
[root@(none) shm]# ls -alh Test.tgz
-rw-r--r--    1 root     root       19.8M Dec 14 16:28 Test.tgz
[root@(none) shm]# zcat Test.tgz > /dev/null && echo OK || echo FAIL
OK
[root@(none) shm]# tar tzf Test.tgz > /dev/null && echo OK || echo FAIL
OK
### now cut off some bytes ###
[root@(none) shm]# dd of=Test.tgz bs=1M seek=18 count=0
0+0 records in
0+0 records out
0 bytes (0B) copied, 0.004449 seconds, 0B/s
[root@(none) shm]# ls -alh Test.tgz
-rw-r--r--    1 root     root       18.0M Dec 14 16:29 Test.tgz
### zcat does not notice the problem, but tar does ###
[root@(none) shm]# zcat Test.tgz > /dev/null && echo OK || echo FAIL
OK
[root@(none) shm]# tar tzf Test.tgz > /dev/null && echo OK || echo FAIL
tar: short read
FAIL
frostschutz is offline   Reply With Quote