URL:
https://github.com/SSSD/sssd/pull/5541
Title: #5541: nss client: make innetgr() thread safe
sumit-bose commented:
"""
Hi,
I have send two different implementations, the second is #5542.
Each has its pros and cons. This one requires more memory since all data is read in a
single run and kept in the client process between the calls. This is more or less the same
as libnss_files.so does, the related data from /etc/netgroup is read by setnetgrent() and
processed later.
The second one uses a new connection for each request sequences. Since the socket has to
be opened and the connection established this will require a bit more time. My main
concern here is that the file descriptor might get lost and the connection stays open if
the caller does not implement the setnetgrent(), getentgrent(), endgrent() sequence
correctly or calls them in threads because the sequence itself is not thread-safe, only
the implementation with innetgr().
bye,
Sumit
"""
See the full comment at
https://github.com/SSSD/sssd/pull/5541#issuecomment-801735204