This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setregid() and setreuid() implementation proposal


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]