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.
Created attachment 538461 [details] proposed patch Check JPEG before minix FS since JPEG pattern is stronger
(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.
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.
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