From c83f5a530d867fe3d3fb0ebe89f0d63d6c34ed24 Mon Sep 17 00:00:00 2001 From: Stig Venaas Date: Sat, 22 Jun 2002 11:41:36 +0000 Subject: [PATCH] Added test for ldap_start_tls_s() --- ext/ldap/config.m4 | 4 +++- ext/ldap/ldap.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4 index ab9de937e5..2113ca2961 100644 --- a/ext/ldap/config.m4 +++ b/ext/ldap/config.m4 @@ -103,6 +103,8 @@ if test "$PHP_LDAP" != "no"; then fi CPPFLAGS=$_SAVE_CPPFLAGS - dnl Solaris 2.8 claims to be 2004 API, but doesn't have ldap_parse_reference + dnl Solaris 2.8 claims to be 2004 API, but doesn't have + dnl ldap_parse_reference() nor ldap_start_tls_s() AC_CHECK_FUNCS(ldap_parse_reference) + AC_CHECK_FUNCS(ldap_start_tls_s) fi diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 2cec061ff1..5d8b03559f 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2028,6 +2028,7 @@ PHP_FUNCTION(ldap_rename) Start TLS */ PHP_FUNCTION(ldap_start_tls) { +#ifdef HAVE_LDAP_START_TLS_S pval **link; ldap_linkdata *ld; @@ -2044,6 +2045,10 @@ PHP_FUNCTION(ldap_start_tls) } else { RETURN_TRUE; } +#else + php_error(E_ERROR, "ldap_start_tls not available in this LDAP library"); + RETURN_FALSE; +#endif } /* }}} */ #endif -- 2.50.1