> On 21 Feb 2023, at 08:39, Florian Weimer via Libc-alpha wrote: > > Before this change, sgetsgent_r did not set errno to ERNAGE, but s/ERNAGE/ERANGE/ > sgetsgent only checked errno, not the return value from sgetsgent_r. > Consequently, sgetsgent did not detect any error, and reported > success to the caller, without initializing the struct sgrp object > whose address was returned. > > This commit changes sgetsgent_r to set errno as well. This avoids > similar issues in applications which only change errno. > > Tested on x86_64-linux-gnu. > Tested on x86_64-linux-gnu too, thanks, although I couldn't reproduce the original shadow bug which may or may not be related (https://github.com/shadow-maint/shadow/issues/628).