Bruno Haible <[EMAIL PROTECTED]> writes:

> /* This is for executables that have the setgid bit set.  */
> #if HAVE_SETREGID
>   setregid (getgid (), getgid ());
> #else
>   setegid (getgid ());
> #endif
> /* This is for executables that have the setuid bit set.  */
> #if HAVE_SETREUID
>   setreuid (getuid (), getuid ());
> #else
>   seteuid (getuid ());
> #endif

Is it worth checking the return values for errors?  It could be
disastrous if an attempt to drop privilege failed.  
-- 
Ben Pfaff 
http://benpfaff.org



Reply via email to