[TUHS] Set-uid shell scripts

Noel Chiappa jnc at mercury.lcs.mit.edu
Mon Aug 5 06:18:37 AEST 2019


    > From: Alec Muffett

    >>>  ln -s /bin/scriptname ./-i
    >>>  "-i" # assuming that "." is already in your path

'scriptname' (above) would have to be a shell script which was SETUID root?
That was part of what I was missing, along with the below.

    > The cited filename is passed as argv[1]

I wonder why it passed the link name, instead of the actual filename of the
target (script)? Perhaps to allow one script to have multiple functions,
depending on the name it was called with? But that could have been done with
hard links? (Adding a hard link must require write access, because the link
count in the inode has to be updated? So it would be equally secure as not
having an SUID program with write access.)

Part of the problem is having the kernel involved in starting shell scripts;
convenient in some ways, but V6 etc worked fine without that 'feature'.

       Noel


More information about the TUHS mailing list