getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Thu, 13 Jun 2024 02:23:12 +0000 (19:23 -0700)
committerRyan Tandy <ryan@nardis.ca>
Thu, 13 Jun 2024 02:23:12 +0000 (19:23 -0700)
commit91a3df1f88f3a1d476e1bd984f06652df4376dce
treeb6c23805f6f71b3397038286de537f2a969fd793
parent5476fda5ec97bed226c7432a3e87ba9f06b53d8c
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