summaryrefslogtreecommitdiff
path: root/source3/libads
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
commit56766b1f3ed8463a6a5c07658b0c350e4942bc9d (patch)
treef81c3858fa6d4be43afd4c7597b9023411f1baad /source3/libads
parenta2d6aa829faa65df14ee566e455e807693cc2bd9 (diff)
downloadsamba-56766b1f3ed8463a6a5c07658b0c350e4942bc9d.tar.gz
samba-56766b1f3ed8463a6a5c07658b0c350e4942bc9d.tar.bz2
samba-56766b1f3ed8463a6a5c07658b0c350e4942bc9d.zip
r24103: add some useful debug messages, as not all LDAP
libraries support wrapping hooks... metze (This used to be commit 581a1d3a20ffed42ccc7f35f163fd343ed12ccd3)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/sasl.c22
1 files 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;
}