getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Fri, 27 Aug 2021 16:42:31 +0000 (17:42 +0100)
committerRyan Tandy <ryan@nardis.ca>
Fri, 27 Aug 2021 16:42:31 +0000 (17:42 +0100)
commit8dd850788820973eee53b9645f8b2e467f1747fb
tree67d86d486ab5e7f6036c97226507f9a332cdb1e9
parent0ff29f809bd256cb8c0dc81f707688ab0f3a8cb6
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