diff options
author | Noah Misch <noah@leadboat.com> | 2014-07-22 11:01:03 -0400 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2014-07-22 11:01:35 -0400 |
commit | fd18965e33da9dc7326803e61cf28d82237e3bba (patch) | |
tree | 34618b2267224ef66ee35118d8ac90926a9b6adf /configure | |
parent | 87c4232fd35fc3d1ff06189e886bffb382f6ca87 (diff) | |
download | postgresql-fd18965e33da9dc7326803e61cf28d82237e3bba.tar.gz |
Diagnose incompatible OpenLDAP versions during build and test.
With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, PostgreSQL
backends can crash at exit. Raise a warning during "configure" based on
the compile-time OpenLDAP version number, and test the crash scenario in
the dblink test suite. Back-patch to 9.0 (all supported versions).
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -9477,6 +9477,17 @@ fi fi +# PGAC_LDAP_SAFE +# -------------- +# PostgreSQL sometimes loads libldap_r and plain libldap into the same +# process. Check for OpenLDAP versions known not to tolerate doing so; assume +# non-OpenLDAP implementations are safe. The dblink test suite exercises the +# hazardous interaction directly. + + + + + if test "$with_ldap" = yes ; then if test "$PORTNAME" != "win32"; then for ac_header in ldap.h @@ -9493,6 +9504,47 @@ fi done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5 +$as_echo_n "checking for compatible LDAP implementation... " >&6; } +if ${pgac_cv_ldap_safe+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ldap.h> +#if !defined(LDAP_VENDOR_VERSION) || \ + (defined(LDAP_API_FEATURE_X_OPENLDAP) && \ + LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431) +choke me +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_ldap_safe=yes +else + pgac_cv_ldap_safe=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5 +$as_echo "$pgac_cv_ldap_safe" >&6; } + +if test "$pgac_cv_ldap_safe" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend +*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and +*** also uses LDAP will crash on exit." >&5 +$as_echo "$as_me: WARNING: +*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend +*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and +*** also uses LDAP will crash on exit." >&2;} +fi else for ac_header in winldap.h do : |