apx icon indicating copy to clipboard operation
apx copied to clipboard

Insufficiently escaped space-containing file path in generated .desktop file

Open michal-kurz opened this issue 1 year ago • 1 comments

I am not sure if this is a fault with apx, but it may be. Sorry if it's not, just close the issue then.

I installed the .deb package of Mullvad VPN client via sudo apt install ./mullvad.deb, and the following .desktop file was generated for it:

[Desktop Entry]
Name=Mullvad VPN on vso-pico
Exec=/usr/share/apx/distrobox/distrobox-enter  -n apx-vso-pico -- /bin/sh -l -c  "/opt/Mullvad VPN/mullvad-vpn"  %U
Terminal=false
Type=Application
Icon=mullvad-vpn
StartupWMClass=Mullvad VPN
Comment=Mullvad VPN client
Categories=Network;

When trying to run the app, it fails trying to locate /opt/Mullvad - the space in the Mullvad VPN folder name is not properly escaped. Wrapping the path into an extra pair of single quotes resolves this: /bin/sh -l -c "'/opt/Mullvad VPN/mullvad-vpn'" %U.

Not sure if this is problem with apx not escaping the path sufficiently, or with something else.

michal-kurz avatar Feb 06 '24 03:02 michal-kurz

I'm not familiar with VanillaOS; however, from reading this issue, the problem might be with the distrobox-enter command. Before 1.4.2.1 they suggest in their docs to "use single quotes around your double quotes". But for future versions this was no longer necessary because of this PR.

This seems to exactly match the problem you are having, but seeing that apx is using distrobox v1.6.0.1 this might not be the case (unless if distrobox-enter regressed after some time).

kemzeb avatar Mar 11 '24 06:03 kemzeb