getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Wed, 5 Oct 2022 12:38:13 +0000 (13:38 +0100)
committerPeter Michael Green <plugwash@raspbian.org>
Wed, 5 Oct 2022 12:38:13 +0000 (13:38 +0100)
commitd1053abef8e84dc05cc679aeb486ead58a8a2fcd
treeec50fa6271b4504f893c6e5d3a2a9fba78ec3d14
parent4b256e9ea7aa4203c8de6397e42600cb40974e0d
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