Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 747999

Summary: recognize lzma-compressed files
Product: Red Hat Enterprise Linux 6 Reporter: Dennis Gregorovic <dgregor>
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.2CC: atodorov, aupadhye, dapospis, jcpunk, ksrot, mfojtik, mishu, mrogers, msuchy, ovasik, pneedle, rdassen
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 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.
Story Points: ---
Clone Of:
: 809801 (view as bug list) Environment:
Last Closed: 2012-03-15 08:23:42 UTC Type: ---
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:    
Bug Blocks: 809801    
Attachments:
Description Flags
proposed patch none

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. ***