getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Fri, 22 Jan 2021 03:54:40 +0000 (03:54 +0000)
committerRyan Tandy <ryan@nardis.ca>
Fri, 22 Jan 2021 03:54:40 +0000 (03:54 +0000)
commita34dd99c6b30fd5574fbd5dfff007347fb271ad4
tree94f995602aa18b33d562edec4a9fea2eb8735d24
parentad7644ddeaf6f18c509947f909bb9296052456d4
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