Bug 856092 - file detects netpbm files as x86 boot sector type sometimes
file detects netpbm files as x86 boot sector type sometimes
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: file (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Jan Kaluža
BaseOS QE Security Team
Depends On:
Blocks: 884396
  Show dependency treegraph
Reported: 2012-09-11 04:03 EDT by Iveta Wiedermann
Modified: 2013-03-11 04:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 884396 (view as bug list)
Last Closed: 2013-03-11 04:35:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Netpbm file - possible reproducer (1.18 KB, image/x-portable-bitmap)
2012-09-11 04:03 EDT, Iveta Wiedermann
no flags Details
Right reproducer (1.38 KB, image/x-portable-bitmap)
2012-12-04 05:09 EST, Iveta Wiedermann
no flags Details
proposed patch (2.18 KB, patch)
2012-12-05 06:30 EST, Jan Kaluža
no flags Details | Diff

  None (edit)
Description Iveta Wiedermann 2012-09-11 04:03:24 EDT
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



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):

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
Actual results:
x86 boot sector

Expected results:
Netpbm PBM "rawbits" image data

Additional info:
Comment 1 Jan Kaluža 2012-10-04 03:07:32 EDT
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 08:33:12 EDT
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 03:35:44 EST
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 01:23:06 EST
Could you get exactly that file and attach it here when it happens?
Comment 5 Iveta Wiedermann 2012-12-04 05:09:52 EST
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 04:45:38 EST
Great, I'm able to reproduce it with this file.
Comment 7 Jan Kaluža 2012-12-05 06:30:05 EST
Created attachment 658134 [details]
proposed patch
Comment 9 Jan Kaluža 2013-03-11 04:35:34 EDT
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.

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