Bug 101667

Summary: Remove *.bin from application/octet-stream
Product: shared-mime-info Reporter: David Faure <faure>
Component: freedesktop.org.xmlAssignee: Shared Mime Info group <shared_mime_info>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: AntonioJPFernandes+b.fd.o, bugseforuns, dark.shadow4
Version: unspecified   
Hardware: Other   
OS: All   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=571377
Whiteboard:
i915 platform: i915 features:

Description David Faure 2017-07-01 12:26:13 UTC
Since the first glob is often used as the default extension when saving, having "*.bin" in application/octet-stream leads to file dialogs automatically adding a ".bin" extension when apps try to have some "all files" filter.

In addition I see no purpose in this glob for matching (given that application/octet-stream is the fallback anyway).
Comment 1 Bastien Nocera 2017-07-17 21:59:35 UTC
(In reply to David Faure from comment #0)
> Since the first glob is often used as the default extension when saving,
> having "*.bin" in application/octet-stream leads to file dialogs
> automatically adding a ".bin" extension when apps try to have some "all
> files" filter.
> 
> In addition I see no purpose in this glob for matching (given that
> application/octet-stream is the fallback anyway).

application/octet-stream isn't the same as "any" mime-type though, is it?

I don't know the side-effects it could have on the detection, or the negative detection of the mime-types that do use *.bin as a glob, depending on the implementation.
Comment 2 António Fernandes 2017-08-16 11:40:53 UTC
This bug affects nautilus via gio's function g_content_type_can_be_executable. See https://bugzilla.gnome.org/show_bug.cgi?id=571377

(In reply to Bastien Nocera from comment #1)
> I don't know the side-effects it could have on the detection, or the
> negative detection of the mime-types that do use *.bin as a glob, depending
> on the implementation.
Currently, if we rename a files to remove the .bin extension, it's type can be detected more precisely. By classifying *.bin as octet-stream, the more precise detection seems to be bypassed.

To test, add ".bin" to the name of an "application/x-executable" file. It becomes "application/octet-stream". As a consequence, it's no longer identified as potentially executable by g_content_type_can_be_executable. While this test is artificial, there are real applications shipped with a *.bin binary mean to be launched[*]. This becomes an actual user-facing bug in a file manager.

[*] Yes, this is wrong and they should use .desktop files and ship a proper .flatpak bundle for instance. But it's just an example.
Comment 3 David Faure 2018-01-28 09:37:53 UTC
Done in 009f22a.

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.