Bug 2427330 - file command can't detect large ZIP archive's file type [NEEDINFO]
Summary: file command can't detect large ZIP archive's file type
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: 44
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Vincent Mihalkovič
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-01-06 05:22 UTC by Kazutoshi Morioka
Modified: 2026-09-01 04:04 UTC (History)
4 users (show)

Fixed In Version: file-5.48-3.fc46
Clone Of:
Environment:
Last Closed: 2026-09-01 04:04:44 UTC
Type: ---
Embargoed:
ferdnyc: needinfo? (vmihalko)


Attachments (Terms of Use)
a script to reproduce the bug (937 bytes, application/x-shellscript)
2026-01-06 05:26 UTC, Kazutoshi Morioka
no flags Details

Description Kazutoshi Morioka 2026-01-06 05:22:03 UTC
file command shipped with Fedora 43 can't detect large ZIP archive's file type.
If an archive is smaller than around 7MiB, file command says it's ZIP file.
But for a larger archive, file command says it's "data".
Fedora 41's file command did not have this problem.

Reproducible: Always

Steps to Reproduce:
1.Create ten 1MiB data files with dd bs=1MB count=1 if=/dev/urandom of=filename
2.Create a 10MiB ZIP archive contains that data files (with zip or 7za)
3.Inspect that zip archive with file command
Actual Results:
foobar.zip: data

Expected Results:
foobar.zip: Zip archive data, made by ...


Additional Information:
I wrote an attached shell script to reproduce this problem.
typical result is below

-rw-r--r--. 1 morioka morioka 5000892  1月  6 14:17 small7zaE7zaKq2Z.zip
-rw-r--r--. 1 morioka morioka 5001763  1月  6 14:17 smallzipE7zaKq2Z.zip
smallzipE7zaKq2Z.zip: Zip archive data, made by v3.0 UNIX, extract using at least v1.0, last modified, last modified Sun, Jan 06 2026 14:17:40, uncompressed size 0, method=store
small7zaE7zaKq2Z.zip: Zip archive data, made by v6.3 UNIX, extract using at least v2.0, last modified, last modified Sun, Jan 06 2026 14:17:40, uncompressed size 0, method=store
00000000: 504b 0304 0a00 0000 0000 3472 265c 0000  PK........4r&\..
00000000: 504b 0304 1400 0000 0000 3472 265c 0000  PK........4r&\..
-rw-r--r--. 1 morioka morioka 10003358  1月  6 14:17 largezip4NZF9Hb2.zip
-rw-r--r--. 1 morioka morioka 10003358  1月  6 14:17 largezip4NZF9Hb2.zip
largezip4NZF9Hb2.zip: data
large7za4NZF9Hb2.zip: data
00000000: 504b 0304 0a00 0000 0000 3472 265c 0000  PK........4r&\..
00000000: 504b 0304 1400 0000 0000 3472 265c 0000  PK........4r&\..

Comment 1 Kazutoshi Morioka 2026-01-06 05:26:11 UTC
Created attachment 2121248 [details]
a script to reproduce the bug

This script create these four ZIP archives, and check it with file command.
- created by zip command, about 5MiB size.
- created by 7za command, about 10MiB size.
- created by zip command, about 5MiB size.
- created by 7za command, about 10MiB size.

Comment 2 Kazutoshi Morioka 2026-01-11 04:51:24 UTC
F43's file command always fail to detect ZIP archive from STDIN.

Comment 3 "FeRD" (Frank Dana) 2026-07-03 06:16:16 UTC
This is still an issue with F44's File 5.46, but I believe it is fixed[1][2] in the subsequent File 5.47 and 5.48 releases. And the piping issue was explicitly fixed by another commit[3] that's also in 5.47 and 5.48.

The simplest solution would be updating File in Fedora 44 to the recent 5.48 release. Would it be possible to push out builds of 5.48 for F44?

Two commits improving zip detection in general:
[1]: https://github.com/file/file/commit/60b2032b96fc185b37fb0f2152e834efb2edad6e
[2]: https://github.com/file/file/commit/02846ac1e5c9d8154342c1680082e80d2faeadf8

And the piped-zip-file fix:
[3]: https://github.com/file/file/commit/f1adef05b8a85be50d28965b1fd21fcceacf7a4e

Comment 4 "FeRD" (Frank Dana) 2026-07-03 09:37:32 UTC
All:

I've made a Copr build of file 5.48 for F44 and F43 (all architectures except i386), you can find the packages here:

https://copr.fedorainfracloud.org/coprs/ferdnyc/file/build/10677931/

Or install them by running these commands in a terminal:

sudo dnf copr enable ferdnyc/file
sudo dnf upgrade file

(Answering 'y' to any confirmation prompts that come up.)

In my tests on Fedora 44, file 5.48 is once again able to identify Zip files correctly, that 5.46 lists only as 'data' — whether scanned by filename or through a pipeline via `cat somefile.zip | file -`.

Comment 5 Kazutoshi Morioka 2026-07-03 16:03:57 UTC
Thank you FeRD.
I installed file-5.48-0.1.fc43.x86_64 from copr, and it identified correctly all ZIP file I have.

Comment 6 "FeRD" (Frank Dana) 2026-07-10 01:27:18 UTC
Thanks for testing and confirming! Based on that, I've submitted a PR[1] to the project file repo, to update the rawhide branch. Along with a request to push new F44 and F43 builds as well.

[1]: https://src.fedoraproject.org/rpms/file/pull-request/46

Comment 7 Fedora Update System 2026-07-10 11:07:15 UTC
FEDORA-2026-412ea7bd7b (file-5.48-1.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-412ea7bd7b

Comment 8 Fedora Update System 2026-07-10 11:10:09 UTC
FEDORA-2026-24396f548e (file-5.48-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-24396f548e

Comment 9 Fedora Update System 2026-07-10 11:10:19 UTC
FEDORA-2026-f218bce1f9 (file-5.48-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-f218bce1f9

Comment 10 Fedora Update System 2026-07-11 01:33:48 UTC
FEDORA-2026-24396f548e has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-24396f548e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-24396f548e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2026-07-11 01:47:09 UTC
FEDORA-2026-f218bce1f9 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-f218bce1f9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-f218bce1f9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Adam Williamson (Red Hat non-Fedora) 2026-07-16 18:23:58 UTC
5.48 appears to break decompression of at least bzip2 and xz files. See https://bodhi.fedoraproject.org/updates/FEDORA-2026-412ea7bd7b#comment-4704886 .

Comment 13 "FeRD" (Frank Dana) 2026-07-16 20:57:55 UTC
(In reply to Adam Williamson from comment #12)
> 5.48 appears to break decompression of at least bzip2 and xz files. See
> https://bodhi.fedoraproject.org/updates/FEDORA-2026-412ea7bd7b#comment-
> 4704886 .

It didn't break. That wasn't working in 5.46 either.

Comment 14 "FeRD" (Frank Dana) 2026-07-16 21:02:24 UTC
Or, no, apparently I'm wrong about that.

https://bodhi.fedoraproject.org/updates/FEDORA-2026-24396f548e#comment-4704889

Comment 15 Fedora Update System 2026-08-31 19:54:00 UTC
FEDORA-2026-49eaa2233d (file-5.48-3.fc46) has been submitted as an update to Fedora 46.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-49eaa2233d

Comment 16 Fedora Update System 2026-09-01 00:49:59 UTC
FEDORA-2026-412ea7bd7b has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-412ea7bd7b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-412ea7bd7b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2026-09-01 01:05:39 UTC
FEDORA-2026-24396f548e has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-24396f548e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-24396f548e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2026-09-01 01:29:47 UTC
FEDORA-2026-f218bce1f9 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-f218bce1f9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-f218bce1f9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2026-09-01 04:04:44 UTC
FEDORA-2026-49eaa2233d (file-5.48-3.fc46) has been pushed to the Fedora 46 stable repository.
If problem still persists, please make note of it in this bug report.


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