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

Re: [Sheflug] running as root




> I belive you have to add an option like -p to the shell or it
> refuses to run with differing real and effective uids. So something
> like
> 
> #!/bin/sh -p
> cat /etc/shadow
> 
> (This works for the Bourne shell on Solaris, it may be slightly different
> for bash).
> 

The -p switch should work according to the man page, but Linux has ignored 
the suid bits so the flag has no effect. Cunningly enough, against my 
expectations, OpenBSD does support suid scripts (with the -p flag for 
/bin/sh). I forgot to try DEC Unix at work...maybe Monday. If I remember.

Churning through the kernel source (fs/binfmt_script.c and fs/binfmt_elf.c), 
the script handler has nothing to handle the suid flag, and it looks like a 
git to try and put support in there, looking at the ELF code...

Chris...


-- 
@}-,'--------------------------------------------------  Chris Johnson --'-{ [at] 
    / "(it is) crucial that we learn the difference / sixie [at] nccnet.co.uk  \
   / between Sex and Gender. Therein lies the key  /                       \ 
  / to our freedom" -- LB                         / www.nccnet.co.uk/~sixie \ 


---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.