From 56766b1f3ed8463a6a5c07658b0c350e4942bc9d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 31 Jul 2007 12:27:25 +0000 Subject: r24103: add some useful debug messages, as not all LDAP libraries support wrapping hooks... metze (This used to be commit 581a1d3a20ffed42ccc7f35f163fd343ed12ccd3) --- source3/libads/sasl.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c index 0bc741c02a..fa9afd7869 100644 --- a/source3/libads/sasl.c +++ b/source3/libads/sasl.c @@ -251,7 +251,13 @@ static ADS_STATUS ads_sasl_spnego_ntlmssp_bind(ADS_STRUCT *ads) ads->ldap.out.sig_size = NTLMSSP_SIG_SIZE; ads->ldap.in.min = 4; ads->ldap.in.max = 0x0FFFFFFF; - ads_setup_sasl_wrapping(ads, &ads_sasl_ntlmssp_ops, ntlmssp_state); + status = ads_setup_sasl_wrapping(ads, &ads_sasl_ntlmssp_ops, ntlmssp_state); + if (!ADS_ERR_OK(status)) { + DEBUG(0, "ads_setup_sasl_wrapping() failed: %s\n", + ads_errstr(status))); + ntlmssp_end(&ntlmssp_state); + return status; + } } else { ntlmssp_end(&ntlmssp_state); } @@ -582,7 +588,12 @@ static ADS_STATUS ads_sasl_spnego_gsskrb5_bind(ADS_STRUCT *ads, const gss_name_t ads->ldap.out.sig_size = max_msg_size - ads->ldap.out.max; ads->ldap.in.min = 4; ads->ldap.in.max = max_msg_size; - ads_setup_sasl_wrapping(ads, &ads_sasl_gssapi_ops, context_handle); + status = ads_setup_sasl_wrapping(ads, &ads_sasl_gssapi_ops, context_handle); + if (!ADS_ERR_OK(status)) { + DEBUG(0, "ads_setup_sasl_wrapping() failed: %s\n", + ads_errstr(status))); + goto failed; + } /* make sure we don't free context_handle */ context_handle = GSS_C_NO_CONTEXT; } @@ -1059,7 +1070,12 @@ static ADS_STATUS ads_sasl_gssapi_do_bind(ADS_STRUCT *ads, const gss_name_t serv ads->ldap.out.sig_size = max_msg_size - ads->ldap.out.max; ads->ldap.in.min = 4; ads->ldap.in.max = max_msg_size; - ads_setup_sasl_wrapping(ads, &ads_sasl_gssapi_ops, context_handle); + status = ads_setup_sasl_wrapping(ads, &ads_sasl_gssapi_ops, context_handle); + if (!ADS_ERR_OK(status)) { + DEBUG(0, "ads_setup_sasl_wrapping() failed: %s\n", + ads_errstr(status))); + goto failed; + } /* make sure we don't free context_handle */ context_handle = GSS_C_NO_CONTEXT; } -- cgit