diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-09-21 14:56:19 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-10-20 05:53:05 +0200 |
commit | 7ba004da246ea2a6c4738c6d3ea5dfafdbdbf1d6 (patch) | |
tree | 11a8b893bf9d6891f69dcdc9e83c354f97833540 /lib/ldb-samba | |
parent | 3193e142d40b9dcdbf7cb55f708dae7bba398c3c (diff) | |
download | samba-7ba004da246ea2a6c4738c6d3ea5dfafdbdbf1d6.tar.gz samba-7ba004da246ea2a6c4738c6d3ea5dfafdbdbf1d6.tar.bz2 samba-7ba004da246ea2a6c4738c6d3ea5dfafdbdbf1d6.zip |
ldb-samba: Added handler to decode dnsProperty attribute
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'lib/ldb-samba')
-rw-r--r-- | lib/ldb-samba/ldif_handlers.c | 21 | ||||
-rw-r--r-- | lib/ldb-samba/ldif_handlers.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index 52c77bd5a2..9c49f755ac 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -915,6 +915,19 @@ static int ldif_write_dnsRecord(struct ldb_context *ldb, void *mem_ctx, } /* + convert a NDR formatted blob to a ldif formatted dnsProperty +*/ +static int ldif_write_dnsProperty(struct ldb_context *ldb, void *mem_ctx, + const struct ldb_val *in, struct ldb_val *out) +{ + return ldif_write_NDR(ldb, mem_ctx, in, out, + sizeof(struct dnsp_DnsProperty), + (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnsProperty, + (ndr_print_fn_t)ndr_print_dnsp_DnsProperty, + true); +} + +/* convert a NDR formatted blob of a supplementalCredentials into text */ static int ldif_write_supplementalCredentialsBlob(struct ldb_context *ldb, void *mem_ctx, @@ -1348,6 +1361,13 @@ static const struct ldb_schema_syntax samba_syntaxes[] = { .comparison_fn = ldb_comparison_binary, .operator_fn = samba_syntax_operator_fn },{ + .name = LDB_SYNTAX_SAMBA_DNSPROPERTY, + .ldif_read_fn = ldb_handler_copy, + .ldif_write_fn = ldif_write_dnsProperty, + .canonicalise_fn = ldb_handler_copy, + .comparison_fn = ldb_comparison_binary, + .operator_fn = samba_syntax_operator_fn + },{ .name = LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS, .ldif_read_fn = ldb_handler_copy, .ldif_write_fn = ldif_write_supplementalCredentialsBlob, @@ -1480,6 +1500,7 @@ static const struct { /* These NDR encoded things we want to be able to read with --show-binary */ { "dnsRecord", LDB_SYNTAX_SAMBA_DNSRECORD }, + { "dnsProperty", LDB_SYNTAX_SAMBA_DNSPROPERTY }, { "supplementalCredentials", LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS}, { "partialAttributeSet", LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET} }; diff --git a/lib/ldb-samba/ldif_handlers.h b/lib/ldb-samba/ldif_handlers.h index eb6c656ba5..41a22085ce 100644 --- a/lib/ldb-samba/ldif_handlers.h +++ b/lib/ldb-samba/ldif_handlers.h @@ -13,6 +13,7 @@ #define LDB_SYNTAX_SAMBA_REPLUPTODATEVECTOR "LDB_SYNTAX_SAMBA_REPLUPTODATEVECTOR" #define LDB_SYNTAX_SAMBA_RANGE64 "LDB_SYNTAX_SAMBA_RANGE64" #define LDB_SYNTAX_SAMBA_DNSRECORD "LDB_SYNTAX_SAMBA_DNSRECORD" +#define LDB_SYNTAX_SAMBA_DNSPROPERTY "LDB_SYNTAX_SAMBA_DNSPROPERTY" #define LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS "LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS" #define LDB_SYNTAX_SAMBA_SDDL_SECURITY_DESCRIPTOR "LDB_SYNTAX_SAMBA_SDDL" #define LDB_SYNTAX_SAMBA_TRUSTAUTHINOUTBLOB "LDB_SYNTAX_SAMBA_TRUSTAUTHINOUTBLOB" |