Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 241848

Summary: file(1) mis-handle gzip file as FLC file.
Product: Red Hat Enterprise Linux 4 Reporter: masanari iida <masanari_iida>
Component: fileAssignee: Daniel Novotny <dnovotny>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 4.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 641838 (view as bug list) Environment:
Last Closed: 2009-05-18 20:06:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 641838    
Attachments:
Description Flags
sample files
none
Proposed patch
none
Fat fingers. This is the correct patch...
none
testcase testing bug: 241848 454650 440551 none

Description masanari iida 2007-05-31 05:23:18 UTC
Description of problem:
file(1) mis-handle gzip file as FLC file.

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

# rpm -q file
file-4.10-2.EL4.4

How reproducible:
Only corner cases in normal environment.
100% if your follow my steps.


Steps to Reproduce:
# touch abc
# touch -m -t 200705080758.26 ./abc
# gzip abc
# file abc.gz
abc.gz: FLC file - 17983 frames width=768 pixels, height=25185 pixels, depth=99,
ticks/frame=0


Actual results:
abc.gz: FLC file - 17983 frames width=768 pixels, height=25185 pixels, depth=99,
ticks/frame=0


Expected results:
# file abc.gz
abc.gz: gzip compressed data, was "abc", from Unix


Additional info:
The file header looks like this.

00000000  1F 8B 08 08 12 AF 3F 46 00 03 65 65 65 65 65 65 ......?F..eeeeee

file(1) see 12 AF part at first, then recognize the file as FLC,
although other part of the header (1F 8B) include gzip style.
12 AF part of the gzip header is generated from "mtime" of the original file
by gzip. 
My understanding is gzip works as it should be.
But file(1) doesn't check the file header carefully.

Comment 1 Tomas Smetana 2008-02-01 10:20:41 UTC
Could not reproduce:

[tsmetana@vmware111 ~]$ touch abc
[tsmetana@vmware111 ~]$ touch -m -t 200705080758.26 ./abc
[tsmetana@vmware111 ~]$ gzip abc
[tsmetana@vmware111 ~]$ file abc.gz 
abc.gz: gzip compressed data, was "abc", from Unix
[tsmetana@vmware111 ~]$ rpm -q file
file-4.10-2.EL4.4




Comment 2 masanari iida 2008-02-01 10:41:35 UTC
Created attachment 293705 [details]
sample files

abc_all.tar.gz include 2 sample files,
abc1.gz and abc2.gz.
Both files are generated following my reproduce steps.

Comment 3 Tomas Smetana 2008-02-01 11:51:05 UTC
Thanks.  I have reproduced the bug with the attached files.

Seems that putting animation after compress when concatenating the magic files
solves the problem.

Comment 4 Tomas Smetana 2008-02-01 11:52:49 UTC
Created attachment 293713 [details]
Proposed patch

Comment 5 Tomas Smetana 2008-02-01 11:57:31 UTC
Created attachment 293714 [details]
Fat fingers. This is the correct patch...

Comment 6 RHEL Program Management 2008-02-01 19:07:38 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 7 RHEL Program Management 2008-09-05 17:06:57 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Daniel Novotny 2008-10-22 10:21:36 UTC
fixed in file-4.10-6.el4

Comment 12 Jan Ščotka 2008-12-12 13:28:18 UTC
Created attachment 326726 [details]
testcase testing bug: 241848 454650 440551 

# tar xvf file_badres.tar.gz
# cd file_badres
# ./runtest.sh

Comment 15 errata-xmlrpc 2009-05-18 20:06:16 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0954.html