getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Wed, 11 Nov 2020 17:13:56 +0000 (17:13 +0000)
committerRyan Tandy <ryan@nardis.ca>
Wed, 11 Nov 2020 17:13:56 +0000 (17:13 +0000)
commite2533a7f17d2aae2d3b28da37b9abdc5fcf56393
tree5d80a7e83a1ae4c33f4d27d00f490fe7c7bd2071
parent3914699f0f47a0e4f90c8966b5c32417cd3c7e73
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