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 Thu, Jan 16, 2003 at 02:01:19PM -0500, Jason Tishler wrote:
> Is the following simplistic setregid() implementation acceptable?
> 
>     extern "C" int
>     setregid (__gid16_t rgid, __gid16_t egid)
>     {
>       if (rgid != -1)
>         {
>           set_errno (EINVAL);
>           return -1;
>         }
>       return setegid (egid);
>     }
> 
> And, likewise for setreuid()?
> 
> If so, then I will submit the corresponding patch.

I think it's a start...  but I would appreciate if you implement
the appropriate setre[ug]id32 calls plus the setre[ug]id wrapper.

What about

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

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]