[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Tue Oct 19 04:53:01 MDT 2010


The branch, master has been updated
       via  d652803 ldb:"ldb_schema_attribute_by_name_internal" - support the whole unsigned int range
       via  a6d70dd s4:dsdb/schema/schema_init.c - remove a duplicated "talloc_free"
      from  a9b58f6 s4:samdb.py - remove a pointless comment

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


- Log -----------------------------------------------------------------
commit d652803c12b79315fe6a1d0410b82492908950e4
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Oct 19 11:30:24 2010 +0200

    ldb:"ldb_schema_attribute_by_name_internal" - support the whole unsigned int range
    
    Commit 8556602b048e825b35df314d6865f997823ec2bb wasn't quite right - it only
    restored the functionality on the positive integer range.
    
    This one however should now really support the whole unsigned range.
    
    Autobuild-User: Matthias Dieter Wallnöfer <mdw at samba.org>
    Autobuild-Date: Tue Oct 19 10:52:08 UTC 2010 on sn-devel-104

commit a6d70ddf86842db6fbd76da857cb0c70fb48aacf
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Tue Oct 19 11:46:34 2010 +0200

    s4:dsdb/schema/schema_init.c - remove a duplicated "talloc_free"

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

Summary of changes:
 source4/dsdb/schema/schema_init.c       |    1 -
 source4/lib/ldb/common/ldb_attributes.c |   12 +++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 54fc6b8..6dbf9ba 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -80,7 +80,6 @@ static WERROR _dsdb_prefixmap_from_ldb_val(const struct ldb_val *pfm_ldb_val,
 				(ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob);
 	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 		NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err);
-		talloc_free(temp_ctx);
 		DEBUG(0,("_dsdb_prefixmap_from_ldb_val: Failed to parse prefixmap of length %u: %s\n",
 			 (unsigned int)pfm_ldb_val->length, ndr_map_error2string(ndr_err)));
 		talloc_free(temp_ctx);
diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c
index ea6fafd..21a3e6e 100644
--- a/source4/lib/ldb/common/ldb_attributes.c
+++ b/source4/lib/ldb/common/ldb_attributes.c
@@ -123,8 +123,8 @@ static const struct ldb_schema_attribute *ldb_schema_attribute_by_name_internal(
 	const char *name)
 {
 	/* for binary search we need signed variables */
-	int r, i, e, b = 0;
-	unsigned int u_i;
+	unsigned int i, e, b = 0;
+	int r;
 	const struct ldb_schema_attribute *def = &ldb_attribute_default;
 
 	/* as handlers are sorted, '*' must be the first if present */
@@ -136,20 +136,18 @@ static const struct ldb_schema_attribute *ldb_schema_attribute_by_name_internal(
 	/* do a binary search on the array */
 	e = ldb->schema.num_attributes - 1;
 
-	while (b <= e) {
+	while ((b <= e) && (e != (unsigned int) -1)) {
 		i = (b + e) / 2;
 
-		u_i = (unsigned int) i;
-		r = ldb_attr_cmp(name, ldb->schema.attributes[u_i].name);
+		r = ldb_attr_cmp(name, ldb->schema.attributes[i].name);
 		if (r == 0) {
-			return &ldb->schema.attributes[u_i];
+			return &ldb->schema.attributes[i];
 		}
 		if (r < 0) {
 			e = i - 1;
 		} else {
 			b = i + 1;
 		}
-
 	}
 
 	return def;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list