getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Wed, 28 Oct 2020 04:07:29 +0000 (04:07 +0000)
committerRyan Tandy <ryan@nardis.ca>
Wed, 28 Oct 2020 04:07:29 +0000 (04:07 +0000)
commitd9af9510fe0d7e0b37024920035c2494ae223b5b
tree81ae43ee91fed86be5461c647685c52e2d91f289
parent9c2dcc6ef9608f5d68a7f6872750b4a42a699351
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