summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-07-31 12:27:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:07 -0500
commit581a1d3a20ffed42ccc7f35f163fd343ed12ccd3 (patch)
tree875a17faaa200ddf494422b94399d4eb898a97be
parentd70a1f82fed64fa332f16407bea7c6671f48c59a (diff)
downloadsamba-581a1d3a20ffed42ccc7f35f163fd343ed12ccd3.tar.gz
samba-581a1d3a20ffed42ccc7f35f163fd343ed12ccd3.tar.xz
samba-581a1d3a20ffed42ccc7f35f163fd343ed12ccd3.zip
r24103: add some useful debug messages, as not all LDAP
libraries support wrapping hooks... metze
-rw-r--r--source/libads/sasl.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/source/libads/sasl.c b/source/libads/sasl.c
index 0bc741c02a4..fa9afd78699 100644
--- a/source/libads/sasl.c
+++ b/source/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;
}