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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index 83f08b609b..b73fee1843 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -185,11 +185,15 @@ char *ldb_base64_encode(void *mem_ctx, const char *buf, int len)
/*
see if a buffer should be base64 encoded
*/
-int ldb_should_b64_encode(const struct ldb_val *val)
+int ldb_should_b64_encode(struct ldb_context *ldb, const struct ldb_val *val)
{
unsigned int i;
uint8_t *p = val->data;
+ if (ldb->flags & LDB_FLG_SHOW_BINARY) {
+ return 0;
+ }
+
if (val->length == 0) {
return 0;
}
@@ -333,7 +337,7 @@ int ldb_ldif_write(struct ldb_context *ldb,
if (ret != LDB_SUCCESS) {
v = msg->elements[i].values[j];
}
- if (ret != LDB_SUCCESS || ldb_should_b64_encode(&v)) {
+ if (ret != LDB_SUCCESS || ldb_should_b64_encode(ldb, &v)) {
ret = fprintf_fn(private_data, "%s:: ",
msg->elements[i].name);
CHECK_RET;