[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Strange diagnostic



On Sun, 2003-01-26 at 18:54, Nikita V. Youshchenko wrote:
> 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?

Since it is a script, it presumably starts with 
#! /path/to/interpreter

The problem is that the user doesn't have execute permission on
/path/to/interpreter


-- 
Oliver Elphick <olly@lfix.co.uk>
LFIX Limited



Reply to: