[comp.unix.questions] Interpretter question

lear@athos.rutgers.edu.UUCP (12/05/87)

If you run a setuid program as an interprettor, it will not
run setuid (at least on a Sun).  Is this a bug or a feature?

Example:

# pwd
/u4/lear
# cp /bin/sh .
# chown root sh
# chmod 4755 sh

then a executing a file containing:
#!/u4/lear/sh
chown root /u4/lear/.login

You will find that the program will not be setuid.

Any ideas?
-- 
Eliot Lear
[lear@rutgers.edu]

ron@topaz.rutgers.edu (Ron Natalie) (12/06/87)

Eliot, you want to chown the #! script to be setuid, not the interpretter.

-Ron