summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_ldif.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/common/ldb_ldif.c')
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c18
1 files changed, 9 insertions, 9 deletions
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;
}