getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sun, 18 Sep 2022 22:29:46 +0000 (23:29 +0100)
committerSergio Durigan Junior <sergiodj@debian.org>
Sun, 18 Sep 2022 22:29:46 +0000 (23:29 +0100)
commit2855efac1342e2b039552ba7cf204cd5933d2b38
treefa5c983b3f1b44e55538ae7f69b2cf9bb734388d
parent65baef39f747ce860d161eb798a3f0fa12214de9
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