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 10:00:24PM -0500, Pierre A. Humblet wrote:
> extern "C" int
> setreuid32 (__uid32_t ruid, __uid32_t euid)
> {
>   int ret = 0;
>   bool tried;	
>   __uid32_t old_euid = myself->uid;
> 
>   if ((tried = ruid != ILLEGAL_UID && cygheap->user.real_uid != ruid && euid != ruid))
>     ret = seteuid32 (ruid);
>   if (!ret && euid != ILLEGAL_UID)
>     ret = seteuid32 (euid); 
>   if (tried && (ret || euid == ILLEGAL_UID) && seteuid32 (old_euid))
>     system_printf ("Cannot restore original euid %u\n", old_euid);
>   if (!ret && ruid != ILLEGAL_UID)
>     cygheap->user.real_uid = ruid;
>   debug_printf ("real: %d, effective: %d", cygheap->user.real_uid, myself->uid);
>   return ret;
> }

Could you send a patch?

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]