[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Feb 26 15:33:57 MST 2010


The branch, master has been updated
       via  b28afd2... s4:ldb_dn: fix an uninitialized variable (found by make valgrindtest)
       via  47fafe8... s4:ldb_dn: remove dn->ext_linearized when ext_components is modified.
       via  c7432e4... s4:ldb_dn: reset dn->ext_comp_num in ldb_dn_explode()
       via  4bad696... s4:dsdb/schema: fix validation of DNs
      from  2caa2a0... s4:provision.zone - fix port of "_ldap._tcp.gc._msdcs"

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b28afd2bcc825e9fef415f3a256e39e4af1ae84e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Feb 26 10:53:06 2010 +0100

    s4:ldb_dn: fix an uninitialized variable (found by make valgrindtest)
    
    metze

commit 47fafe801b5a4a054dcde301b892cda9c0ababb0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Feb 26 15:48:02 2010 +0100

    s4:ldb_dn: remove dn->ext_linearized when ext_components is modified.
    
    metze

commit c7432e49506561316f42bf0a26dd21de563c8eda
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 25 23:19:53 2010 +0100

    s4:ldb_dn: reset dn->ext_comp_num in ldb_dn_explode()
    
    metze

commit 4bad696f9ef3bdc3a1a9dc6b98a58d7071b994d7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Feb 26 16:48:09 2010 +0100

    s4:dsdb/schema: fix validation of DNs
    
    ldb_dn_extended_filter() removes all but the listed components,
    I didn't noticed that when writting the code.
    Doing a ldb_dn_remove_extended_components(dn2) is wrong.
    
    This was hidden by some bugs in the ldb_dn code.
    
    metze

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

Summary of changes:
 source4/dsdb/schema/schema_syntax.c |    1 -
 source4/lib/ldb/common/ldb_dn.c     |   13 +++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 877200b..bdd22f8 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -1742,7 +1742,6 @@ static WERROR dsdb_syntax_DN_validate_one_val(struct ldb_context *ldb,
 	 * one.
 	 */
 	ldb_dn_extended_filter(dn, extended_list);
-	ldb_dn_remove_extended_components(dn2);
 
 	dn_str = ldb_dn_get_extended_linearized(tmp_ctx, dn, 0);
 	if (dn_str == NULL) {
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index c395be2..04e769f 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -333,8 +333,8 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 	/* make sure we free this if alloced previously before replacing */
 	talloc_free(dn->components);
 
-	talloc_free(dn->ext_components);
-	dn->ext_components = NULL;
+	LDB_FREE(dn->ext_components);
+	dn->ext_comp_num = 0;
 
 	/* in the common case we have 3 or more components */
 	/* make sure all components are zeroed, other functions depend on it */
@@ -805,7 +805,7 @@ static int ldb_dn_extended_component_compare(const void *p1, const void *p2)
 char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode)
 {
 	const char *linearized = ldb_dn_get_linearized(dn);
-	char *p;
+	char *p = NULL;
 	int i;
 
 	if (!linearized) {
@@ -894,6 +894,7 @@ void ldb_dn_extended_filter(struct ldb_dn *dn, const char * const *accept)
 			i--;
 		}
 	}
+	LDB_FREE(dn->ext_linearized);
 }
 
 
@@ -1424,9 +1425,7 @@ bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base)
 
 	/* Wipe the ext_linearized DN,
 	 * the GUID and SID are almost certainly no longer valid */
-	if (dn->ext_linearized) {
-		LDB_FREE(dn->ext_linearized);
-	}
+	LDB_FREE(dn->ext_linearized);
 
 	LDB_FREE(dn->ext_components);
 	dn->ext_comp_num = 0;
@@ -1935,6 +1934,7 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
 				}
 				return LDB_SUCCESS;
 			}
+			LDB_FREE(dn->ext_linearized);
 		}
 	}
 
@@ -1972,6 +1972,7 @@ void ldb_dn_remove_extended_components(struct ldb_dn *dn)
 {
 	dn->ext_comp_num = 0;
 	LDB_FREE(dn->ext_components);
+	LDB_FREE(dn->ext_linearized);
 }
 
 bool ldb_dn_is_valid(struct ldb_dn *dn)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list