New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run executable file when it has executable attribute #2385
Comments
I think you might have the same problem as I do. It appears that nemo also cares about the mime type of the file. In my case, it is application/x-sharedlib, so it sees it as a shared library. I'm not familiar with the structure of ELF files but apparently some executable files can look like shared libraries, since both file and mimetype also return the same mime type. BTW, I have Linux Mint 19.3 and Nemo 4.4.2. I'm not sure, maybe it is already fixed, or the problem is in some, possibly outdated, configuration files. I also don't know whether nemo supposed to run some of the files with this mime type, or the mime type was just incorrectly determined. |
I downloaded caja and it has a different popup - it displays what you mentions. In caja, the binary is classified as a shared library. What you describe is exactly this: https://stackoverflow.com/questions/45329372/ubuntu-recognizes-executable-as-shared-library-and-wont-run-it-by-clicking which is easily solveable. nemo has a different problem, it has no launch options at all. Apparently it has this change (which I greatly dislike): https://www.omgubuntu.co.uk/2018/05/nautilus-remove-ability-launch-binaries-apps |
This solution is for developers, and I'm not a developer of the applications with this problem (gdevelop and Defold). About the second link, I don't know whether this change was implemented in nautilus, but it does not seem to be implemented in nemo, since I can clearly run applications by double clicking. Nautilus had this bug years ago https://bugzilla.gnome.org/show_bug.cgi?id=737849. It seems that your second link says how they solved it, they completely removed the ability to launch applications from nautilus. |
Would either or both of you point to or attach a file you've confirmed this issue for, to test with. |
As I've said, in my case the problem is with two game engines: GDevelop and Defold. Defold can be downloaded from defold.com. It is almost 400MiB. There is no tarball for new versions of GDevelop. The tarball for older version, can be downloaded from here. It is 113.9MiB. Defold executable, is just several MB Defold.zip. Obviously you can't start an application with it, but it should be enough to see the problem. In both cases Nemo shows MIME type application/x-sharedlib. By double-clicking, it shows a message that the file type is unknown and asks to choose a program to open the file with. Both programs can be run from the command line without problems. |
A small example would be |
Good catch. I don't think I've ever looked into the /bin directory from nemo. Turns out that a lot of executable files there are seen as shared libraries. |
I tried to run Of those I tried only Dolphin offers to run shared libraries: You can make other file managers do something similar as Dolphin if you have a need to start GUI programs (compiled as shared libraries) from your file manager but don't want to create a .desktop entry for each program as you normally would. You'd create a generic .desktop entry for application/x-sharedlib binaries. To do so create the file
Then right-click a shared library file, select Open With Other Application, highlight our Run Executable and click Set as default. Next time you double-click a shared library file you get this dialog: |
What do you think, who's responsibility it is then? Is the identification as a shared library wrong, or is some software in the middle way misbehaving? |
For Firefox installed as ( For example nemo doesn't know how to open the GUI CD/DVD disk creator, K3B - even though the CLI can run that program to startup the GUI program normally. Surely it is for the creator of the program to choose the mime-type? |
Let me re-open this line of thought: the fact that "many executables have a certain mime-type" should not, of course, be solved in nemo. But the fact that nemo doesn't execute many executables (because they have that mime-type) probably should. If I use a file manager to go to /usr/bin and double-click a program like xedit then I expect that program to start. If this doesn't happen for some executable, then there's something wrong with that executable. If it doesn't happen for ANY executable then there's something wrong with nemo. |
If you used a CLI file manager, you might reasonably expect For example, nemo can run scripts by supplying the file as input to |
I've just run into this too when running kitty, a terminal. It is treated as a shared library and won't execute. What is it that the author of the terminal needs to change in order for it to be recognised in Mint as an executable so that it can be executed? I could raise it as an issue against that project in GitHub. |
A .desktop file? |
Save this in |
I, the user, determine what is and isn't an executable file and I determine it by setting the x-bit in the file permissions. Not the person who wrote it, not the person who wrote the file manager, not the person who wrote some "mime-type utility". I, and I alone, get to decree what is and isn't executable -- everything else
No. This statement is categorically false. The very meaning of the phrase "chmod +x filename" is "This file is different from other files, it contains code that can be executed in some form". I have no quarrels with some right-click menu that offers me nine hundreds options for what I might want with a file - open it in an editor or display the contents on screen or submit to pornhub or whatever you can think of. But the thing an executable file does by default is "being executed". That's its purpose. Without doing any kind of research I can state with complete confidence that 99.99% of accesses to /usr/bin/xed are to execute it. As long as Nemo does not even have THE OPTION to choose "execute this file" when I click on an executable, Nemo is broken. A file manager that does not have an option to execute an executable file is as broken as a file manager that doesn't have an option to edit a editble file or copy a copyable file or browse a browsable directory. It is failing at its most basic functionality.
|
When you say "[you] decree what is and isn't executable" - what does that actually mean? If you attempt to run a file doesn't have an x bit set, it's definitely not going to be executed - although it might cause a different file to be executed which takes the first file as data. This is how a GUI editor usually works. And if your file has an x bit set, it might not get executed (in the usual sense) - if its a script then it's going to just cause various programs to execute such as Even a plain binary file (with +x) needs to run in some kind of environment. |
chmod +x
So we agree that there's a difference here, right? When I double-click a text file in Nemo and the x-bit is set, it'll pop up an alert box with a couple options and asks me what I want to do with this file -- display it, edit it, or, yes, run it. Because nobody needs an explanation what it means to "run an executable script". All that blah-blah is just semantics -- if you've spent more than three days around Linux you know the meaning of the word "run" for an executable text file. When the x bit is NOT set, the text file just gets opened in an editor instead. If I want yet-other-options, I can right-click and choose those. But when I do the EXACT SAME THING with an actual executable (ELF binary) with the x-bit set, then Nemo will
Actual, executable files with the actual x bit set cannot be actually executed by Nemo (even though text files with the x-bit set can!) It's not even an option. That is just broken software.
|
I agree with @SvenGeier. All this "safety precautions" are just inconvenience for the user. If a user wants to execute a binary executable file, do make it possible. |
The issue is confirmed solved in shared-mime-info version 2.1 (the related upstream bug report):
Ubuntu 22.04 LTS has that version and I confirmed it no longer incorrectly labels PIE binaries as application/x-sharedlib, and Nemo will run such files as expected. So Linux Mint 21 won't be affected by this issue. |
bug still on effin LMDE .... oh well.. |
the command: |
Issue
This is rather stupid problem, but I can not find a way to run any executable from nemo. There is no such option on the right click menu. Double clicking only gives the dialog that the file type is unknown and asks to cancel or choose another program to open (the binary file) with.
The binaries I compile have
-rwxrwxr-x
attributes.The text was updated successfully, but these errors were encountered: