! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Never execute anything
Status:
RESOLVED: DUPLICATE
Severity:
enhancement

Comments

Description torquil 2011-04-29 11:29:19 CEST
I would like an option in the Thunar preferences to disable execution of programs / scripts.

Right now Thunar executes my executable *.sh and *.py files when I double-click on them. I'd like Thunar to completely ignore that a file has the executable flag set. Those files would then instead be opened e.g. in a text editor.

I don't even need an "execute" option in the context menu for such files, since I never execute anything from the file manager.
Comment 1 bugzilla.5.kyoo 2011-06-03 05:01:06 CEST
I would like an option to disable the execution of programs/scripts *by default*.  I would use it.  However, I would like if there _was_ an execute option added to the context menu since I do run some scripts from the file manager.
Comment 2 bugzilla.5.kyoo 2011-06-03 05:02:41 CEST
s/added to/still in/
Comment 3 garry 2012-05-31 04:38:47 CEST
me too. 
Ive got Thunar 1.2.3 on Xubuntu 12.04.

Coming from gnome I forget all the time, and double click .sh & .py to edit them, but they run instead. I think it's quite dangerous default behaviour, the one thing that would put me back to nautilus.

Others here have asked for an option to disable execution. Fair enough. 

But 2 different comments:-

1) Right click, Properties, Permissions, untick "Allow this file to run as a program"    --> 2 seconds later, the tick comes back.   So if this constitues "option to disable execution", then it's another bug in itself.

2) rather than have developers solve this particular problem, (disable execution) is it ok to suggest that executable files be subject to the same right click menu options as .txt, .doc, .jpg. That is, 
    a)  right click, Properties, Open With
or
    b)  right click, Open with -> slide -> Open with other application

Or have I just failed to identify that it's already fixed? I'm not familiar with bug reporting.

regards Garry
Comment 4 Paul-Antoine Arras 2013-01-29 11:18:24 CET
The default behavior is quite annoying for developers spending most of their time editing executable scripts (shell, perl, or whatever) and running them in console.

Even if the default is not changed, please allow for the possibility of choosing to edit such files instead of executing them on double-clicking.
Comment 5 Xen2050 2014-02-04 03:41:09 CET
Created attachment 5350 
thunar-1.6.3 "Hack" to "Never execute anything", calls to thunar_launcher_execute_files changed to thunar_launcher_open_files

While working on bug 7596 ( https://bugzilla.xfce.org/show_bug.cgi?id=7596 ) I first tried this "hack" patch I've attached, to never execute any files. The "Execute" menu item still shows up but instead uses thunar_launcher_open_files.

I thought I'd post here anyway, just in case someone wants to build their own custom "Never execute anything" Thunar.
Actually a better way to accomplish this "never execute files" would probably be to change thunar_file_is_executable (in thunar-file.c) to always return false, like:

thunar_file_is_executable (const ThunarFile *file)
{
    return FALSE;
}

I do not recommend these "hacks" be integrated into Thunar since executing a file is a pretty important feature, but maybe a disable setting like a "kiosk mode" might be useful, adding to the start of thunar_file_is_executable something like "if (GlobalPrefNeverExecute) return FALSE;" might work.

For now I think the patch in bug 7596 is better, since it allows executing of other files, especially binaries, and stops automatically executing shellscripts unless you want to.
Comment 6 Harald Judt editbugs 2015-04-17 20:04:22 CEST
thunar-1.6.6 does no longer execute shell scripts, but opens them by default. This can be changed by a hidden option. As a future task, this will be improved by showing a dialog asking for the preferred behaviour. Not sure about the details yet.

Marking this as a duplicate of 9934.

*** This bug has been marked as a duplicate of bug 9934 ***

Bug #7554

Reported by:
torquil
Reported on: 2011-04-29
Last modified on: 2015-04-17

People

Assignee:
Jannis Pohlmann
CC List:
6 users

Version

Attachments

Additional information