getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sat, 15 May 2021 23:03:34 +0000 (00:03 +0100)
committerRyan Tandy <ryan@nardis.ca>
Sat, 15 May 2021 23:03:34 +0000 (00:03 +0100)
commita8d31f260cdc222637fc012449f07fbf2e8d39e2
treeb59b621f1f89fdb15e8c27935a21f83f2cf6b844
parentdf3d24fb12ddc7efa4be756bb4289bbc455e437e
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