Strange diagnostic
Hello.
Please look at the following situation:
nikita@sercond:~> ls -l /usr/local/sbin/restart-after-upgrade
-rwxr--r-- 1 root root 1044 Ноя 11 2001
/usr/local/sbin/restart-after-upgrade*
nikita@sercond:~> which restart-after-upgrade
/usr/local/sbin/restart-after-upgrade
nikita@sercond:~> restart-after-upgrade
bash: /usr/local/sbin/restart-after-upgrade: /bin/bash: bad interpreter:
Permission denied
Here 'restart-after-upgrade' is a shell script that happens to be executable
by root only (I know user can easily source it, I am writing not about
security but about diagnostic).
So why "which" finds it? And why error message when a user attempts to run
it is so strange? Is that normal, or it should be filed as bug reports?
Reply to: