doing setreuid with setuid in modern sysv

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Jan 16 15:22:31 AEST 1990


In article <90Jan14.130354est.2125 at neat.cs.toronto.edu> rayan at cs.toronto.edu (Rayan Zachariassen) writes:
>Could someone set me straight on this please?  How does one flip back and
>forth between uid 0 and uid != 0 in a process started by uid 0 on a modern
>System V ?

Make the binary owned by UID 0 and turn on its set-UID bit.
Then when executed by somebody whose UID is non-zero,
setuid() can be used to toggle between the initial EUID of
0 and the invoker's UID.



More information about the Comp.unix.questions mailing list