[SCM] Samba Shared Repository - branch master updated - b0a95ad2f68cfc87822420c22216d83c0abf0690

Jelmer Vernooij jelmer at samba.org
Wed Sep 24 22:01:38 GMT 2008


The branch, master has been updated
       via  b0a95ad2f68cfc87822420c22216d83c0abf0690 (commit)
      from  31e10643c998e64c0ec432553ac9193d978e43f4 (commit)

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


- Log -----------------------------------------------------------------
commit b0a95ad2f68cfc87822420c22216d83c0abf0690
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Sep 24 23:59:59 2008 +0200

    Revert LDB return code patches from Matthias.

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

Summary of changes:
 source4/dsdb/samdb/ldb_modules/kludge_acl.c     |    4 +-
 source4/dsdb/samdb/ldb_modules/proxy.c          |   12 +++---
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |   14 ++++----
 source4/dsdb/samdb/ldb_modules/schema_fsmo.c    |    2 +-
 source4/lib/ldb-samba/ldif_handlers.c           |    2 +-
 source4/lib/ldb/common/attrib_handlers.c        |   22 ++++++------
 source4/lib/ldb/common/ldb_attributes.c         |    8 ++--
 source4/lib/ldb/common/ldb_debug.c              |    2 +-
 source4/lib/ldb/common/ldb_ldif.c               |   18 +++++-----
 source4/lib/ldb/common/ldb_modules.c            |    6 ++--
 source4/lib/ldb/ldb_ildap/ldb_ildap.c           |    6 ++--
 source4/lib/ldb/ldb_ldap/ldb_ldap.c             |   18 +++++-----
 source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c       |   28 +++++++-------
 source4/lib/ldb/ldb_tdb/ldb_cache.c             |   22 ++++++------
 source4/lib/ldb/ldb_tdb/ldb_pack.c              |   12 +++---
 source4/lib/ldb/ldb_tdb/ldb_search.c            |   42 +++++++++++-----------
 source4/lib/ldb/ldb_tdb/ldb_tdb.c               |   20 +++++-----
 source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c          |    2 +-
 source4/lib/ldb/modules/operational.c           |    4 +-
 source4/lib/ldb/modules/paged_results.c         |    2 +-
 source4/lib/ldb/modules/skel.c                  |    2 +-
 source4/lib/ldb_wrap.c                          |    2 +-
 22 files changed, 125 insertions(+), 125 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
index 11e2b7a..6836f95 100644
--- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c
+++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
@@ -142,7 +142,7 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess
 		ldb_msg_add_string(msg, attrName, attr_list[i]);
 	}
 	talloc_free(mem_ctx);
-	return LDB_SUCCESS;
+	return 0;
 
 }
 /* read all objectClasses */
@@ -201,7 +201,7 @@ static int kludge_acl_childClasses(struct ldb_context *ldb, struct ldb_message *
 		}
 	}
 
-	return LDB_SUCCESS;
+	return 0;
 
 }
 
diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c
index 7aa78e9..d0a315e 100644
--- a/source4/dsdb/samdb/ldb_modules/proxy.c
+++ b/source4/dsdb/samdb/ldb_modules/proxy.c
@@ -66,7 +66,7 @@ static int load_proxy_info(struct ldb_module *module)
 
 	/* see if we have already loaded it */
 	if (proxy->upstream != NULL) {
-		return LDB_SUCCESS;
+		return 0;
 	}
 
 	dn = ldb_dn_new(proxy, module->ldb, "@PROXYINFO");
@@ -145,7 +145,7 @@ static int load_proxy_info(struct ldb_module *module)
 
 	talloc_free(res);
 
-	return LDB_SUCCESS;
+	return 0;
 
 failed:
 	talloc_free(res);
@@ -153,7 +153,7 @@ failed:
 	talloc_free(proxy->newdn);
 	talloc_free(proxy->upstream);
 	proxy->upstream = NULL;
-	return LDB_ERR_OPERATIONS_ERROR;
+	return -1;
 }
 
 
@@ -259,7 +259,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
 	}
 
 	if (load_proxy_info(module) != 0) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	/* see if the dn is within olddn */
@@ -269,7 +269,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
 
 	newreq = talloc(module, struct ldb_request);
 	if (newreq == NULL) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	newreq->op.search.tree = proxy_convert_tree(module, req->op.search.tree);
@@ -298,7 +298,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
 	if (ret != LDB_SUCCESS) {
 		ldb_set_errstring(module->ldb, ldb_errstring(proxy->upstream));
 		talloc_free(newreq);
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	for (i = 0; i < newreq->op.search.res->count; i++) {
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 34e235a..dd5faf8 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -124,16 +124,16 @@ static int add_time_element(struct ldb_message *msg, const char *attr, time_t t)
 	char *s;
 
 	if (ldb_msg_find_element(msg, attr) != NULL) {
-		return LDB_SUCCESS;
+		return 0;
 	}
 
 	s = ldb_timestring(msg, t);
 	if (s == NULL) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	if (ldb_msg_add_string(msg, attr, s) != 0) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	el = ldb_msg_find_element(msg, attr);
@@ -141,7 +141,7 @@ static int add_time_element(struct ldb_message *msg, const char *attr, time_t t)
 	   is ignored */
 	el->flags = LDB_FLAG_MOD_REPLACE;
 
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /*
@@ -152,11 +152,11 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
 	struct ldb_message_element *el;
 
 	if (ldb_msg_find_element(msg, attr) != NULL) {
-		return LDB_SUCCESS;
+		return 0;
 	}
 
 	if (ldb_msg_add_fmt(msg, attr, "%llu", (unsigned long long)v) != 0) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	el = ldb_msg_find_element(msg, attr);
@@ -164,7 +164,7 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
 	   is ignored */
 	el->flags = LDB_FLAG_MOD_REPLACE;
 
-	return LDB_SUCCESS;
+	return 0;
 }
 
 static int replmd_replPropertyMetaData1_attid_sort(const struct replPropertyMetaData1 *m1,
diff --git a/source4/dsdb/samdb/ldb_modules/schema_fsmo.c b/source4/dsdb/samdb/ldb_modules/schema_fsmo.c
index 7c6a6dd..968b19c 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_fsmo.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_fsmo.c
@@ -307,7 +307,7 @@ static int generate_dITContentRules(struct ldb_context *ldb, struct ldb_message
 			}
 		}
 	}
-	return LDB_SUCCESS;
+	return 0;
 }
 
 
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c
index 46ea095..a16582d 100644
--- a/source4/lib/ldb-samba/ldif_handlers.c
+++ b/source4/lib/ldb-samba/ldif_handlers.c
@@ -134,7 +134,7 @@ static int ldb_canonicalise_objectSid(struct ldb_context *ldb, void *mem_ctx,
 			/* Perhaps not a string after all */
 			return ldb_handler_copy(ldb, mem_ctx, in, out);
 		}
-		return LDB_SUCCESS;
+		return 0;
 	}
 	return ldb_handler_copy(ldb, mem_ctx, in, out);
 }
diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c
index 6f1b081..fb57e2d 100644
--- a/source4/lib/ldb/common/attrib_handlers.c
+++ b/source4/lib/ldb/common/attrib_handlers.c
@@ -38,9 +38,9 @@ int ldb_handler_copy(struct ldb_context *ldb, void *mem_ctx,
 	*out = ldb_val_dup(mem_ctx, in);
 	if (in->length > 0 && out->data == NULL) {
 		ldb_oom(ldb);
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /*
@@ -57,13 +57,13 @@ int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
 	int l;
 
 	if (!in || !out || !(in->data)) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	out->data = (uint8_t *)ldb_casefold(ldb, mem_ctx, (const char *)(in->data), in->length);
 	if (out->data == NULL) {
 		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_handler_fold: unable to casefold string [%s]", in->data);
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	s = (char *)(out->data);
@@ -96,7 +96,7 @@ int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
 	}
 
 	out->length = strlen((char *)out->data);
-	return LDB_SUCCESS;
+	return 0;
 }
 
 
@@ -111,14 +111,14 @@ int ldb_canonicalise_Integer(struct ldb_context *ldb, void *mem_ctx,
 	char *end;
 	long long i = strtoll((char *)in->data, &end, 0);
 	if (*end != 0) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	out->data = (uint8_t *)talloc_asprintf(mem_ctx, "%lld", i);
 	if (out->data == NULL) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	out->length = strlen((char *)out->data);
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /*
@@ -251,7 +251,7 @@ int ldb_canonicalise_dn(struct ldb_context *ldb, void *mem_ctx,
 	}
 	out->length = strlen((char *)out->data);
 
-	ret = LDB_SUCCESS;
+	ret = 0;
 
 done:
 	talloc_free(dn);
@@ -305,10 +305,10 @@ int ldb_canonicalise_utctime(struct ldb_context *ldb, void *mem_ctx,
 	time_t t = ldb_string_to_time((char *)in->data);
 	out->data = (uint8_t *)ldb_timestring(mem_ctx, t);
 	if (out->data == NULL) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	out->length = strlen((char *)out->data);
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /*
diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c
index 0fbb5e2..747f241 100644
--- a/source4/lib/ldb/common/ldb_attributes.c
+++ b/source4/lib/ldb/common/ldb_attributes.c
@@ -61,7 +61,7 @@ int ldb_schema_attribute_add_with_syntax(struct ldb_context *ldb,
 			   struct ldb_schema_attribute, n);
 	if (a == NULL) {
 		ldb_oom(ldb);
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	ldb->schema.attributes = a;
 
@@ -70,7 +70,7 @@ int ldb_schema_attribute_add_with_syntax(struct ldb_context *ldb,
 		if (cmp == 0) {
 			/* silently ignore attempts to overwrite fixed attributes */
 			if (a[i].flags & LDB_ATTR_FLAG_FIXED) {
-				return LDB_SUCCESS;
+				return 0;
 			}
 			if (a[i].flags & LDB_ATTR_FLAG_ALLOCATED) {
 				talloc_free(discard_const_p(char, a[i].name));
@@ -93,11 +93,11 @@ int ldb_schema_attribute_add_with_syntax(struct ldb_context *ldb,
 		a[i].name = talloc_strdup(a, a[i].name);
 		if (a[i].name == NULL) {
 			ldb_oom(ldb);
-			return LDB_ERR_OPERATIONS_ERROR;
+			return -1;
 		}
 	}
 
-	return LDB_SUCCESS;
+	return 0;
 }
 
 static const struct ldb_schema_syntax ldb_syntax_default = {
diff --git a/source4/lib/ldb/common/ldb_debug.c b/source4/lib/ldb/common/ldb_debug.c
index 8e1c491..0f78e37 100644
--- a/source4/lib/ldb/common/ldb_debug.c
+++ b/source4/lib/ldb/common/ldb_debug.c
@@ -43,7 +43,7 @@ int ldb_set_debug(struct ldb_context *ldb,
 {
 	ldb->debug_ops.debug = debug;
 	ldb->debug_ops.context = context;
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /*
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index 6cbd30f..fb93e17 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -191,19 +191,19 @@ int ldb_should_b64_encode(const struct ldb_val *val)
 	uint8_t *p = val->data;
 
 	if (val->length == 0) {
-		return LDB_SUCCESS;
+		return 0;
 	}
 
 	if (p[0] == ' ' || p[0] == ':') {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return 1;
 	}
 
 	for (i=0; i<val->length; i++) {
 		if (!isprint(p[i]) || p[i] == '\n') {
-			return LDB_ERR_OPERATIONS_ERROR;
+			return 1;
 		}
 	}
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /* this macro is used to handle the return checking on fprintf_fn() */
@@ -444,12 +444,12 @@ static int next_attr(void *mem_ctx, char **s, const char **attr, struct ldb_val
 		value->length = 0;
 		*attr = "-";
 		*s += 2;
-		return LDB_SUCCESS;
+		return 0;
 	}
 
 	p = strchr(*s, ':');
 	if (!p) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	*p++ = 0;
@@ -487,7 +487,7 @@ static int next_attr(void *mem_ctx, char **s, const char **attr, struct ldb_val
 		int len = ldb_base64_decode((char *)value->data);
 		if (len == -1) {
 			/* it wasn't valid base64 data */
-			return LDB_ERR_OPERATIONS_ERROR;
+			return -1;
 		}
 		value->length = len;
 	}
@@ -496,11 +496,11 @@ static int next_attr(void *mem_ctx, char **s, const char **attr, struct ldb_val
 		int len = ldb_read_data_file(mem_ctx, value);
 		if (len == -1) {
 			/* an error occured hile trying to retrieve the file */
-			return LDB_ERR_OPERATIONS_ERROR;
+			return -1;
 		}
 	}
 
-	return LDB_SUCCESS;
+	return 0;
 }
 
 
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 046d36e..c0cd616 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -279,16 +279,16 @@ int ldb_register_module(const struct ldb_module_ops *ops)
 	struct ops_list_entry *entry = talloc(talloc_autofree_context(), struct ops_list_entry);
 
 	if (ldb_find_module_ops(ops->name) != NULL)
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 
 	if (entry == NULL)
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 
 	entry->ops = ops;
 	entry->next = registered_modules;
 	registered_modules = entry;
 
-	return LDB_SUCCESS;
+	return 0;
 }
 
 void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index 3a5da89..5ad671e 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -753,7 +753,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
 	module = talloc(ldb, struct ldb_module);
 	if (!module) {
 		ldb_oom(ldb);
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	talloc_set_name_const(module, "ldb_ildap backend");
 	module->ldb		= ldb;
@@ -819,11 +819,11 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
 	}
 
 	*_module = module;
-	return LDB_SUCCESS;
+	return 0;
 
 failed:
 	talloc_free(module);
-	return LDB_ERR_OPERATIONS_ERROR;
+	return -1;
 }
 
 _PUBLIC_ const struct ldb_backend_ops ldb_ldap_backend_ops = {
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index 5026f9c..a4534c5 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -180,14 +180,14 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 	count = ldap_count_values_len(bval);
 
 	if (count <= 0) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	el = talloc_realloc(msg, msg->elements, struct ldb_message_element, 
 			      msg->num_elements + 1);
 	if (!el) {
 		errno = ENOMEM;
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	msg->elements = el;
@@ -197,7 +197,7 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 	el->name = talloc_strdup(msg->elements, attr);
 	if (!el->name) {
 		errno = ENOMEM;
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	el->flags = 0;
 
@@ -205,7 +205,7 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 	el->values = talloc_array(msg->elements, struct ldb_val, count);
 	if (!el->values) {
 		errno = ENOMEM;
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 
 	for (i=0;i<count;i++) {
@@ -214,7 +214,7 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 		el->values[i].data = talloc_size(el->values, bval[i]->bv_len+1);
 		if (!el->values[i].data) {
 			errno = ENOMEM;
-			return LDB_ERR_OPERATIONS_ERROR;
+			return -1;
 		}
 		memcpy(el->values[i].data, bval[i]->bv_val, bval[i]->bv_len);
 		el->values[i].data[bval[i]->bv_len] = 0;
@@ -224,7 +224,7 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 
 	msg->num_elements++;
 
-	return LDB_SUCCESS;
+	return 0;
 }
 
 /*
@@ -785,7 +785,7 @@ static int lldb_connect(struct ldb_context *ldb,
 	if (module == NULL) {
 		ldb_oom(ldb);
 		talloc_free(lldb);
-		return LDB_ERR_OPERATIONS_ERROR;
+		return -1;
 	}
 	talloc_set_name_const(module, "ldb_ldap backend");
 	module->ldb		= ldb;
@@ -819,11 +819,11 @@ static int lldb_connect(struct ldb_context *ldb,
 	}
 
 	*_module = module;
-	return LDB_SUCCESS;
+	return 0;
 
 failed:
 	talloc_free(module);
-	return LDB_ERR_OPERATIONS_ERROR;
+	return -1;
 }
 
 const struct ldb_backend_ops ldb_ldap_backend_ops = {
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index 7e4fe1d..a0e63c8 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -670,10 +670,10 @@ static int lsqlite3_safe_rollback(sqlite3 *sqlite)
 			printf("lsqlite3_safe_rollback: Error: %s\n", errmsg);
 			free(errmsg);
 		}
-		return SQLITE_ERROR;
+		return -1;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list