setuid bit on shell scripts - works? or not?

mark at ece-csc.UUCP mark at ece-csc.UUCP
Sat Nov 22 10:36:25 AEST 1986


In article <2668 at gitpyr.gatech.EDU> lindsay at gitpyr.gatech.EDU (LINDSAY H. MORRIS) writes:
>If you make a shell script executable, can you then use the setuid bit in the
>usual way? Or does setuid only work on executable objects?

It works under Ultrix 1.2.

I'm not positive, but I *think* that I had some problem with programs run from
the script not inheriting the set-uid priviledges, ie, I once had something 
like:

   file "test":
      #!/bin/csh
      a.out
      other commands....


Assume "test" was owned by "root" and had set-uid bits on, and "a.out"
was owned by something other than root.

then, running "test" did not run "a.out" with root's priviledges.

I won't swear to this though, since at the time I ran into the problem
I found some other way to deal with things and never really did 
look into the matter thoroughly.  (sorry).

     -- Mark --



More information about the Comp.unix.questions mailing list