Bug 72986 - file command hangs on empty gzipped files
file command hangs on empty gzipped files
Product: Red Hat Linux
Classification: Retired
Component: file (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Bacovsky
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2002-08-29 14:19 EDT by P Fudd
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version: 4.17-6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-03 12:07:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Reports compressed empty files as 'empty', not 'data' (619 bytes, patch)
2002-10-28 22:37 EST, P Fudd
no flags Details | Diff

  None (edit)
Description P Fudd 2002-08-29 14:19:34 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.19-rc3 i686)

Description of problem:
If you try to run the 'file -z' command on an empty file that's been gzipped,
file locks up.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.touch emptyfile
2.gzip emptyfile
3.file -z emptyfile.gz

Actual Results:  The command line didn't come back.  ps shows that gzip is a
zombie, but file isn't paying attention.

Expected Results:  It should have said:
emptyfile.gz: empty (gzip compressed data, deflated, original filename,
`emptyfile', last modified: Thu Aug 29 11:05:18 2002, os: Unix)

Additional info:

Actually, this happens with any file smaller than 73 bytes and then gzipped.
 dd if=/usr/share/dict/words of=hello count=1 bs=72 ; gzip hello ; file -z
Comment 1 Trond Eivind Glomsrxd 2002-08-30 16:09:41 EDT
Reproduced. Only happens with -z...
Comment 2 Jeff Johnson 2002-10-27 10:50:08 EST
Fixed in file-3.39-1:	
	bash$ touch xxx
	bash$ gzip xxx
	bash$ file -z xxx.gz 
	xxx.gz: data (gzip compressed data, was "xxx", from Unix)
	bash$ file --version
	magic file from /usr/share/magic
	bash$ rpm -q file
Comment 3 P Fudd 2002-10-27 20:25:27 EST
Er, shouldn't it say 'xxx.gz: empty (gzip compressed data, was "xxx", from Unix)'
Comment 4 Jeff Johnson 2002-10-28 08:21:04 EST
Probably. The bug was that "file -z" hung, however.
Comment 5 P Fudd 2002-10-28 22:37:07 EST
Created attachment 82505 [details]
Reports compressed empty files as 'empty', not 'data'
Comment 6 P Fudd 2002-10-28 22:38:43 EST
I've included a patch to fix the 'xxx.gz: data (gzip compressed data, was "xxx",
from Unix)' problem.  It now reports 'empty', not 'data' in the case of empty files.
Comment 7 P Fudd 2005-07-06 19:12:10 EDT
This bug is still present in FC4.
Comment 8 Martin Bacovsky 2006-08-03 12:07:12 EDT
Bug was caused by adding '\0' to content after decompression, so content was
never empty. Fixed.

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