Hide Forgot
# 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.
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
# 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.
Could you upload that file or at least first 4096 bytes or so?
Created attachment 541744 [details] proposed patch
*** Bug 766702 has been marked as a duplicate of this bug. ***
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.
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.
*** Bug 791343 has been marked as a duplicate of this bug. ***
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
*** Bug 861415 has been marked as a duplicate of this bug. ***