[PATCH] Return proper status from _nss_nis_initgroups_dyn (bug 20262)
Florian Weimer
fweimer@redhat.com
Thu Jun 30 10:26:00 GMT 2016
On 06/28/2016 04:40 PM, Andreas Schwab wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>
>> Now I'm really confused. You are changing the group enumeration code,
>> after the potential call to initgroups_netid.
>
> I don't understand this sentence at all.
For context, I've been trying to reproduce these issue and how it
affects results returned by “id” and “getent initgroups”.
Regarding the most recent discussion, I believe the direct query support
for NIS is in the function initgroups_netid (starting around line 150 in
nis/nss_nis/nis-initgroups.c). If this cannot be used, nss_nis falls
back to enumeration of the group database (lines 256 onwards, in
_nss_nis_initgroups_dyn), gathering group IDs of those groups which
contain the user (check is at line 287).
The broken status handling only affects this fallback code (group
enumeration). Based on how this is called, I do not see any other forms
of fallback. So I found your comment that the existing bug causes
fallback to group enumeration most puzzling.
Rather, it seems to me that the caller ignores the error code and
proceeds to merge the results even if _nss_nis_initgroups_dyn returned
NSS_STATUS_NOTFOUND.
Thanks,
Florian
More information about the Libc-alpha
mailing list