Re: s6-envuidgid: Weird errors with GNU libc's getgrent() and endgrent()

From: Casper Ti. Vector <caspervector_at_gmail.com>
Date: Sun, 2 Jun 2019 14:27:12 +0800

On Sat, Jun 01, 2019 at 11:55:57PM -0300, Guillermo wrote:
> Sooo... thoughts? Does anyone else use a sufficiently recent version
> of GNU libc and experience the same?

On my machine using Void with glibc 2.29 since 20190305, I never
encountered this issue. I can confirm the behaviour you described of
getgrent(3), but it seems that prot_readgroups() (the only place where
getgrent(3) is called in s6-envuidgid.c) always calls endgrent(3) only
after getgrent(3) returns NULL, whether on error or upon exhaustion of
the entries; the `if (n >= max) break;' line would not be triggered
under normal circumstances because `max' is set to `NGROUPS_MAX' by
main(). Therefore, at least on my system, endgrent(3) is always called
with `errno' set to zero.

BTW, gcc with `-Wsign-compare' compains about the operand(s) of `?' on
the last line of prot_readgroups(); I do not know how Laurent thinks
about this.

-- 
My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
Received on Sun Jun 02 2019 - 06:27:12 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC