summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_ldif.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-11-14 09:40:02 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-11-17 10:06:58 +1100
commit5b796adb125174084cfc2a6f04cfdac5e9324ef8 (patch)
tree1895a345882f9b10d32eeedacfa37c883a462199 /source4/lib/ldb/common/ldb_ldif.c
parent00b63434063a128662d4ce83ce382fc2e6102d22 (diff)
downloadsamba-5b796adb125174084cfc2a6f04cfdac5e9324ef8.tar.gz
samba-5b796adb125174084cfc2a6f04cfdac5e9324ef8.tar.bz2
samba-5b796adb125174084cfc2a6f04cfdac5e9324ef8.zip
Print unconvertable ldb element values as base64.
If an LDB element cannot be converted into a printable form, we should still print it, just with safety applied. Andrew Bartlett
Diffstat (limited to 'source4/lib/ldb/common/ldb_ldif.c')
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index 538ff8feaa..69490e670b 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -328,8 +328,10 @@ int ldb_ldif_write(struct ldb_context *ldb,
for (j=0;j<msg->elements[i].num_values;j++) {
struct ldb_val v;
ret = a->syntax->ldif_write_fn(ldb, mem_ctx, &msg->elements[i].values[j], &v);
- CHECK_RET;
- if (ldb_should_b64_encode(&v)) {
+ if (ret != LDB_SUCCESS) {
+ v = msg->elements[i].values[j];
+ }
+ if (ret != LDB_SUCCESS || ldb_should_b64_encode(&v)) {
ret = fprintf_fn(private_data, "%s:: ",
msg->elements[i].name);
CHECK_RET;