Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf9b967

Browse files
committed
configure: don't probe for libldap_r if libldap is 2.5 or newer.
In OpenLDAP 2.5 and later, libldap itself is always thread-safe andthere's never a libldap_r. Our existing coding dealt with thatby assuming it wouldn't find libldap_r if libldap is thread-safe.But that rule fails to cope if there are multiple OpenLDAP versionsvisible, as is likely to be the case on macOS in particular. We'dend up using shiny new libldap in the backend and a hoary libldap_rin libpq.Instead, once we've found libldap, check if it's >= 2.5 (byprobing for a function introduced then) and don't bother lookingfor libldap_r if so. While one can imagine library setups thatthis'd still give the wrong answer for, they seem unlikely tooccur in practice.Per report from Peter Eisentraut. Back-patch to all supported branches.Discussion:https://postgr.es/m/fedacd7c-2a38-25c9-e7ff-dea549d0e979@enterprisedb.com
1 parent4695fdb commitaf9b967

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

‎configure

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12774,7 +12774,18 @@ _ACEOF
1277412774
fi
1277512775
done
1277612776

12777-
if test "$enable_thread_safety" = yes; then
12777+
# The separate ldap_r library only exists in OpenLDAP < 2.5, and if we
12778+
# have 2.5 or later, we shouldn't even probe for ldap_r (we might find a
12779+
# library from a separate OpenLDAP installation). The most reliable
12780+
# way to check that is to check for a function introduced in 2.5.
12781+
ac_fn_c_check_func "$LINENO" "ldap_verify_credentials" "ac_cv_func_ldap_verify_credentials"
12782+
if test "x$ac_cv_func_ldap_verify_credentials" = xyes; then :
12783+
thread_safe_libldap=yes
12784+
else
12785+
thread_safe_libldap=no
12786+
fi
12787+
12788+
if test "$enable_thread_safety" = yes -a "$thread_safe_libldap" = no; then
1277812789
# Use ldap_r for FE if available, else assume ldap is thread-safe.
1277912790
# On some platforms ldap_r fails to link without PTHREAD_LIBS.
1278012791
LIBS="$_LIBS"

‎configure.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,14 @@ if test "$with_ldap" = yes ; then
12871287
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12881288
# This test is carried out against libldap.
12891289
AC_CHECK_FUNCS([ldap_initialize])
1290-
if test "$enable_thread_safety" = yes; then
1290+
# The separate ldap_r library only exists in OpenLDAP < 2.5, and if we
1291+
# have 2.5 or later, we shouldn't even probe for ldap_r (we might find a
1292+
# library from a separate OpenLDAP installation). The most reliable
1293+
# way to check that is to check for a function introduced in 2.5.
1294+
AC_CHECK_FUNC([ldap_verify_credentials],
1295+
[thread_safe_libldap=yes],
1296+
[thread_safe_libldap=no])
1297+
if test "$enable_thread_safety" = yes -a "$thread_safe_libldap" = no; then
12911298
# Use ldap_r for FE if available, else assume ldap is thread-safe.
12921299
# On some platforms ldap_r fails to link without PTHREAD_LIBS.
12931300
LIBS="$_LIBS"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp