Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Silence compilation warnings about setuid, setgid
- X-seq: zsh-workers 42993
- From: Eitan Adler <lists@xxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: [PATCH] Silence compilation warnings about setuid, setgid
- Date: Wed, 13 Jun 2018 04:49:39 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MNBlbK8xxHVgGlX0roRxgYw4nnoODmLSeq/EQ+eA6Bs=; b=MufOqzTnyhJsSJUEytJMPpn6PK17HfHSmjfo0RubhanzneusTGM1W7u37SBypGNFiz EEJHPb5rKqajhJRvqMpEdSmsxmqafnab2Q3JXZYZJkBhpF9AVENmiabGWTn67LwcEsnf pA2Y73txLWWqqrN8XFrpOItvjcTkv9k2Pld7k=
- In-reply-to: <CAKc7PVBWHsOhpC7mZcL4DA0ih=3yJF-HYe+We=r0q1oXA_s38g@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBWHsOhpC7mZcL4DA0ih=3yJF-HYe+We=r0q1oXA_s38g@mail.gmail.com>
On 7 May 2018 at 04:18, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hello,
> on a Linux box I see:
> Looking at the source, the reported calls are "extra" ones, they are
> followed by proper setuid, setgid calls. I've found some way out from this
> situation, of using the report value and reporting it (gmail paste, proper
> patch is attached):
>
> #ifdef HAVE_SETUID
> - setuid(getuid());
> - setgid(getgid());
While we're touching this code can we please correct the order of
setuid and setgid?
setgid must be called before setuid. If setuid is called first, on
some platforms, it no longer has privs to call setgid aymore.
See https://wiki.sei.cmu.edu/confluence/display/c/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges
for additional details
--
Eitan Adler
Messages sorted by:
Reverse Date,
Date,
Thread,
Author