getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sat, 24 Sep 2022 19:40:21 +0000 (20:40 +0100)
committerRyan Tandy <ryan@nardis.ca>
Sat, 24 Sep 2022 19:40:21 +0000 (20:40 +0100)
commit051ee083a3e489244b2a4525ccf6e023e1655076
tree575456eae0b64fec8edde54b1880032ca468321a
parentbf3f4e2df92e6971dc4698277e5f90a860e328de
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