Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 758429 - file command incorrectly identifies a JPEG file as being a Minix filesystem
file command incorrectly identifies a JPEG file as being a Minix filesystem
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: file (Show other bugs)
5.5
All Linux
low Severity low
: rc
: 5.5
Assigned To: Jan Kaluža
BaseOS QE Security Team
:
Depends On:
Blocks: 771700 772019
  Show dependency treegraph
 
Reported: 2011-11-29 14:25 EST by Alan Staples
Modified: 2012-10-29 09:02 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Minix magic pattern has the same beginning as the JPEG magic pattern and File tries to match Minix magic pattern before JPEG. Consequence: This causes some JPEG files are detected as Minix filesystem. Fix: Order of JPEG and Minix magic patterns have been changed, because JPEG magic pattern is longer and therefore stronger. Result: File now tries to match JPEG magic pattern before Minix magic pattern, so it detects JPEG files properly.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-21 00:46:40 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)
2 JPEG image files - 1 normal and 1 that causes this issue (10.61 KB, application/x-gzip-compressed)
2011-11-29 14:25 EST, Alan Staples
no flags Details
proposed patch (433 bytes, patch)
2011-11-30 03:27 EST, Jan Kaluža
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 Alan Staples 2011-11-29 14:25:25 EST
Created attachment 538200 [details]
2 JPEG image files - 1 normal and 1 that causes this issue

Description of problem:
The "file" utility incorrectly identifies a JPEG file as being of type "Minix filesystem"

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 5 Update 5 64-bit
file-4.17-15.el5_3.1

How reproducible:
consistently, but only for some JPEG files

Steps to Reproduce:
1. extract the attached "jpeg_examples.tgz" file
2. copy extracted files to /tmp 
2. execute "file /tmp/funky.jpeg"
  
Actual results:
The utility outputs: "Minix filesystem, 30 char names"

Expected results:
The utility outputs: "JPEG image data, JFIF standard 1.01"

Additional info:
I've also included a "normal.jpeg" file within the attachment, which I have generated the same way as the attached "funky.jpeg", yet the file command works as expected on this JPEG.
Comment 2 Jan Kaluža 2011-11-30 03:27:06 EST
Created attachment 538461 [details]
proposed patch

Check JPEG before minix FS since JPEG pattern is stronger
Comment 5 Alan Staples 2011-12-01 09:40:25 EST
(In reply to comment #2)
> Created attachment 538461 [details]
> proposed patch
> 
> Check JPEG before minix FS since JPEG pattern is stronger

I tried "file -k" and indeed this does identify that the file is either a "Minix file system" or "JPEG image data, JFIF standard 1.01". I can parse the output of this command for "JPEG image data" systematically now. Thank you for your help.
Comment 10 Jan Kaluža 2012-01-05 06:37:44 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: Minix magic pattern has the same beginning as the JPEG magic pattern and File tries to match Minix magic pattern before JPEG.

Consequence: This causes some JPEG files are detected as Minix filesystem.

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

Result: File now tries to match JPEG magic pattern before Minix magic pattern, so it detects JPEG files properly.
Comment 11 errata-xmlrpc 2012-02-21 00:46:40 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.