Bug 2513837
| Summary: | brp-mangle-shebangs fails to detect executable text files with file 5.47 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Petr Sklenar <psklenar> |
| Component: | redhat-rpm-config | Assignee: | Miro Hrončok <mhroncok> |
| Status: | POST --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 45 | CC: | ajax, carlwgeorge, fche, ffesti, fweimer, igor.raits, j, lzaoral, mdomonko, mhroncok, ngompa13, nickc, packaging-team-maint, pbrobinson, pmatilai, sipoyare, torsava |
| Target Milestone: | --- | Flags: | fedora-admin-xmlrpc:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Petr Sklenar
2026-08-11 09:02:11 UTC
I agree that the current approach is fragile. Do we have a better alternative? For one, I think it'd be better to have it error out than just strip permissions with a warning that folks aren't going to notice in a noisy build. If you want files to have 644 permissions then install them that way instead of relying some script to maybe take care of it. Agreed on both points, but that would be a breaking change, and I don't have the capacity to drive that. And either way, we would still need to figure out how to make the detection less fragile (regardless of whether the detection is used to strip permissions or to fail the build). I'm thinking, are there any non-ELF files that should be executable, unless they have a proper shebang-line? Unlike arbitrary plaintext file types, ELF can be reliably detected, so if the logic is basically turned around to operate on everything non-ELF then it should be quite deterministic. Okay, there's /proc/sys/fs/binfmt_misc, but is such content being packaged, as executables? Even .exe files in Wine don't ship with executable bits, at least nowadays. > are there any non-ELF files that should be executable, unless they have a proper shebang-line? Not sure. Switching this that way would potentially be a backwards-incompatible change. > Okay, there's /proc/sys/fs/binfmt_misc, but is such content being packaged, as executables. Just the files I have installed on my workstation: Mono: - /usr/lib/mono/4.5/svcutil.exe → mono-web-6.12.0-21.fc43 - /usr/lib64/gnome-subtitles/gnome-subtitles.exe → gnome-subtitles-1.8-13.fc43 - /usr/lib64/gnome-subtitles/gstreamer-sharp.dll → gnome-subtitles-1.8-13.fc43 WebAssembly: - /usr/lib/node_modules/undici/lib/llhttp/llhttp.wasm → nodejs-undici-7.24.0-1.fc43 Python wheels: - /usr/share/python-wheels/pip-25.1.1-py3-none-any.whl → python-pip-wheel-25.1.1-18.fc43 - /usr/share/python-wheels/setuptools-78.1.1-py3-none-any.whl → python-setuptools-wheel-78.1.1-15.fc43 + Dozens of images and other data files that likely have bogus executable permissions. Interestingly, I was surprised to see the Python wheels are installed as 0755. Apparently, it's the default mode for the install command, so this is my own packaging mistake. A change like this will likely uncover dozens of other cases. I do not have the capacity to drive that change and fix all the packages (even though it is arguably a good thing). https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/367 (rawhide) https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/368 (f45) Using file --mime-encoding as a fix. |