Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: doing setreuid with setuid in modern sysv Message-ID: <11955@smoke.BRL.MIL> Date: 16 Jan 90 04:22:31 GMT References: <90Jan14.130354est.2125@neat.cs.toronto.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <90Jan14.130354est.2125@neat.cs.toronto.edu> rayan@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.