@@ -13796,6 +13796,17 @@ fi
1379613796
1379713797fi
1379813798
13799+ # PGAC_LDAP_SAFE
13800+ # --------------
13801+ # PostgreSQL sometimes loads libldap_r and plain libldap into the same
13802+ # process. Check for OpenLDAP versions known not to tolerate doing so; assume
13803+ # non-OpenLDAP implementations are safe. The dblink test suite exercises the
13804+ # hazardous interaction directly.
13805+
13806+
13807+
13808+
13809+
1379913810if test "$with_ldap" = yes ; then
1380013811 if test "$PORTNAME" != "win32"; then
1380113812
@@ -13953,6 +13964,72 @@ fi
1395313964
1395413965done
1395513966
13967+ { $as_echo "$as_me:$LINENO: checking for compatible LDAP implementation" >&5
13968+ $as_echo_n "checking for compatible LDAP implementation... " >&6; }
13969+ if test "${pgac_cv_ldap_safe+set}" = set; then
13970+ $as_echo_n "(cached) " >&6
13971+ else
13972+ cat >conftest.$ac_ext <<_ACEOF
13973+ /* confdefs.h. */
13974+ _ACEOF
13975+ cat confdefs.h >>conftest.$ac_ext
13976+ cat >>conftest.$ac_ext <<_ACEOF
13977+ /* end confdefs.h. */
13978+ #include <ldap.h>
13979+ #if !defined(LDAP_VENDOR_VERSION) || \
13980+ (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
13981+ LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
13982+ choke me
13983+ #endif
13984+ int
13985+ main ()
13986+ {
13987+
13988+ ;
13989+ return 0;
13990+ }
13991+ _ACEOF
13992+ rm -f conftest.$ac_objext
13993+ if { (ac_try="$ac_compile"
13994+ case "(($ac_try" in
13995+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13996+ *) ac_try_echo=$ac_try;;
13997+ esac
13998+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13999+ $as_echo "$ac_try_echo") >&5
14000+ (eval "$ac_compile") 2>conftest.er1
14001+ ac_status=$?
14002+ grep -v '^ *+' conftest.er1 >conftest.err
14003+ rm -f conftest.er1
14004+ cat conftest.err >&5
14005+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
14006+ (exit $ac_status); } && {
14007+ test -z "$ac_c_werror_flag" ||
14008+ test ! -s conftest.err
14009+ } && test -s conftest.$ac_objext; then
14010+ pgac_cv_ldap_safe=yes
14011+ else
14012+ $as_echo "$as_me: failed program was:" >&5
14013+ sed 's/^/| /' conftest.$ac_ext >&5
14014+
14015+ pgac_cv_ldap_safe=no
14016+ fi
14017+
14018+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14019+ fi
14020+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_ldap_safe" >&5
14021+ $as_echo "$pgac_cv_ldap_safe" >&6; }
14022+
14023+ if test "$pgac_cv_ldap_safe" != yes; then
14024+ { $as_echo "$as_me:$LINENO: WARNING:
14025+ *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
14026+ *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
14027+ *** also uses LDAP will crash on exit." >&5
14028+ $as_echo "$as_me: WARNING:
14029+ *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
14030+ *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
14031+ *** also uses LDAP will crash on exit." >&2;}
14032+ fi
1395614033 else
1395714034
1395814035for ac_header in winldap.h
0 commit comments