Wrong handling of desktop entries with space in name #9834
Labels
affects-4.2
This issue affects Qubes OS 4.2.
C: app menu
The primary user-facing GUI application menu in Qubes OS
C: manager/widget
needs diagnosis
Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed.
P: default
Priority: default. Default priority for new issues, to be replaced given sufficient information.
Qubes OS release
Qubes OS 4.2
Brief summary
In a qube, a user creates a desktop entry with a space inside the name, like
xfce terminal.desktop
. The desktop entry is available in the settings of the qube but the resulting desktop entry in dom0 is truncated and thus, failing.Moreover, trying to run
/etc/qubes-rpc/StartApp
with the name result in unclear error messages.Steps to reproduce
In a qube (let's call it test-desktop-space), create a basic desktop entry, called
$HOME/.local/share/applications/xfce terminal.desktop
with this content:In dom0, try to get available entries:
Notice the wrong name. Now set the whitelist, to check the desktop entry created in dom0
In the qube, try to manually use
/etc/qubes-rpc/qubes.StartApp
:Now, while using quotes, the python script ends with a traceback error:
Expected behavior
The desktop entry spec doesn't allow spaces in desktop entry names, so it seems reasonable to fail. Nothing should be visible while trying to update the appmenu.
qubes.StartApp
should output only error messages with clear reasons.Actual behavior
Nothing in dom0, obscure errors in the qube.
Additional information
Changing line 13 of
qubes.StartApp
by this seems enough as for a non-quoted argumentIt's possible to add a basic check on line 17, like this:
But maybe it's better to handle this inside
qubesdb
?In
/etc/qubes-rpc/qubes.GetAppmenus
, replacing thefind
command by this could help:But still, the correct handling should happen in dom0. I tried to change the line 169 in
/usr/lib/python3.11/site-packages/qubesappmenus/receive.py
, in order to usere.match
instead ofre.search
but this may be very inefficient or naive?The text was updated successfully, but these errors were encountered: