diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-09-23 13:28:06 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-10-04 15:08:55 +1100 |
commit | 1df100393b6788e7f94876b957f6110bd91f958e (patch) | |
tree | 37b225618c98f687b9db75a1d21902695841bfca /lib | |
parent | d6c949b0748014587a05d2af1c2b4770d16d68a9 (diff) | |
download | samba-1df100393b6788e7f94876b957f6110bd91f958e.tar.gz samba-1df100393b6788e7f94876b957f6110bd91f958e.tar.bz2 samba-1df100393b6788e7f94876b957f6110bd91f958e.zip |
s4-ldb: enable display of partialAttributeSet with --show-binary
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ldb-samba/ldif_handlers.c | 23 | ||||
-rw-r--r-- | lib/ldb-samba/ldif_handlers.h | 1 |
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index 37e69663da..52c77bd5a2 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -940,6 +940,19 @@ static int ldif_write_trustAuthInOutBlob(struct ldb_context *ldb, void *mem_ctx, true); } +/* + convert a NDR formatted blob of a partialAttributeSet into text +*/ +static int ldif_write_partialAttributeSet(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 partialAttributeSetBlob), + (ndr_pull_flags_fn_t)ndr_pull_partialAttributeSetBlob, + (ndr_print_fn_t)ndr_print_partialAttributeSetBlob, + true); +} + static int extended_dn_write_hex(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) @@ -1341,6 +1354,13 @@ static const struct ldb_schema_syntax samba_syntaxes[] = { .canonicalise_fn = ldb_handler_copy, .comparison_fn = ldb_comparison_binary, .operator_fn = samba_syntax_operator_fn + },{ + .name = LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET, + .ldif_read_fn = ldb_handler_copy, + .ldif_write_fn = ldif_write_partialAttributeSet, + .canonicalise_fn = ldb_handler_copy, + .comparison_fn = ldb_comparison_binary, + .operator_fn = samba_syntax_operator_fn } }; @@ -1460,7 +1480,8 @@ static const struct { /* These NDR encoded things we want to be able to read with --show-binary */ { "dnsRecord", LDB_SYNTAX_SAMBA_DNSRECORD }, - { "supplementalCredentials", LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS} + { "supplementalCredentials", LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS}, + { "partialAttributeSet", LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET} }; const struct ldb_schema_syntax *ldb_samba_syntax_by_name(struct ldb_context *ldb, const char *name) diff --git a/lib/ldb-samba/ldif_handlers.h b/lib/ldb-samba/ldif_handlers.h index e9669abd31..eb6c656ba5 100644 --- a/lib/ldb-samba/ldif_handlers.h +++ b/lib/ldb-samba/ldif_handlers.h @@ -16,6 +16,7 @@ #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" +#define LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET "LDB_SYNTAX_SAMBA_PARTIALATTRIBUTESET" #include "lib/ldb-samba/ldif_handlers_proto.h" #undef _PRINTF_ATTRIBUTE |