Bug 688136 - A Korean text file is classified as a DOS executable file
Summary: A Korean text file is classified as a DOS executable file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: file
Version: 6.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 826901
TreeView+ depends on / blocked
 
Reported: 2011-03-16 12:39 UTC by Radek Bíba
Modified: 2012-11-05 15:45 UTC (History)
4 users (show)

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.
Clone Of:
: 826901 (view as bug list)
Environment:
Last Closed: 2012-03-15 08:23:22 UTC
Target Upstream Version:


Attachments (Terms of Use)
proposed patch (2.94 KB, patch)
2011-03-22 09:05 UTC, Jan Kaluža
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0391 0 normal SHIPPED_LIVE file bug fix update 2012-03-15 12:23:01 UTC

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


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