diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2011-01-18 00:51:30 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2011-01-18 00:40:01 +0100 |
commit | 1667ff79caa91d6bd97df127fb4a3b3d0fa5c3a1 (patch) | |
tree | 9748c9d40fcf8aa3020e40becef6110114c287ba /source4/lib | |
parent | fb0df534f46ccee8d541d5512abbcc9cd8247e53 (diff) | |
download | samba-1667ff79caa91d6bd97df127fb4a3b3d0fa5c3a1.tar.gz samba-1667ff79caa91d6bd97df127fb4a3b3d0fa5c3a1.tar.bz2 samba-1667ff79caa91d6bd97df127fb4a3b3d0fa5c3a1.zip |
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 <kamenim@samba.org>
Autobuild-Date: Tue Jan 18 00:40:01 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 5 |
1 files changed, 4 insertions, 1 deletions
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;j<msg->elements[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; |