Bug 747999 - recognize lzma-compressed files
Summary: recognize lzma-compressed files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: file
Version: 6.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jan Kaluža
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
: 766702 791343 861415 (view as bug list)
Depends On:
Blocks: 809801
TreeView+ depends on / blocked
 
Reported: 2011-10-21 16:53 UTC by Dennis Gregorovic
Modified: 2018-11-28 21:23 UTC (History)
12 users (show)

Fixed In Version: file-5.04-12.el6
Doc Type: Bug Fix
Doc Text:
Previously, the file utility did not contain a "magic" pattern for detection of files compressed using the LZMA algorithm. As a consequence, the file utility was unable to detect these files. This update adds the missing "magic" pattern, and LZMA compressed files are now detected as expected.
Clone Of:
: 809801 (view as bug list)
Environment:
Last Closed: 2012-03-15 08:23:42 UTC
Target Upstream Version:


Attachments (Terms of Use)
proposed patch (611 bytes, patch)
2011-12-07 07:39 UTC, Jan Kaluža
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Legacy) 65855 0 None None None Never
Red Hat Product Errata RHBA-2012:0391 0 normal SHIPPED_LIVE file bug fix update 2012-03-15 12:23:01 UTC

Description Dennis Gregorovic 2011-10-21 16:53:39 UTC
# rpm -q xz
xz-4.999.9-0.3.beta.20091007git.el6.x86_64
# echo foo > bar
# xz -c bar > bar2
# file bar2
bar2: xz compressed data
# xz -c --format=lzma bar > bar2
# file bar2
bar2: data

When using native format, file is able to correctly determine the file type.  When using lzma, it doesn't work.

Comment 1 Jan Kaluža 2011-10-24 09:49:02 UTC
This can be fixed by backporting this magic pattern from file-5.07:

0  lelong    0x8000005d    LZMA compressed data,
>5  lequad    =0xffffffffffffffff  streamed
>5  lequad    !0xffffffffffffffff  non-streamed, size %lld
!:mime  application/x-lzma

Comment 3 Alexander Todorov 2011-11-02 13:37:10 UTC
# file /boot/initr*
/boot/initramfs-2.6.32-214.el6.x86_64.img:      gzip compressed data, from Unix, last modified: Wed Nov  2 09:16:38 2011, max compression
/boot/initrd.img:                               data


initrd.img is the initrd ued by anaconda.

Comment 4 Jan Kaluža 2011-11-02 14:08:05 UTC
Could you upload that file or at least first 4096 bytes or so?

Comment 9 Jan Kaluža 2011-12-07 07:39:47 UTC
Created attachment 541744 [details]
proposed patch

Comment 10 Jan Kaluža 2011-12-13 07:47:20 UTC
*** Bug 766702 has been marked as a duplicate of this bug. ***

Comment 14 Jan Kaluža 2012-02-09 06:24:50 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 did not contain magic pattern for LZMA detection.

Consequence: LZMA compresses files have not been detected.

Fix: Magic pattern for LZMA compression has been added.

Result: File now detects LZMA compressed files as expected.

Comment 16 Michal Fojtik 2012-02-13 12:54:40 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1 @@
-Cause: File did not contain magic pattern for LZMA detection.
+Previously, the file utility did not contain a "magic" pattern for detection of files compressed using the LZMA algorithm. As a consequence, the file utility was unable to detect these files. This update adds the missing "magic" pattern, and LZMA compressed files are now detected as expected.-
-Consequence: LZMA compresses files have not been detected.
-
-Fix: Magic pattern for LZMA compression has been added.
-
-Result: File now detects LZMA compressed files as expected.

Comment 17 Jan Kaluža 2012-02-17 06:16:17 UTC
*** Bug 791343 has been marked as a duplicate of this bug. ***

Comment 19 errata-xmlrpc 2012-03-15 08:23:42 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

Comment 22 Jan Kaluža 2012-11-20 10:02:49 UTC
*** Bug 861415 has been marked as a duplicate of this bug. ***


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