"xdg-settings check default-web-browser something.desktop" fails in Kubuntu 22.04: Bad substitution
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xdg-utils |
Fix Released
|
Unknown
|
|||
xdg-utils (Ubuntu) |
Fix Released
|
Medium
|
Olivier Tilloy | ||
Jammy |
Fix Released
|
Medium
|
Olivier Tilloy |
Bug Description
[Impact]
The firefox snap (default in 22.04) will always report that it thinks it's not the default browser (even when it actually is) for KDE users (this can be seen when browsing to about:preferenc
This is caused by an upstream bug in xdg-utils (using bashisms in KDE-specific functions whereas the default interpreter is dash).
The fix is rather trivial and will visibly improve the UX for those users.
[Test Plan]
In Kubuntu 22.04:
- make sure firefox isn't your default browser (by changing the setting to a different browser)
- run the firefox snap, browse to "about:preferenc
- click the "Set default" button
- refresh the page (F5)
- observe that now firefox claims to be the default browser
- in a terminal, execute `xdg-open https:/
[Where problems could occur]
The patch is changing KDE-specific functions (check_browser_kde and check_url_
If the proposed patch is incorrect, it would affect the functionality of `xdg-settings check default-
In the event of a regression, these functions wouldn't work as expected (they already don't, so the user wouldn't observe a functional regression, merely the absence of a fix).
[Original description]
I'm reporting this issue from stock Ubuntu, but the problem is observed only in Kubuntu (can be reliably reproduced in a Kubuntu 22.04 VM). The version of xdg-utils is identical.
This problem was initially reported on the snapcraft forum: https:/
$ xdg-settings check default-web-browser firefox_
/usr/
The offending line is:
if [ x"!" == x"${browser:0:1}" ]; then
If I modify /usr/bin/
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: xdg-utils 1.1.3-4.1ubuntu1
ProcVersionSign
Uname: Linux 5.15.0-27-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 27 11:21:31 2022
InstallationDate: Installed on 2020-09-16 (587 days ago)
InstallationMedia: Ubuntu 20.10 "Groovy Gorilla" - Alpha amd64 (20200910)
PackageArchitec
SourcePackage: xdg-utils
UpgradeStatus: Upgraded to jammy on 2022-03-19 (38 days ago)
Changed in xdg-utils (Ubuntu): | |
assignee: | nobody → Olivier Tilloy (osomon) |
status: | Confirmed → In Progress |
importance: | Undecided → Medium |
Changed in xdg-utils (Ubuntu Jammy): | |
status: | New → Confirmed |
assignee: | nobody → Olivier Tilloy (osomon) |
importance: | Undecided → Medium |
Changed in xdg-utils (Ubuntu Jammy): | |
status: | Confirmed → In Progress |
description: | updated |
Changed in xdg-utils: | |
status: | Unknown → New |
Changed in xdg-utils: | |
status: | New → Fix Released |
Can you try replacing the line with:
if [ x"!" == x"$(printf %.1s "$browser")" ]; then
and reverting back to dash? I think this might work in most posix shells, without requiring to move to bash.