xdg-mime silently ignores invalid .desktop file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xdg-utils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I created an invalid ~/.local/
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name[en_AU]=mailto
Exec="mailto %f"
Name=mailto
I then set the default, and queried it:
$ xdg-mime default mailto.desktop 'x-scheme-
$ echo $?
0
$ xdg-mime query default 'x-scheme-
thunderbird.desktop
$ echo $?
0
As you can see, no error codes are returned, but the system default application is returned.
If I fix the mailto.desktop file by removing the quotes, the query performs as expected:
$ xdg-mime query default 'x-scheme-
mailto.desktop
Running in verbose mode doesn't give any further information, i.e., that the .desktop file was passed over in search because it was invalid:
$ # bad
$ XDG_UTILS_
Checking /home/duncan/
Checking /home/duncan/
Checking /home/duncan/
Checking /home/duncan/
Checking /usr/share/
Checking /usr/share/
Checking /usr/local/
Checking /usr/local/
Checking /usr/share/
thunderbird.desktop
$ # good
$ XDG_UTILS_
Checking /home/duncan/
mailto.desktop
ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: xdg-utils 1.1.3-2ubuntu1.
ProcVersionSign
Uname: Linux 5.8.0-50-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu50.5
Architecture: amd64
CasperMD5CheckR
Date: Wed Apr 28 12:39:08 2021
InstallationDate: Installed on 2020-11-03 (175 days ago)
InstallationMedia: Ubuntu 20.10 "Groovy Gorilla" - Release amd64 (20201022)
PackageArchitec
SourcePackage: xdg-utils
UpgradeStatus: No upgrade log present (probably fresh install)