Bug 688136

Summary: A Korean text file is classified as a DOS executable file
Product: Red Hat Enterprise Linux 6 Reporter: Radek Bíba <rbiba>
Component: fileAssignee: Jan Kaluža <jkaluza>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 6.0CC: dapospis, ksrot, mfojtik, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: file-5.04-12.el6 Doc Type: Bug Fix
Doc Text:
Previously, the file utility contained "magic" patterns that incorrectly detected files according to one byte only. Unicode text files starting with that particular byte could be therefore incorrectly recognized as DOS executable files. This update removes the problematic patterns. Patterns that match less than 16 bits are no longer accepted, and the utility no longer detects Unicode files as DOS executables.
Story Points: ---
Clone Of:
: 826901 (view as bug list) Environment:
Last Closed: 2012-03-15 08:23:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 826901    
Attachments:
Description Flags
proposed patch none

Description Radek Bíba 2011-03-16 12:39:28 UTC
Description of problem:
Package java-1.6.0-ibm contains a file that's identified as a 'DOS executable (COM)' by file(1). In fact it's a text file with Korean characters.

Version-Release number of selected component (if applicable):
file-5.04-6.el6

How reproducible:
Always with the given file.

Steps to Reproduce:
1. Install java-1.6.0-ibm (from RHEL Supplementary). At least 1.6.0.9.1-1jpp.1.el6
2. Run: file /usr/share/doc/java-1.6.0-ibm-1.6.0.9.1/docs/content/ko/license_ko.txt
  
Actual results:
/usr/share/doc/java-1.6.0-ibm-1.6.0.9.1/docs/content/ko/license_ko.txt: DOS executable (COM)

Expected results:
something like "text"

Additional info:
I'm not sure if I may attach the "reproducer" to this bug report; it comes from a specially licensed package. I'll do so if I find out that it's legal.

Comment 1 Jan Kaluža 2011-03-22 09:05:10 UTC
Created attachment 486755 [details]
proposed patch

This patch removes generic pattern which is causing the problem. New upstream policy is to not accept patterns which match less than 16 bits, so upstream should accept this pattern too.

Comment 9 Jan Kaluža 2012-02-09 06:15:15 UTC
    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: File contained weak magic patterns which were detecting file just according to one byte.

Consequence: Some unicode text files starting with that particular byte have been misdetected as "DOS execuatable file".

Fix: Weak magic patterns causing that misdetection have been removed.

Result: File does not misdetect unicode files as DOS executable file.

Comment 12 Karel Srot 2012-02-14 10:10:55 UTC
seems not to be fixed

$ rpm -q file
file-5.04-12.el6.x86_64
$ file license_ko.txt 
license_ko.txt: DOS executable (COM)

Comment 16 errata-xmlrpc 2012-03-15 08:23:22 UTC
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-0391.html