setregid() and setreuid() implementation proposal

Corinna Vinschen vinschen@redhat.com
Wed Jan 22 10:48:00 GMT 2003


Hi Jason,

On Tue, Jan 21, 2003 at 01:31:06PM -0500, Jason Tishler wrote:
> But, the above does not handle the following:
> 
>     setregid(-1, gid);
> 
> which is the motivation for this patch.

this was just an excerpt, sorry for being unclear.

Your code:

    if (rgid != -1)
      ERROR;
    return setegid (egid);

My tiny extension:

    if (rgid != -1)
      if (rgid == egid)
        return setuid (rgid);
      ERROR;
    return setegid (egid);

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-developers mailing list