The "run" build commands don't work on my system.
the opened term said the run script was not executable.
Running the script manually (via `sh` as implemented in `build.c`) yields ``` oskar@torres ~ % /bin/sh -c /tmp/geany_run_script_HVQX9Z.sh /bin/sh: /tmp/geany_run_script_HVQX9Z.sh: Permission denied ```
Which make sense since the file is not marked as executable: ``` oskar@torres ~ % ls -l /tmp/geany_run_script_HVQX9Z.sh .rw-rw-r-- 256 oskar 19 Oct 19:23 /tmp/geany_run_script_HVQX9Z.sh ```
As can be seen in `build.c`, executable permissions are only set on apple platforms:
https://github.com/geany/geany/blob/75def8a24eb2dab8d376ae051806128827d34fbe...
I changed this in my PR #2372 which solves the problem for me. I'm not sure if i'm missing something here.
I don't think passing the script through `sh` circumvents the need for execution rights but i'm not an expert on unix permissions so maybe someone else knows why this was expected to work and/or works for other people?
Thanks!
Well, since you havn't told us what "your system" is how can we help you?
Oh sorry it's Solus 4. I also tested on Debian 10 and got the same result.
I'm mostly just wondering how and under what condition this does work
Ahh, bleeding edge distros, maybe something changed, although I'd expect a report from Arch first :)
Clearly it works for most people since this is the first report. I know several devs use debian but I don't know if they have upgraded to 10 yet, lets see what they say.
Note that here on Mint 19.1 Geany execute works, but `/bin/sh -c script` in the command line gets permission denied if the script does not have execute permission. I would have said thats actually correct, its running as a _command_ (thats what -c says) not reading it as a script. Running `/bin/sh script` works without execute permission since its reading it as a script not executing it, subtle but important difference.
But why Geany works I don't know, but would speculate its to do with which of the 16 trillion<sup>[1]</sup> modes of bash gets used, non-interactive, non-login, run as sh etc etc.
[1] rough estimate
My default shell is zsh but I don't think that makes a difference here. sh is in /bin/sh and executable.
Actually its possibly the problem if sh is just an alias for zsh, which says it emulates sh if started by that name, but how well that emulation is done I don't know. Can you check what sh actually runs?
And its possible that the reason Apple needs execute is because it uses `zsh`, @techee ??
Can you check what sh actually runs?
Just checked, on Solus `sh` is symlinked to `bash`, on Debian 10 to `dash`...
You're right in that not using `-c` works for both. No idea what a true `sh`'s behavior would be
@GladOSkar Where did you get the `-c` flag from? Geany should run the script without `-c`. When you go to Edit->Preferences->Tools, what does the "Terminal" command say? The default is ``` xterm -e "/bin/sh %c" ``` without `-c`.
And its possible that the reason Apple needs execute is because it uses zsh, @techee ??
I think this ifdef can be removed now. I believe that in the past we really used to have the run script executable and run it using `/bin/sh -c run_script.sh` but we changed it because on some systems we weren't allowed to run an executable file from /tmp because of security settings.
When you go to Edit->Preferences->Tools, what does the "Terminal" command say?
It's `kitty "%c"`, which explains what went wrong. Thanks!
Probably removed that at some point ages ago. I used to always use the VTE without run script which is why i didn't notice.
Thanks a lot you two! Great work on geany btw, i love it :)
Closed #2374.
I think this ifdef can be removed now. I believe that in the past we really used to have the run script executable and run it using /bin/sh -c run_script.sh but we changed it because on some systems we weren't allowed to run an executable file from /tmp because of security settings.
Ok, I hadn't noticed it was changed, neat.
Ah, no, I take it back, we need it executable on Apple. The terminal is run using the `open` command like ``` open -a terminal %c ``` and `%c` has to be a file, not a command, and it has to be executable in order to be launched this way.
github-comments@lists.geany.org