[PATCH] nss: files-initgroups.c use shared nss parse tools

Patrick Riehecky riehecky@fnal.gov
Wed Mar 4 22:16:46 GMT 2026


This patch addresses Bug 33960 - files-initgroups.c does not use
shared nss parse tools.
https://sourceware.org/bugzilla/show_bug.cgi?id=33960

files-initgroups.c has historically managed its own line reading via
__getline, fgetpos/fsetpos, and __feof_unlocked, while the rest of
nss_files uses __nss_readline and __nss_parse_line_result for the same
pattern.

This patch  replaces the local file handling with the tooling
__nss_readline/__nss_parse_line_result, aligning files-initgroups.c
with files-XXX.c (and the rest of the module).

There is no intended behaviour change.

No regressions observed.  Tested on x86_64 and aarch64.

Tested with: make subdirs=nss check and run in production for 2 weeks.

Reasoning:
I am attempting to add initgroups_dyn to nss-altfiles. The nss-altfiles
resolver's goal is to simply be a version of the nss-files resolver,
with minimal changes from glibc, that points to another location.
It is easier to add in the missing files-initgroups.c when it uses
__nss_readline/__nss_parse_line_result as those are already covered
by the tooling.


More information about the Libc-alpha mailing list