1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

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
This commit is contained in:
Kamen Mazdrashki 2011-01-18 00:51:30 +02:00
parent fb0df534f4
commit 1667ff79ca

View File

@ -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;