Bug 435560

Summary: Executables always executed on launch irrespective of the kiorc setting for behaviourOnLaunch=
Product: [Plasma] plasmashell Reporter: popov895 <popov895>
Component: FolderAssignee: Eike Hein <hein>
Status: RESOLVED FIXED    
Severity: major CC: nate, plasma-bugs, popov895
Priority: HI    
Version: 5.21.3   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.23.2
Sentry Crash Report:

Description popov895 2021-04-09 22:05:27 UTC
SUMMARY

When "Open by double-clicking" option is enabled, double-clicking on a script file executes it, which is unsafe (the same for single-clicking, when that option is disabled). It is necessary to add an option (like in the Dolphin) that allows the user to choose what to do with the file being opened: execute, open in a text editor or always ask.

STEPS TO REPRODUCE

1. Create a script file on the desktop, for example:

> #!/bin/bash
> touch test.txt
2. Open it by double-clicking (or single-clicking, depending on whether the "Open by double-clicking" option is enabled or not)

OBSERVED RESULT

Script file is executed

EXPECTED RESULT

The user is asked for what to do with the script file

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: openSUSE Tumbleweed 20210406 / X11
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.15.2
Qt Version: 5.80.0
Comment 1 Nate Graham 2021-04-13 16:30:58 UTC
Can confirm. The value of behaviourOnLaunch= in ~/.config kiorc is ignored, unlike in Dolphin. It works in Dolphin when viewing ~/Desktop as well as desktop:// so it's not a problem of the desktop ioslave. Seems to be an issue in Folder View itself.

I'm guessing this is intentional, because users tend to put app shortcuts on their desktop and we don't want to badger them when they launch them. However this behavior acts on executables irrespective of whether they're .desktop files, shortcuts to .desktop files, appImages, shell scripts, Python files, etc.
Comment 2 Bug Janitor Service 2021-10-22 15:09:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/632
Comment 3 Nate Graham 2021-10-25 14:53:35 UTC
Git commit 085f9b7e520a5b5f921a5b9a353d20be73c3d4ad by Nate Graham, on behalf of Eugene Popov.
Committed on 25/10/2021 at 14:52.
Pushed by ngraham into branch 'Plasma/5.23'.

[Folder View] Fix executing file without prompting

When executing file without prompting, make sure it's a desktop file.

M  +2    -1    containments/desktop/plugins/folder/foldermodel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/085f9b7e520a5b5f921a5b9a353d20be73c3d4ad
Comment 4 Nate Graham 2021-10-25 14:55:24 UTC
Git commit 8a97cd487d01662f41d9ed2aecc4d867e4edf559 by Nate Graham, on behalf of Eugene Popov.
Committed on 25/10/2021 at 14:55.
Pushed by ngraham into branch 'master'.

[Folder View] Fix executing file without prompting

When executing file without prompting, make sure it's a desktop file.
(cherry picked from commit 085f9b7e520a5b5f921a5b9a353d20be73c3d4ad)

M  +2    -1    containments/desktop/plugins/folder/foldermodel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/8a97cd487d01662f41d9ed2aecc4d867e4edf559