Nautilus should allow execution of arbitrary files with execute bit set

Bug #204324 reported by Kenneth P. Turvey on 2008-03-20
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Nautilus
New
Medium
nautilus (Ubuntu)
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: nautilus

Under linux any file may be executable using the binfmt-misc feature of the kernel. This should mean that when I double click on a file in nautilus that is executable, nautilus should allow me to execute it even if it doesn't fit into the normal definition of what an executable file is. That's why we have the execute bit. This is complicated by the matter that some file systems will show all files with an execute bit, so this must be customizable. I have a few suggestions for how this could work:

1) Actually check to see if the file is executable by the kernel
2) Allow users to select "execute if executable bit set" when setting up associations (this would be the easiest to do).
3) When in doubt ask the user (this would get annoying).
4) Try executing the file by default and if that fails do something else that is reasonable.

This really is a bug and not a feature request. On my system jar files are executable. Under nautilus jar files are opened by the archive program without any option to execute them even when the execute bit is set. If I can type in the name of a program on the command line and have it execute, I should be able to double click on it in Nautilus too.

There is a simple work around for .jar files since one can associate them with the java runtime based on extension, but many other formats supported by binfmt-misc don't have simple workarounds. The execute bit should mean the same thing in a GUI that it means on the command line.
kt@lovelace:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.04
DISTRIB_CODENAME=feisty
DISTRIB_DESCRIPTION="Ubuntu 7.04"

Kenneth P. Turvey (ktectropy) wrote :

Another reason this is a bug is due to the way nautilus will handle files that are not executable but have the correct extension.

For example, on my system I've set up an association for jar files to be executed by the jvm. This is great if the jar file is intended to be executed. It works just like I requested above. Unfortunately it does the same thing for jar files that are not intended to be executed and don't have the execute bit set. What should happen in this case is that the file should be opened by the archive manager. Not all jar files are suitable for direct execution by the JVM. The way to differentiate them on systems with binfmt-misc installed is by looking at the execute bit.

Changed in nautilus:
status: New → Confirmed
Changed in nautilus:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: Confirmed → Triaged
Changed in nautilus:
status: Unknown → New
Yfrwlf (yfrwlf) wrote :

I'm assuming binfmt-misc is standard and is in Ubuntu by default and is the way the kernel executes files. If so, I also am experiencing this, and I would guess that the easiest solution for a quick fix would be to have "Run" be a special option that's always available for executable files. I assume it's also what you'd normally want as the default option, but preferences could be set based on file type. For example, if you wanted all executable BIN files to be run, but all executable SH files to be opened in GEdit, that seems like that should be doable, though I don't know how much Nautilus pays attention to the extensions as it tries to see what the actual file type is regardless of it's name, which is a great feature. Any way, at the very least, making "Run" be an option for all executable files would be nice.

I think this is the way it used to be, too, in earlier versions of Ubuntu, so perhaps this is a problem with the new GVFS being used? Anyone else have this problem?

I have a bin file, Google Earth to be specific, and when I click on it it says could display because location isn't a folder, and when right clicking the only option is "Open with 'Open Folder'". I've seen this problem with other executables as well. I just tried it on another computer with 8.04, and it keeps the only options available as the options for opening the file normally, nothing is changed when you make it executable except that it views the file type as a "program" in the file properties.

Any way, yeah this would be a nice bug to see fixed so that installing stuff is easier for those who don't know how to run something via the command line. ^^

Changed in nautilus:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.