[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-29-30-g1061773

Jeremy Allison jra at samba.org
Sun Jun 8 21:20:02 GMT 2008


The branch, v3-0-test has been updated
       via  1061773401a2d9e0c7c73b7818cf16dcf2f018d6 (commit)
      from  36729f6f1680310d51f126aa4b7760f11e405a9c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -----------------------------------------------------------------
commit 1061773401a2d9e0c7c73b7818cf16dcf2f018d6
Author: Jeremy Allison <jra at samba.org>
Date:   Sun Jun 8 14:17:47 2008 -0700

    Bugfix noticed by Herb. On using the again: tag as a
    goto target we were not reinitializing the array counts.
    
    From Herb:
    
    This is in the file nsswitch/winbindd_cm.c (samba-3.0.30) line 1236
    
    We have a label again: where we keep trying to find the name of the DC
    from the list of IPs returned by get_dcs. If we fail to figure out the
    name we do a goto again at the end of the function. The problem is we
    don't reset the num_dcs, num_addrs, etc and free the memory in the
    various arrays. This seems wrong to me. I have a winbindd core where
    I have 9 IPs returned for the DCs but at the time of the crash num_dcs
    is 87 and if I look through the array dcs it keeps repeating entries
    from the same group of 9
    
    Jerry, Volker and Guenther please check.
    
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/nsswitch/winbindd_cm.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/nsswitch/winbindd_cm.c b/source/nsswitch/winbindd_cm.c
index 6eb0964..8d303b3 100644
--- a/source/nsswitch/winbindd_cm.c
+++ b/source/nsswitch/winbindd_cm.c
@@ -1250,6 +1250,8 @@ static BOOL find_new_dc(TALLOC_CTX *mem_ctx,
 
 	int i, fd_index;
 
+	*fd = -1;
+
  again:
 	if (!get_dcs(mem_ctx, domain, &dcs, &num_dcs) || (num_dcs == 0))
 		return False;
@@ -1310,6 +1312,19 @@ static BOOL find_new_dc(TALLOC_CTX *mem_ctx,
 	/* We can not continue without the DC's name */
 	winbind_add_failed_connection_entry(domain, dcs[fd_index].name,
 				    NT_STATUS_UNSUCCESSFUL);
+
+	/* Throw away all arrays as we're doing this again. */
+	TALLOC_FREE(dcs);
+	num_dcs = 0;
+
+	TALLOC_FREE(dcnames);
+	num_dcnames = 0;
+
+	TALLOC_FREE(addrs);
+	num_addrs = 0;
+
+	*fd = -1;
+
 	goto again;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list