! 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 !
No option to make file executable in permissions tab
Status:
RESOLVED: FIXED
Severity:
enhancement

Comments

Description john lovely 2007-09-14 23:36:18 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)
Build Identifier: 

Select a file, open right click menu, select Properties, select Permissions Tab.
There are only options to set read/write permissions. There is no check box for making the file executable as in nautilus. 

You should be able to do anything in a GUI, but with Thunar you still have to open a terminal and chmod +x filename.

Reproducible: Always

Steps to Reproduce:
1. open Thunar
2. display a directory 
3. select a file
4. select Properties from Right Click menu
5. select Permissions Tab
6. open and close all combo boxes looking for option to make file executable
7. Give up because its not there.
8. try help file... but thats another bug.

Actual Results:  
option doesn't exist 

Expected Results:  
a check box to make the selected file executable would be prominently displayed in the permissions tab
Comment 1 Benedikt Meurer editbugs 2007-11-28 19:50:22 CET
The "executable" check box is displayed only for file types where the executable bit actually makes sense (executables, scripts, etc.).
Comment 2 john lovely 2007-12-01 06:42:02 CET
The executable check box is NOT displayed for executables - thats why I reported the bug. The files were definitely executables and after changing the permissions in a terminal window, I was able to execute them.

It may be that the bug should be changed to read that thunar does not recognise executable fiiles and so does not display the make executable option.
Comment 3 Benedikt Meurer editbugs 2007-12-01 11:47:06 CET
Right, and in that case, it's not a bug in Thunar, but in the shared-mime-info package.
Comment 4 john lovely 2007-12-16 12:57:57 CET
Whether the error is in mime or thunar - its thunar that doesn't work.

This is the fix: 

This bugreport exists because I've NEVER seen the check box to make a file executable. So 
1. The Interface is wrong - the check box should be displayed at all times so that people know it exists. Disable it if a file is NOT executable.  This covers the first problem. 
2. By enabling the check box by default, this solves the second problem of bugs in the mime info package. If you KNOW the file is NOT executable disable the checkbox but then unrecognised files (eg sun JDK and Netbeans installers - multi platform programs such as these are often packaged as executable installers rather than as rpm/deb so that the install process is similar to M$ Windows installers) can be made executable by the user (who usually is a lot smarter than the operating system and CAN pick an executable file)
Comment 5 Ryan Armstrong 2011-08-07 13:41:58 CEST
Nothing on this bug since 2007? This is still an issue. For instance, if I download the Braid Linux Installer from Humble Indie Bundle 2/3, I have no option in Thunar to set it executable. From the terminal, if I type "file braid-linux.run.bin " I get:

braid-linux.run.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped

Another important use case for the Executable bit is Wine. The typical Wine application helper that runs when you double click a .EXE file will only run if the file is marked executable. The "file" command identifies these as:

Raptor.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit

I have only ever seen the executable checkbox work for scripts. Unless the sanity checks become robust enough to cover all use cases, I suggest simply making the option available for every file.
Comment 6 Alex Henrie 2011-09-16 22:46:56 CEST
Created attachment 3865 
Patch

I had this problem trying to install the MPLAB IDE from microchip.com under WINE on Xubuntu. When I tried to run setup.exe, I got a "Blocked: wine start /unix" dialog. I went to add execution permissions to the file and Thunar wouldn't let me. This is a big problem because the beginning Xubuntu user doesn't know how to use chmod +x to change file permissions and it would be very easy to become frustrated.

The "Allow this file to run as a program" checkbox already appears for the MIME types application/x-executable and application/x-shellscript. I wrote a patch which makes the checkbox appear in the following additional circumstances:
- Files of type application/x-ms-dos-executable
- Files of type application/x-msi
- Files which already have the execute bit, even if they're not the kind of file which ought to. This lets you at least remove the execute bit from a file which shouldn't have it, but it won't let you add it back afterwards through the GUI.

This was a pretty simple fix for a pretty frustrating problem, and I'd love to see it accepted into Thunar. Please let me know what you think and if you'd like me to make any changes.
Comment 7 Jannis Pohlmann editbugs 2011-09-16 23:52:20 CEST
I agree with Benny and I would prefer to only display the check box for files that can be executed at all. However, I wonder if we should add more MIME types to the list for which the check box is displayed though, like "application/x-msi" and "application/x-ms-dos-executable" (as suggested by Alex), maybe "application/x-binary" to cover .bin files. 

If the answer is "yes please!" we have another problem. Ideally, the file types Thunar allows to execute (by double-clicking) should be consistent with this check box. I'm currently not up-to-date what the security concerns are in this regard, but this may require a bit more thinking.

For now I'd be fine with showing the check box for additional types. 

@Alex: Your patch looks ok except for three things:

1. you're not allowed to declare variables in the middle of a function, you need to do it at the top of the scope (which is the function in this case),

2. relying on the mode is not a good idea as its only available on UNIX; rather use something like

  GFileInfo *info;
  gboolean   file_is_executable = FALSE;

  info = thunar_file_get_info (file);
  if (info != NULL)
    {
      if (g_file_info_get_attribute_boolean (G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE))
        fil_is_executable = TRUE;
    }

3. the ability to clear the executable bit sounds nice but it leads to weird behavior: as soon as the bit is cleared for a "non-executable" file, the check box will disappear and people will think "H?! WHAT?!". So I'd rather not show the check box for files we do not consider to be executable at all.
Comment 8 Alex Henrie 2011-09-17 00:58:19 CEST
Created attachment 3866 
Patch v2

Okay. Here is a new (less ambitious) patch that only adds "application/x-ms-dos-executable" and "application/x-msi" to the list. I didn't have any trouble executing these kinds of files by double-clicking, perhaps because they opened with WINE.

To test the behavior with .bin files, I downloaded RealPlayer11GOLD.bin from realplayer.softonic.com. The output of "file RealPlayer11GOLD.bin" was:

RealPlayer11GOLD.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped

I found that Thunar considers this file to have the MIME type "application/octet-stream". This is (to my knowledge) the most generic MIME type there is, so I don't think you'd want to add it to the list. Perhaps a more sophisticated system than looking at the MIME type is needed. For now I would be content with just adding the two Windows file types mentioned above.
Comment 9 Jannis Pohlmann editbugs 2011-09-17 01:13:15 CEST
@Alex: That was quick. And Yeah, application/octet-stream is nothing we want to add there. Anyway, I applied your fix to master, xfce-4.8 will follow:

commit cfab3c6a3b7ad714fc3fe67e84bf0d3b1fc6d4b1
Author: Jannis Pohlmann <jannis@xfce.org>
Date:   Sat Sep 17 01:08:02 2011 +0200

    Allow exec bit of MS-DOS executables and MSI to be changed (bug #3545).
    
    Patch by Alex Henrie<alexhenrie24@gmail.com>.

I'm leaving the bug open though, in case other MIME types are still missing.
Comment 10 Alex Henrie 2011-09-17 01:18:42 CEST
Comment on attachment 3866 
Patch v2

Thank you! You literally applied the patch in the time it took me to eat a sandwich :-)

Bug #3545

Reported by:
john lovely
Reported on: 2007-09-14
Last modified on: 2012-09-27

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Attachments

Patch (1.63 KB, patch)
2011-09-16 22:46 CEST , Alex Henrie
no flags
Patch v2 (1.23 KB, patch)
2011-09-17 00:58 CEST , Alex Henrie
no flags

Additional information