summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2019-02-19 12:29:58 +0100
committerAndrew Bartlett <abartlet@samba.org>2019-07-04 02:07:20 +0000
commit894ddafc25cae075f313bbe74e5d105e5e581c8d (patch)
treeb2986695b0ecc1984a24b5297cad78d4b36a66ce /lib
parent89d95fb75cd2c29948cb17e01b41a5f0ba960dc5 (diff)
downloadsamba-894ddafc25cae075f313bbe74e5d105e5e581c8d.tar.gz
ldb/ldb_ldif: add LDB_FLAG_FORCE_NO_BASE64_LDIF flag
Flag is used to enforce binary encoded attribute values per attribute. Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/common/ldb_ldif.c4
-rw-r--r--lib/ldb/include/ldb.h6
-rw-r--r--lib/ldb/pyldb.c1
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c
index 92520c476f3..6f7589fef68 100644
--- a/lib/ldb/common/ldb_ldif.c
+++ b/lib/ldb/common/ldb_ldif.c
@@ -364,6 +364,10 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
copy_raw_bytes = true;
} else if (a->flags & LDB_ATTR_FLAG_FORCE_BASE64_LDIF) {
use_b64_encode = true;
+ } else if (msg->elements[i].flags &
+ LDB_FLAG_FORCE_NO_BASE64_LDIF) {
+ use_b64_encode = false;
+ copy_raw_bytes = true;
} else {
use_b64_encode = ldb_should_b64_encode(ldb, &v);
}
diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h
index 75bfbe33bf6..38e76c31605 100644
--- a/lib/ldb/include/ldb.h
+++ b/lib/ldb/include/ldb.h
@@ -140,6 +140,12 @@ struct ldb_dn;
#define LDB_FLAG_MOD_DELETE 3
/**
+ Flag value used in ldb_ldif_write_trace() to enforce binary encoded
+ attribute values per attribute.
+*/
+#define LDB_FLAG_FORCE_NO_BASE64_LDIF 4
+
+/**
flag bits on an element usable only by the internal implementation
*/
#define LDB_FLAG_INTERNAL_MASK 0xFFFFFFF0
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 85bcd84bc14..0858dddad40 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -4353,6 +4353,7 @@ static PyObject* module_init(void)
ADD_LDB_INT(FLAG_MOD_ADD);
ADD_LDB_INT(FLAG_MOD_REPLACE);
ADD_LDB_INT(FLAG_MOD_DELETE);
+ ADD_LDB_INT(FLAG_FORCE_NO_BASE64_LDIF);
ADD_LDB_INT(ATTR_FLAG_HIDDEN);
ADD_LDB_INT(ATTR_FLAG_UNIQUE_INDEX);