Re: Mangling shebangs in text files: How to detect them, bug in the current implementation and possible solutions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



V Wed, Sep 22, 2021 at 12:47:07PM -0400, Steve Grubb napsal(a):
> I find the file utility to be almost reliable. It changes how it identifies ELF 
> files every couple releases. So, to stabilize this, fapolicyd-cli uses it's 
> own logic to determine what kind of ELF file it finds. I also regularly find 
> text/plain files where it cannot identify the language and files that are 
> application/octet-stream which are also misidentified.
> 
File's libmagic will always misdetect some files.

I'd like to see rpmbuild to prefer user.mime_type extended attribute over
libmagic guess. That way packagers could override the MIME type directly from
a spec file:

%install
setfattr -n 'user.mime_type' -v 'text/x-perl' %{buildroot}%{_bindir}/GET

If rpmbuild carried that attribute to RPM archive, rpm would set the attribute
when installing that package and it would become available to other tools like
fapolicyd-cli.

Technically we could patch libmagic to do that, but I feel that libmagic
upstream wouldn't like that. Maybe a place for an intermediate wrapper.

-- Petr

Attachment: signature.asc
Description: PGP signature

_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux