Author: metze
Date: 2007-07-25 07:23:20 +0000 (Wed, 25 Jul 2007)
New Revision: 24037

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24037

Log:
only setup sasl wrapping after a successful bind

metze
Modified:
   branches/SAMBA_3_2/source/libads/sasl.c


Changeset:
Modified: branches/SAMBA_3_2/source/libads/sasl.c
===================================================================
--- branches/SAMBA_3_2/source/libads/sasl.c     2007-07-24 22:28:19 UTC (rev 
24036)
+++ branches/SAMBA_3_2/source/libads/sasl.c     2007-07-25 07:23:20 UTC (rev 
24037)
@@ -709,10 +709,12 @@
 
        rc = ldap_sasl_bind_s(ads->ldap.ld, NULL, "GSSAPI", &cred, NULL, NULL, 
                              &scred);
+       gss_release_buffer(&minor_status, &input_token);
        status = ADS_ERROR(rc);
+       if (!ADS_ERR_OK(status)) {
+               goto failed;
+       }
 
-       gss_release_buffer(&minor_status, &input_token);
-
        if (ads->ldap.wrap_type > ADS_SASLWRAP_TYPE_PLAIN) {
                gss_rc = gss_wrap_size_limit(&minor_status, context_handle,
                                             (ads->ldap.wrap_type == 
ADS_SASLWRAP_TYPE_SEAL),

Reply via email to