Arjan van de Ven <[email protected]> writes:
> On Sat, 2006-05-13 at 13:03 +0200, Mark Rosenstand wrote:
>> bash-3.00$ cat << EOF > test
>> > #!/bin/sh
>> > echo "yay, I'm executing!"
>> > EOF
>> bash-3.00$ chmod 111 test
>> bash-3.00$ ./test
>> /bin/sh: ./test: Permission denied
> is your script readable as well? 111 is just weird/odd.
It needs to be readable as well. What ends up happening is that the
kernel sees the execute bit, looks at the shebang line and then does:
Since read permission is off, the shell's open() call fails. It will
work fine if you use 755 as the permissions.
Every Unix I've ever seen works this way. It'd be nice to have
unreadable executable scripts, but no one's ever done it.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Video 4 Linux]
[Linux for the blind]