Bug 147440 - [PATCH] file -z bugs when checking bzip2 files.
[PATCH] file -z bugs when checking bzip2 files.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: file (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-07 17:53 EST by Marcin Garski
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-02-15 04:24:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix bugs described in bug report. (7.05 KB, patch)
2005-02-07 17:56 EST, Marcin Garski
no flags Details | Diff

  None (edit)
Description Marcin Garski 2005-02-07 17:53:19 EST
1)
wget http://files.customize.org/ss/badseed-linux-devolutionwm1-0.png
2)
gzip -c badseed-linux-devolutionwm1-0.png > 
badseed-linux-devolutionwm1-0.png.gz
3)
bzip2 -c badseed-linux-devolutionwm1-0.png > 
badseed-linux-devolutionwm1-0.png.bz2
4)
compress -c badseed-linux-devolutionwm1-0.png > 
badseed-linux-devolutionwm1-0.png.Z
5)
file -zi *

RESULTS
badseed-linux-devolutionwm1-0.png:     image/png
badseed-linux-devolutionwm1-0.png.bz2: application/x-bzip2
badseed-linux-devolutionwm1-0.png.gz:  image/png (application/x-gzip)
badseed-linux-devolutionwm1-0.png.Z:   image/png (application/x-compress)

What's wrong:
badseed-linux-devolutionwm1-0.png.bz2: application/x-bzip2

It should be:
badseed-linux-devolutionwm1-0.png.bz2: image/png (application/x-bzip2)

---------SECOND BUG----------
1)
wget ftp://ftp.gnu.org/gnu/bison/bison-1.875.tar.bz2
2)
file -z bison-1.29.tar.bz2

You will get:
bison-1.29.tar.bz2: bison-1.29.tar.bz2: bzip2 compressed data, block 
size = 900k

bison-1.29.tar.bz2 - is replayed twice, shoud only be one
"bison-1.29.tar.bz2"

The second bug can be resolved by adding:
fflush(stdout);
fflush(stderr);

The first bug can be resolved by attached patch (it also fixes the
first one). I've recived it from Christos Zoulas (file developer).
But beware that this patch has enabled debuging.
Comment 1 Marcin Garski 2005-02-07 17:56:24 EST
Created attachment 110762 [details]
Patch to fix bugs described in bug report.
Comment 2 Marcin Garski 2005-02-07 18:26:04 EST
There is also one more bug:

1) wget http://search.cpan.org/src/GAAS/Image-Info-1.16/img/test.xpm
2) file -iz test.xpm

test.xpm: image/x-xpm\0117bit

011 is a ’\t’ char and shouldn't be displayed (tab should be inserted).

This bug is known and fixed by Christos, but I didn't recived patch
for this, should I mail him for it?
Comment 3 Marcin Garski 2005-02-07 18:43:09 EST
I've tested above bugs on file-4.12-3. Attached patch will apply if
you disable file-4.12-compress.patch
Comment 4 Radek Vokal 2005-02-08 06:44:18 EST
Patch looks good, thx. Just I've kept the compress patch with two pids
solving the fork() problem rather than yours. I've emailed Christos
about the second bug and hopefully will get the patch from him. 
Comment 5 Marcin Garski 2005-02-13 08:53:24 EST
file-4.13 has been released on 2005-02-09.
Comment 6 Radek Vokal 2005-02-15 04:24:33 EST
file-4.13 is now in devel branch

Note You need to log in before you can comment on or make changes to this bug.