diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-21 06:35:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:37 -0500 |
commit | eb0a13025aa6d693c7e9fa213ef04fa58cf60e3e (patch) | |
tree | 5cebae639d75ba412cb4b5521274d148bc6b2525 /source4/lib/ldb/include | |
parent | f29aa44d579a29af0d059ce680d7c6e28c884f2a (diff) | |
download | samba-eb0a13025aa6d693c7e9fa213ef04fa58cf60e3e.tar.gz samba-eb0a13025aa6d693c7e9fa213ef04fa58cf60e3e.tar.bz2 samba-eb0a13025aa6d693c7e9fa213ef04fa58cf60e3e.zip |
r7803: added support in ldb for callers to setup ldif read/write functions,
so that ldbedit, ldbsearch etc can display nice human readable ldif,
while storing the data as binary blobs. This will be used for storing
NDR encoded objectSid and similar attributes, while making the command
line interface sane
(This used to be commit 37e283089a846fc0608fef3981a3447300e33728)
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r-- | source4/lib/ldb/include/ldb.h | 13 | ||||
-rw-r--r-- | source4/lib/ldb/include/ldb_private.h | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 9a3186b41c..48290beb92 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -184,6 +184,19 @@ struct ldb_parse_tree *ldb_parse_tree(void *mem_ctx, const char *s); char *ldb_filter_from_tree(void *mem_ctx, struct ldb_parse_tree *tree); char *ldb_binary_encode(void *ctx, struct ldb_val val); + +/* + functions for controlling ldif encode/decode +*/ +typedef int (*ldb_ldif_handler_t)(struct ldb_context *, const struct ldb_val *, struct ldb_val *); + +struct ldb_ldif_handler { + const char *attr; + ldb_ldif_handler_t read_fn; + ldb_ldif_handler_t write_fn; +}; + + /* initialise a ldb context */ diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h index 8f91b0d9b1..f6c1c7ff46 100644 --- a/source4/lib/ldb/include/ldb_private.h +++ b/source4/lib/ldb/include/ldb_private.h @@ -84,6 +84,10 @@ struct ldb_context { const char *name; void *value; } *opaque; + + /* ldif attribute handling table */ + unsigned ldif_num_handlers; + struct ldb_ldif_handler *ldif_handlers; }; /* the modules init function */ |