So the functions to choose from are:

setuid/setgid: Available on all platforms. Sets effective uid/gid. On Linux,
sets real and saved uid/gid if caller is root. On BSD, always sets all of them.

seteuid/setegid: Defined by BSD, available on Linux. Sets effective uid/gid.

setreuid/setregid: Also BSD, available on Linux. Sets real and effective 
uid/gid.


Unless I'm missing something, we just want to drop all priveleges and not
regain them. Since we're on privileged ports, we're running as root. So
setuid/setgid seems to make the most sense.

Aaron


Dan Weber <[EMAIL PROTECTED]> said:
>
> On Wed, May 12, 2004 at 10:44:40PM +0200, Paul J Stevens wrote:
> > AFAIK setresuid/setresgid are gnu extensions that are also available on
> > freebsd and hp-ux. Providing this on debian is of course no immediate
> > problem, even though we'd have to #define _GNU_SOURCE; For upstream,
> > however: a no go, it seems.
> 
> I think it is necessary tho.  I mean you can use the alternatives, but
> they don't seem to make a complete solution.  For debian this patch is
> fine, use some #ifdef statements for systems that don't support it.
> They can use the others.  configure should be handling this even.
> likes if build=3D *-*-gnu, then have it put #define _GNU_SOURCE in
> config.h.  Then surround the stuff I wrote with #ifdef _GNU_SOURCE
> etc.  The alternatives are seteuid and setegid which can be there with
> an ifndef _GNU_SOURCE
> 
 

--

Reply via email to