delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2003/01/23/04:50:08

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Thu, 23 Jan 2003 10:50:02 +0100
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: setregid() and setreuid() implementation proposal
Message-ID: <20030123095002.GV29236@cygbert.vinschen.de>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <20030122173459 DOT GM29236 AT cygbert DOT vinschen DOT de> <20030116190119 DOT GD820 AT tishler DOT net> <20030117120131 DOT GF1142 AT cygbert DOT vinschen DOT de> <20030121183105 DOT GA2128 AT tishler DOT net> <20030122104819 DOT GC29236 AT cygbert DOT vinschen DOT de> <20030122172252 DOT GA628 AT tishler DOT net> <20030122173459 DOT GM29236 AT cygbert DOT vinschen DOT de> <3 DOT 0 DOT 5 DOT 32 DOT 20030122220024 DOT 007dc9a0 AT mail DOT attbi DOT com>
Mime-Version: 1.0
In-Reply-To: <3.0.5.32.20030122220024.007dc9a0@mail.attbi.com>
User-Agent: Mutt/1.4i

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 AT cygwin DOT com
Red Hat, Inc.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019