setuid (euid) after setuid (uid) on

John F. Haugh II jfh at rpp386.Dallas.TX.US
Wed Mar 22 19:35:28 AEST 1989


In article <1800008 at spdyne> root at spdyne.UUCP writes:
>    I know that on BSD they added a very useful call: setreuid, which
>allows the setting of both real and effective uid.  [I'm pretty sure that
>I got that name right, but it's been 4 years since I did anything with BSD]
>I seem to remember a fantastic call that switched your uid and euid! This
>was a VERY good idea on someone's part!

setreuid()  allows you to specify both the real and the effective UID's
separately.  The syntax from the manpage is

setreuid (ruid, euid)
int ruid, euid;

where ruid and euid are the real and effective UID's respectively.

This system call only allows you to change the effective UID to the
real UID, unless you are root.
-- 
John F. Haugh II                        +-Quote of the Week:-------------------
VoiceNet: (214) 250-3311   Data: -6272  | "Do not drink and bake"
InterNet: jfh at rpp386.Dallas.TX.US       |         -- Arnold Swartzenegger
UucpNet : <backbone>!killer!rpp386!jfh  +--------------------------------------



More information about the Comp.unix.wizards mailing list