summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-24 23:59:59 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-25 00:01:05 +0200
commitb0a95ad2f68cfc87822420c22216d83c0abf0690 (patch)
tree8ac863eafe2c9bc1109404b975ad0f5be8b22154 /source4/lib/ldb/common
parent31e10643c998e64c0ec432553ac9193d978e43f4 (diff)
downloadsamba-b0a95ad2f68cfc87822420c22216d83c0abf0690.tar.gz
samba-b0a95ad2f68cfc87822420c22216d83c0abf0690.tar.bz2
samba-b0a95ad2f68cfc87822420c22216d83c0abf0690.zip
Revert LDB return code patches from Matthias.
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/attrib_handlers.c22
-rw-r--r--source4/lib/ldb/common/ldb_attributes.c8
-rw-r--r--source4/lib/ldb/common/ldb_debug.c2
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c18
-rw-r--r--source4/lib/ldb/common/ldb_modules.c6
5 files changed, 28 insertions, 28 deletions
diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c
index 6f1b0815d7..fb57e2dadc 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 0fbb5e2bfb..747f241781 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 8e1c491f12..0f78e37c1c 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 6cbd30f377..fb93e17c6c 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 046d36edf1..c0cd616a76 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,