Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Silence compilation warnings about setuid, setgid
- X-seq: zsh-workers 42997
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: [PATCH] Silence compilation warnings about setuid, setgid
- Date: Wed, 13 Jun 2018 08:08:27 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=APWVwad9ZvzwecjAgdyAhNPyQj5vxg6IFB16QRTZvsg=; b=ZTKa6/4qPI0bGPQ6MBnhnWEvCI0zm/WVpbpYW8Z1jQv9Msbls1XyFhvWldV5H1d6XT ZZrkS0LmY5y4FDLDFnsXI0DPiStR0ofC3eNf8GtBElS4BiOKCZGKNi24+jf8zI1Nq/cB R/ebwKJE9Xuig7dbURuqAv9WlDHUoNbcvPJafgcPErWV2Gxcxl5BHABiE0Eq99zKS17h B6zx7w2mVEuLvVYCOz+7Gn6pWzH9GWeZ4O88k0lBxjydF6zTfUbVGQvcXAkHmnvI3FCn dD7x/sVaEpRMWWEpcIfQeM3kgia/h9Jy+Tj9vgWIYjL3AXlfD+F6rCEBDQ9WEVkcKmla an4Q==
- In-reply-to: <20180613131021eucas1p263704fa9832375e6a49cf7f2077606dc~3ukj6hhqT1702017020eucas1p2W@eucas1p2.samsung.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> <CGME20180613115039epcas5p3f7e70bdce12919686a5dec9895782138@epcas5p3.samsung.com> <CAF6rxgmVA5KtcRoaVZi5P=6OtQdLPzHJowbBm+eyp0Zjea19Sg@mail.gmail.com> <20180613131021eucas1p263704fa9832375e6a49cf7f2077606dc~3ukj6hhqT1702017020eucas1p2W@eucas1p2.samsung.com>
On Wed, Jun 13, 2018 at 6:10 AM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> On Wed, 13 Jun 2018 04:49:39 -0700
> Eitan Adler <lists@xxxxxxxxxxxxxx> wrote:
>>
>> setgid must be called before setuid. If setuid is called first, on
>> some platforms, it no longer has privs to call setgid aymore.
>
> Presumably that's a trivial swap? I don't know if we need both
> setgid()s before both setuid()s, because I don't know why they're
> repeated --- but if the second case is simply to test for an error that's
> not a big deal since if it worked properly there won't be one.
IIRC there are some cases in which setgid/setuid fail silently, i.e.,
without changing anything but without setting errno. The second calls
are to double-check that the first one was not rogue in that way.
This may have been isolated to a 1990s-era OS that is no longer at
issue. Either way there's no particular reason to save and report
errno from the first call.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author