From 1667ff79caa91d6bd97df127fb4a3b3d0fa5c3a1 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Tue, 18 Jan 2011 00:51:30 +0200 Subject: s4-ldb_ldif: Take into account LDB_FLG_SHOW_BINARY when user requires binary data to be displayed using samba user-friendly ldif handlers Found using following test search: bin/ldbsearch -H st/dc/private/sam.ldb -b "CN=Deleted Objects,DC=samba,DC=example,DC=com" \ "(objectGUID=97b52eac-6d89-434d-b935-1e5f2e086ffc)" replPropertyMetaData --show-deleted --show-binary Autobuild-User: Kamen Mazdrashki Autobuild-Date: Tue Jan 18 00:40:01 CET 2011 on sn-devel-104 --- source4/lib/ldb/common/ldb_ldif.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/lib/ldb/common') diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index 9be49fb73b..f837012e69 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -329,11 +329,14 @@ int ldb_ldif_write(struct ldb_context *ldb, for (j=0;jelements[i].num_values;j++) { struct ldb_val v; + bool use_b64_encode; ret = a->syntax->ldif_write_fn(ldb, mem_ctx, &msg->elements[i].values[j], &v); if (ret != LDB_SUCCESS) { v = msg->elements[i].values[j]; } - if (ret != LDB_SUCCESS || ldb_should_b64_encode(ldb, &v)) { + use_b64_encode = !(ldb->flags & LDB_FLG_SHOW_BINARY) + && ldb_should_b64_encode(ldb, &v); + if (ret != LDB_SUCCESS || use_b64_encode) { ret = fprintf_fn(private_data, "%s:: ", msg->elements[i].name); CHECK_RET; -- cgit