I'm pasting from http://bugzilla.gnome.org/show_bug.cgi?id=136071 (which has two different patches to solve the problem) « The attached patch fixes a bug with the xdgmime code where any elf executable file would be sniffed as an application/x-core file. This happens because of a bug in xdgmimemagic.c when the magic for a mime type is composed of several 'indented' patterns. xdgmimemagic.c reads the patterns one by one, and each time it has read one pattern, it prepends them at the beginning of a list. With a file created from <match .... /> <- indent 0 <match ....> <- indent 0 <match ....> <- indent 1 <match ... /> <- indent 2 </match> </match> you'd have in memory a list composed of (pattern with indent 2), (pattern with indent 1), (pattern with indent 0), (pattern with indent 0) On the other hand, the code in _xdg_mime_magic_matchlet_compare_level assumes that the list it processes contains the parsed indented patterns in the same order as the magic file, which caused the misdetection of the mime type of those elf executables. I fixed that by mirroring the list of patterns, the place where I'm doing it may not be appropriate, but files in /bin are now properly identified as executable files. »
Created attachment 118 [details] [review] proposed patch
I committed this patch to gnome-vfs HEAD. So far it works fine on my two systems.
Applied, thanks.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.