getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sun, 14 Feb 2021 17:26:41 +0000 (17:26 +0000)
committerRyan Tandy <ryan@nardis.ca>
Sun, 14 Feb 2021 17:26:41 +0000 (17:26 +0000)
commitd3d541cffef558fa1145b25c29c8158e61aecd12
tree0b574ba38da5d594bc517b16d7ddd89ed9c40885
parent6c3f4bd721b3e18c54ccd870d40a9b802eb921fe
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