Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 641838 - file(1) mis-handle gzip file as FLC file.
file(1) mis-handle gzip file as FLC file.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: file (Show other bugs)
5.6
All Linux
medium Severity low
: rc
: ---
Assigned To: Jan Kaluža
BaseOS QE Security Team
:
Depends On: 241848
Blocks: 668957
  Show dependency treegraph
 
Reported: 2010-10-11 05:11 EDT by Tomas Smetana
Modified: 2012-10-29 08:56 EDT (History)
4 users (show)

See Also:
Fixed In Version: file-4.17-17
Doc Type: Bug Fix
Doc Text:
Cause: In some situation, gzip files can have the same beginning as FLC files. File tries to match FLC magic patterns before gzip magic patterns. Consequence: This causes some gzip files are detected as FLC files. Fix: Order of gzip and FLC magic patterns have been changed, because gzip magic pattern is longer and therefore stronger. Result: File now tries to match gzip magic pattern before FLC magic pattern, so it detects gzip files properly.
Story Points: ---
Clone Of: 241848
Environment:
Last Closed: 2012-02-21 00:46:17 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)
Proposed patch (542 bytes, patch)
2010-10-11 05:12 EDT, Tomas Smetana
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0201 normal SHIPPED_LIVE file bug fix update 2012-02-20 09:53:52 EST

  None (edit)
Description Tomas Smetana 2010-10-11 05:11:31 EDT
+++ This bug was initially created as a clone of Bug #241848 +++

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.17-15.el5_3.1

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.

The issue can be easily reproduced using the files from the attachment 293705 [details].

Please note that the original RHEL-4 bug has been already closed with errata.
Comment 1 Tomas Smetana 2010-10-11 05:12:35 EDT
Created attachment 452665 [details]
Proposed patch
Comment 2 Jan Kaluža 2010-10-11 08:08:33 EDT
I've tested the patch and it fixes the bug.
Comment 3 RHEL Product and Program Management 2011-05-31 09:55:18 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 10 Jan Kaluža 2012-01-05 07:18:30 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: In some situation, gzip files can have the same beginning as FLC files. File tries to match FLC magic patterns before gzip magic patterns.

Consequence: This causes some gzip files are detected as FLC files.

Fix: Order of gzip and FLC magic patterns have been changed, because gzip magic pattern is longer and therefore stronger.

Result: File now tries to match gzip magic pattern before FLC magic pattern, so it detects gzip files properly.
Comment 11 errata-xmlrpc 2012-02-21 00:46:17 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0201.html

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