@@ -13663,6 +13663,17 @@ fi
1366313663
1366413664fi
1366513665
13666+ # PGAC_LDAP_SAFE
13667+ # --------------
13668+ # PostgreSQL sometimes loads libldap_r and plain libldap into the same
13669+ # process. Check for OpenLDAP versions known not to tolerate doing so; assume
13670+ # non-OpenLDAP implementations are safe. The dblink test suite exercises the
13671+ # hazardous interaction directly.
13672+
13673+
13674+
13675+
13676+
1366613677if test "$with_ldap" = yes ; then
1366713678 if test "$PORTNAME" != "win32"; then
1366813679
@@ -13820,6 +13831,72 @@ fi
1382013831
1382113832done
1382213833
13834+ { $as_echo "$as_me:$LINENO: checking for compatible LDAP implementation" >&5
13835+ $as_echo_n "checking for compatible LDAP implementation... " >&6; }
13836+ if test "${pgac_cv_ldap_safe+set}" = set; then
13837+ $as_echo_n "(cached) " >&6
13838+ else
13839+ cat >conftest.$ac_ext <<_ACEOF
13840+ /* confdefs.h. */
13841+ _ACEOF
13842+ cat confdefs.h >>conftest.$ac_ext
13843+ cat >>conftest.$ac_ext <<_ACEOF
13844+ /* end confdefs.h. */
13845+ #include <ldap.h>
13846+ #if !defined(LDAP_VENDOR_VERSION) || \
13847+ (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
13848+ LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
13849+ choke me
13850+ #endif
13851+ int
13852+ main ()
13853+ {
13854+
13855+ ;
13856+ return 0;
13857+ }
13858+ _ACEOF
13859+ rm -f conftest.$ac_objext
13860+ if { (ac_try="$ac_compile"
13861+ case "(($ac_try" in
13862+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13863+ *) ac_try_echo=$ac_try;;
13864+ esac
13865+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
13866+ $as_echo "$ac_try_echo") >&5
13867+ (eval "$ac_compile") 2>conftest.er1
13868+ ac_status=$?
13869+ grep -v '^ *+' conftest.er1 >conftest.err
13870+ rm -f conftest.er1
13871+ cat conftest.err >&5
13872+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
13873+ (exit $ac_status); } && {
13874+ test -z "$ac_c_werror_flag" ||
13875+ test ! -s conftest.err
13876+ } && test -s conftest.$ac_objext; then
13877+ pgac_cv_ldap_safe=yes
13878+ else
13879+ $as_echo "$as_me: failed program was:" >&5
13880+ sed 's/^/| /' conftest.$ac_ext >&5
13881+
13882+ pgac_cv_ldap_safe=no
13883+ fi
13884+
13885+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13886+ fi
13887+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_ldap_safe" >&5
13888+ $as_echo "$pgac_cv_ldap_safe" >&6; }
13889+
13890+ if test "$pgac_cv_ldap_safe" != yes; then
13891+ { $as_echo "$as_me:$LINENO: WARNING:
13892+ *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
13893+ *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
13894+ *** also uses LDAP will crash on exit." >&5
13895+ $as_echo "$as_me: WARNING:
13896+ *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
13897+ *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
13898+ *** also uses LDAP will crash on exit." >&2;}
13899+ fi
1382313900 else
1382413901
1382513902for ac_header in winldap.h