setregid() and setreuid() implementation proposal

Corinna Vinschen
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)
    return setegid (egid);

My tiny extension:

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


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

More information about the Cygwin-developers mailing list