getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Wed, 8 Feb 2023 01:56:12 +0000 (01:56 +0000)
committerRyan Tandy <ryan@nardis.ca>
Wed, 8 Feb 2023 01:56:12 +0000 (01:56 +0000)
commit6cd74e9c32f9271559e743eedf54b63223e562fd
tree593297b0fc64e50e5297319bfddf2c1e9351c51f
parent51bb78f2b1a8b87b6eeb5400a9069308e41cbd07
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