Bug 856092

Summary: file detects netpbm files as x86 boot sector type sometimes
Product: Red Hat Enterprise Linux 5 Reporter: Iveta Wiedermann <isenfeld>
Component: fileAssignee: Jan Kaluža <jkaluza>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 884396 (view as bug list) Environment:
Last Closed: 2013-03-11 08:35:34 UTC Type: Bug
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: 884396    
Bug Blocks:    
Attachments:
Description Flags
Netpbm file - possible reproducer
none
Right reproducer
none
proposed patch none

Description Iveta Wiedermann 2012-09-11 08:03:24 UTC
Created attachment 611684 [details]
Netpbm file - possible reproducer

Description of problem:
Sometimes it happens that file detects netpbm files as "x86 boot sector" type. From test's outputs:

on x86_64
...

jpegtopnm-back-from-jpeg.ppm:              Netpbm PPM "rawbits" image data
lispmtopgm-back-from-lispm.pgm:            Netpbm PGM "rawbits" image data
macptopbm-back-from-macp.pbm:              Netpbm PBM "rawbits" image data
mdatopbm-back-from-mda.pbm:                x86 boot sector
mgrtopbm-back-from-mgr.pbm:                Netpbm PBM "rawbits" image data
mrftopbm-back-from-mrf.pbm:                Netpbm PBM "rawbits" image data

...

or 

on i386
...

hdifftopam-back-from-hdiff.pgm:            Netpbm PAM image file
hdifftopam-back-from-hdiff.ppm:            Netpbm PAM image file
icontopbm-back-from-icon.pbm:              x86 boot sector
ilbmtoppm-back-from-ilbm.ppm:              Netpbm PPM "rawbits" image data
jbigtopnm-back-from-jbig.pbm:              Netpbm PBM "rawbits" image data

...

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

How reproducible:
I was not able to reproduce this manually, it happens very rarely

Steps to Reproduce:
1. file mdatopbm-back-from-mda.pbm
2. or some other .pbm file
3.
  
Actual results:
x86 boot sector

Expected results:
Netpbm PBM "rawbits" image data

Additional info:

Comment 1 Jan Kaluža 2012-10-04 07:07:32 UTC
So it happens only sometimes for particular file? If it's broken, it should happen all the time.

File detects files as "x86 boot sector" if they have bytes 0xAA55 at offset 0x1FE. It's possible that those pbm files have these bytes there accidentally, but the file you attached does not have them there.

Comment 2 Iveta Wiedermann 2012-10-04 12:33:12 UTC
Yes, it happens only sometimes for different pbm files. I don't have access to that affected files, so it can't be checked, but I can try to run the test few times and see if it happens again and eventually get the affected file.

Comment 3 Iveta Wiedermann 2012-11-29 08:35:44 UTC
In another test round appeared this (x86_64 only):

mdatopbm-back-from-mda.pbm:         x86 boot sector, code offset 0x34

Comment 4 Jan Kaluža 2012-12-04 06:23:06 UTC
Could you get exactly that file and attach it here when it happens?

Comment 5 Iveta Wiedermann 2012-12-04 10:09:52 UTC
Created attachment 657391 [details]
Right reproducer

Finally after a few test rounds I've got the file to reproduce it.

Comment 6 Jan Kaluža 2012-12-05 09:45:38 UTC
Great, I'm able to reproduce it with this file.

Comment 7 Jan Kaluža 2012-12-05 11:30:05 UTC
Created attachment 658134 [details]
proposed patch

Comment 9 Jan Kaluža 2013-03-11 08:35:34 UTC
This won't be fixed in RHEL5, closing it as WONTFIX. There is still clone of this bug for RHEL6, which should be fixed in RHEL6 row.