Bug 2513643 - file 5.47 misclassifies systemd unit files as application/x-wine-extension-ini
Summary: file 5.47 misclassifies systemd unit files as application/x-wine-extension-ini
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: 45
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vincent Mihalkovič
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-08-10 20:03 UTC by Petr Sklenar
Modified: 2026-09-16 00:15 UTC (History)
3 users (show)

Fixed In Version: file-5.48-3.fc46 file-5.48-3.fc45
Clone Of:
Environment:
Last Closed: 2026-09-01 04:04:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Petr Sklenar 2026-08-10 20:03:50 UTC
Description of problem:
file 5.47 classifies systemd .service/.socket/.timer files as
"application/x-wine-extension-ini" instead of "text/plain".

This breaks brp-mangle-shebangs which relies on "text/" mime type to detect
executable text files without shebangs and remove the executable bit.
As a result, packages built with file 5.47 ship systemd unit files with
mode 0755 instead of 0644, violating Fedora Packaging Guidelines for Systemd.

At least 21 packages in F45 rawhide are affected.

Version-Release number:
file-5.47-3.fc45.x86_64

How reproducible: Always

Steps to Reproduce:
1. Create a systemd unit file:
   echo -e "[Unit]\nDescription=Test\n[Service]\nExecStart=/usr/bin/true" > /tmp/test.service

2. Check mime type:
   file --mime-type /tmp/test.service

Actual Results:
/tmp/test.service: application/x-wine-extension-ini

Expected Results:
/tmp/test.service: text/plain

(as file 5.46 correctly reports)

Additional info:
The generic INI detection rule added in file 5.47 matches [Section] headers
in systemd unit files. This causes brp-mangle-shebangs to skip these files
because it only greps for "text/" mime types.

Downstream impact: packages built on F45 have wrong permissions on unit files.
See BZ#2512037, BZ#2512038, BZ#2513497 for affected packages.

Tested on VM with Fedora-Workstation-Live-Rawhide-20260807.n.0.x86_64.iso

-----
[ : file starting [Unit] -> application/x-wine-extension-ini

Comment 1 Lukáš Zaoral 2026-08-11 08:42:14 UTC
I won't speak for the maintainer since this is regression that should be fixed.

Nonetheless, isn't there a different tool that you could use for the brp-mangle-shebangs script?  One that only detects text/* mime types?  file, in general, is very brittle and every major release causes some regressions due to the way the detection is implemented so it's output is more or less informative but nothing more.

Comment 2 Petr Sklenar 2026-08-11 09:04:46 UTC
(In reply to Lukáš Zaoral from comment #1)
> I won't speak for the maintainer since this is regression that should be
> fixed.
> 
> Nonetheless, isn't there a different tool that you could use for the
> brp-mangle-shebangs script?  One that only detects text/* mime types?  file,
> in general, is very brittle and every major release causes some regressions
> due to the way the detection is implemented so it's output is more or less
> informative but nothing more.

I have created now : https://bugzilla.redhat.com/show_bug.cgi?id=2513837

Comment 3 Vincent Mihalkovič 2026-08-17 22:20:30 UTC
From mailing list discussion:
"This was so problematic that it was reverted in commit f37cc42c on March 25,
2026, explicitly because it “matches too many unix stanza files.”

What appears to have happened, is commit 7a1ada9c landed Sept 6,2025.
File-5.47 was released Feb 27. Complaints and it was reverted in March as
noted. Then June 8, 2026 file 5.48 was released. If we just update to the
latest, this problem goes away." Steve Grubb





I'm working on an update to 5.48 right now.

Comment 4 Peter Robinson 2026-08-18 09:35:39 UTC
It appears you did an update in the past to 5.48 in the past and it was unpushed because of problems:

https://bodhi.fedoraproject.org/updates/FEDORA-2026-f218bce1f9
https://bodhi.fedoraproject.org/updates/FEDORA-2026-412ea7bd7b
https://bodhi.fedoraproject.org/updates/FEDORA-2026-24396f548e

Please make sure you take that feedback into account as well.

Comment 5 Vincent Mihalkovič 2026-08-18 10:22:13 UTC
Yes, waiting for upstream to merge the regression fix.

Comment 6 Fedora Update System 2026-08-31 19:53:58 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 7 Fedora Update System 2026-08-31 20:35:22 UTC
FEDORA-2026-f218bce1f9 (file-5.48-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-f218bce1f9

Comment 8 Fedora Update System 2026-08-31 20:35:32 UTC
FEDORA-2026-24396f548e (file-5.48-2.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-24396f548e

Comment 9 Fedora Update System 2026-08-31 20:35:40 UTC
FEDORA-2026-412ea7bd7b (file-5.48-3.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-412ea7bd7b

Comment 10 Fedora Update System 2026-09-01 00:50:01 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 11 Fedora Update System 2026-09-01 01:05:41 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 12 Fedora Update System 2026-09-01 01:29:50 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 13 Fedora Update System 2026-09-01 04:04:46 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.

Comment 14 Fedora Update System 2026-09-16 00:15:12 UTC
FEDORA-2026-412ea7bd7b (file-5.48-3.fc45) has been pushed to the Fedora 45 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.