Author: gd
Date: 2006-05-12 13:29:51 +0000 (Fri, 12 May 2006)
New Revision: 15542

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

Log:
Close the LDAP connection and free the struct, regardless whether the
simple bind operation was successful or not.

Guenther

Modified:
   branches/SAMBA_3_0/source/passdb/pdb_nds.c
   trunk/source/passdb/pdb_nds.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_nds.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_nds.c  2006-05-11 23:07:34 UTC (rev 
15541)
+++ branches/SAMBA_3_0/source/passdb/pdb_nds.c  2006-05-12 13:29:51 UTC (rev 
15542)
@@ -817,9 +817,9 @@
 
                        /* Attempt simple bind with real or bogus password */
                        rc = ldap_simple_bind_s(ld, dn, clear_text_pw);
+                       ldap_unbind(ld);
                        if (rc == LDAP_SUCCESS) {
                                DEBUG(5,("pdb_nds_update_login_attempts: 
ldap_simple_bind_s Successful for %s\n", username));
-                               ldap_unbind(ld);
                        } else {
                                NTSTATUS nt_status = 
NT_STATUS_ACCOUNT_RESTRICTION;
                                DEBUG(5,("pdb_nds_update_login_attempts: 
ldap_simple_bind_s Failed for %s\n", username));

Modified: trunk/source/passdb/pdb_nds.c
===================================================================
--- trunk/source/passdb/pdb_nds.c       2006-05-11 23:07:34 UTC (rev 15541)
+++ trunk/source/passdb/pdb_nds.c       2006-05-12 13:29:51 UTC (rev 15542)
@@ -817,9 +817,9 @@
 
                        /* Attempt simple bind with real or bogus password */
                        rc = ldap_simple_bind_s(ld, dn, clear_text_pw);
+                       ldap_unbind(ld);
                        if (rc == LDAP_SUCCESS) {
                                DEBUG(5,("pdb_nds_update_login_attempts: 
ldap_simple_bind_s Successful for %s\n", username));
-                               ldap_unbind(ld);
                        } else {
                                NTSTATUS nt_status = 
NT_STATUS_ACCOUNT_RESTRICTION;
                                DEBUG(5,("pdb_nds_update_login_attempts: 
ldap_simple_bind_s Failed for %s\n", username));

Reply via email to