Skip to content

autorun: Do not require autorun.sh to be +x

Since 8978c637, 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 #2675 (closed)

Merge request reports