Bug#1006189: /usr/bin/xdg-mime: `xdg-mime query default` blindly greps through .desktop files
Frédéric Brière
fbriere at fbriere.net
Sun Feb 20 21:46:47 GMT 2022
Package: xdg-utils
Version: 1.1.3-4.1
Severity: normal
File: /usr/bin/xdg-mime
Demonstrating under XFCE (though I think it affects all but KDE):
$ cat /usr/local/share/applications/foobar.desktop
[Desktop Entry]
# blah blah blah text/unreadable; blah x-scheme-handler/foo; blah blah blah
Name=FooBar
Type=Application
Exec=/bin/true
$ xdg-mime query default text/unreadable
foobar.desktop
$ xdg-mime query default x-scheme-handler/foo
foobar.desktop
Basically, search_desktop_file() just blindly greps through every
.desktop file, returning any that matches, regardless of context. That
is, erm, unexepected, to say the least. (It at least explains why
commenting out MimeType wasn't showing any effect.)
-- Package-specific info:
Desktop environment: XDG_CURRENT_DESKTOP=
-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'testing-debug'), (100, 'unstable-debug'), (100, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
xdg-utils depends on no packages.
Versions of packages xdg-utils recommends:
ii libfile-mimeinfo-perl 0.31-1
pn libnet-dbus-perl <none>
pn libx11-protocol-perl <none>
ii x11-utils 7.7+5
ii x11-xserver-utils 7.7+9
xdg-utils suggests no packages.
-- no debconf information
More information about the Pkg-freedesktop-maintainers
mailing list