getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Fri, 26 Apr 2024 23:09:29 +0000 (16:09 -0700)
committerRyan Tandy <ryan@nardis.ca>
Fri, 26 Apr 2024 23:09:29 +0000 (16:09 -0700)
commitcd4986ab5ea33b4be6af41d45b887ea80ae24207
tree87ad4504b33e6ad0dab01ee53ad6255af9f89ab1
parent7a1cfe3c141d13efb4384424ac1cad4fe7d54e6c
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c