getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sat, 14 Jan 2023 00:29:59 +0000 (00:29 +0000)
committerRyan Tandy <ryan@nardis.ca>
Sat, 14 Jan 2023 00:29:59 +0000 (00:29 +0000)
commit076b4b8b43bd6e3383f537c3aad6ce4fe651c5dd
tree8b966319de39669b1f9a81aedd17740f3d9372d5
parent861aa423d256a52f6e0f0a9bd585a14353aa5eb6
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