Bug 423645

Summary: Launching AppImage files containing spaces fails silently
Product: [Frameworks and Libraries] frameworks-kio Reporter: Bernie Innocenti <bernie>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs
Priority: NOR    
Version: 5.71.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.72

Description Bernie Innocenti 2020-06-29 09:21:15 UTC
SUMMARY

Looks like we have a shell escaping issue somewhere (dolphin / plasmashell / frameworks-krunner...)

STEPS TO REPRODUCE
1. Download any AppImage file to the Desktopp (example: https://www.x-plane.com/desktop/try-it/)
2. Make sure the filename contains a space
3. Double-click on the icon on the desktop

OBSERVED RESULT
 - Desktop folder view: nothing happens
 - Dolphin: asks if the file should be executed, then silently fails

The plasmashell log shows:

  /bin/sh: /home/bernie/Desktop/X-Plane: No such file or directory

Furthermore, Dolphin asks if the file should be executed, but the desktop does not.
This inconsistency is a separate bug.

EXPECTED RESULT
Should execute the app *OR* report an error

SOFTWARE/OS VERSIONS
KDE Plasma Version: built from git
KDE Frameworks Version: 5.71
Qt Version: 5.15.0
Comment 1 Bernie Innocenti 2020-06-29 09:47:32 UTC
Fixed by https://invent.kde.org/frameworks/kio/-/merge_requests/69
Comment 2 Ahmad Samir 2020-06-29 09:59:32 UTC
Git commit 8d6b306f585920230acecd19903325f6f0387b8e by Ahmad Samir, on behalf of David Faure.
Committed on 29/06/2020 at 09:58.
Pushed by ahmadsamir into branch 'master'.

OpenUrlJob: fix support for shell scripts with a space in the filename

When executing a shell script or an executable in dolphin in a folder with a blank
e.g. "/my test/test.sh" the path was truncated to "/my" and the command was not executed.

Document the API trap.
Related: bug 423412
FIXED-IN: 5.72

M  +2    -0    src/gui/commandlauncherjob.h
M  +1    -1    src/gui/openurljob.cpp

https://invent.kde.org/frameworks/kio/commit/8d6b306f585920230acecd19903325f6f0387b8e
Comment 3 Bernie Innocenti 2020-06-29 10:20:56 UTC
Thanks for the fast fix!

I'll file a separate bug for this part:

 Furthermore, Dolphin asks if the file should be executed, but the desktop does not.
 This inconsistency is a separate bug.
Comment 4 Bernie Innocenti 2020-06-29 10:36:44 UTC
Done: https://bugs.kde.org/show_bug.cgi?id=423646