getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Mon, 23 May 2022 17:14:53 +0000 (18:14 +0100)
committerRyan Tandy <ryan@nardis.ca>
Mon, 23 May 2022 17:14:53 +0000 (18:14 +0100)
commit2e0b002d303aa28399fe18349dd4bdfb3ca603dc
tree4b0619573ef22ea0243b9ca68bc289962ca49033
parent5472b7af4c097d436cf0452eb8f55233899f5dce
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