setregid() and setreuid() implementation proposal

Corinna Vinschen vinschen@redhat.com
Wed Jan 22 17:35:00 GMT 2003


On Wed, Jan 22, 2003 at 12:22:52PM -0500, Jason Tishler wrote:
> Corinna,
> 
> On Wed, Jan 22, 2003 at 11:48:19AM +0100, Corinna Vinschen wrote:
> > My tiny extension:
> > 
> >     if (rgid != -1)
> >       if (rgid == egid)
> >         return setuid (rgid);
> >       ERROR;
> >     return setegid (egid);
> 
> I thought that you meant something like the above, but I was concerned
> I was missing something.
> 
> I plan on using the following:
> 
>     if (rgid != -1 && rgid != egid)
>       {
>         set_errno (EINVAL);
>         return -1;
>       }
> 
>     return setegid (egid);
> 
> unless I hear otherwise.

"Otherwise".

setuid, not seteuid in case of rgid == 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