summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <wjt@endlessos.org>2022-11-29 10:50:16 +0000
committerAntónio Fernandes <antoniof@gnome.org>2022-12-19 22:56:08 +0000
commit2ae52ceb4d9bc7a9f1bce39f0d56b2c09def8f8d (patch)
treedaaafbffa98e976b0ddf045885178ff633c1c855
parenta5ca1f830aebe86413e364c63bf831bc027528fa (diff)
downloadnautilus-2ae52ceb4d9bc7a9f1bce39f0d56b2c09def8f8d.tar.gz
autorun: Do not require autorun.sh to be +x
Since 8978c6375bbe0cd26fffded25bc4606cab2c88e6, `autorun.sh` (but not `.autorun` or `autorun`) has been run via `/bin/sh`, not executed directly. The justification in that commit was as follows > nautilus-autorun-software: Use /bin/sh for autorun.sh execution > > If the autorun file is called autorun.sh it is clearly meant for > execution through a sh processor. The benefit of using /bin/sh as the > executable is that autorun will also work on FAT formatted media (which > does not allow autorun.sh to have +x permission set) However that patch was incomplete. The third argument to _check_file() is 'must_be_executable'; if set, _check_file() will return FALSE when the file does not have the executable bit set. It is possible to mount FAT media in such a way that regular files get the execute bit, but this is not the default. As a result, if you place `autorun.sh` in the root directry of a FAT device, Nautilus offers to run it, but w hen you take it up on that offer it fails, claiming: > Unable to locate the program Complete the special handling of the autorun.sh name by not requiring it to be executable. See https://gitlab.gnome.org/GNOME/nautilus/-/issues/2675
-rw-r--r--src/nautilus-autorun-software.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nautilus-autorun-software.c b/src/nautilus-autorun-software.c
index b5e8c0902..3178c2158 100644
--- a/src/nautilus-autorun-software.c
+++ b/src/nautilus-autorun-software.c
@@ -117,7 +117,7 @@ autorun (GMount *mount)
{
program_to_spawn = g_file_get_child (root, "autorun");
}
- else if (_check_file (root, "autorun.sh", TRUE))
+ else if (_check_file (root, "autorun.sh", FALSE))
{
program_to_spawn = g_file_new_for_path ("/bin/sh");
program_parameter_file = g_file_get_child (root, "autorun.sh");