diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-11-16 16:32:27 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-16 16:32:27 +1100 |
commit | 95d33f2f24d7300f2df54ea62b0595ed7d7d0a2c (patch) | |
tree | b4d1beaa99a9a645386beb6a5076b115ca96b5b8 /source4/lib | |
parent | b8631597f579555416dbd87ded3f329051965e8b (diff) | |
download | samba-95d33f2f24d7300f2df54ea62b0595ed7d7d0a2c.tar.gz samba-95d33f2f24d7300f2df54ea62b0595ed7d7d0a2c.tar.bz2 samba-95d33f2f24d7300f2df54ea62b0595ed7d7d0a2c.zip |
s4-ldif_handlers Add handler for printing supplementalCredentials
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.c | 23 | ||||
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.h | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index 14da31e9ec..5581cb1931 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -887,6 +887,19 @@ static int ldif_write_dnsRecord(struct ldb_context *ldb, void *mem_ctx, true); } +/* + convert a NDR formatted blob of a supplementalCredentials into text +*/ +static int ldif_write_supplementalCredentialsBlob(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 supplementalCredentialsBlob), + (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob, + (ndr_print_fn_t)ndr_print_supplementalCredentialsBlob, + true); +} + static int extended_dn_write_hex(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) @@ -1200,6 +1213,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_SUPPLEMENTALCREDENTIALS, + .ldif_read_fn = ldb_handler_copy, + .ldif_write_fn = ldif_write_supplementalCredentialsBlob, + .canonicalise_fn = ldb_handler_copy, + .comparison_fn = ldb_comparison_binary, + .operator_fn = samba_syntax_operator_fn } }; @@ -1313,7 +1333,10 @@ static const struct { { "invocationId", LDB_SYNTAX_SAMBA_GUID }, { "parentGUID", LDB_SYNTAX_SAMBA_GUID }, { "msDS-OptionalFeatureGUID", LDB_SYNTAX_SAMBA_GUID }, + + /* These NDR encoded things we want to be able to read with --show-binary */ { "dnsRecord", LDB_SYNTAX_SAMBA_DNSRECORD }, + { "supplementalCredentials", LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS} }; const struct ldb_schema_syntax *ldb_samba_syntax_by_name(struct ldb_context *ldb, const char *name) diff --git a/source4/lib/ldb-samba/ldif_handlers.h b/source4/lib/ldb-samba/ldif_handlers.h index 33373fa01d..62903c4a96 100644 --- a/source4/lib/ldb-samba/ldif_handlers.h +++ b/source4/lib/ldb-samba/ldif_handlers.h @@ -13,7 +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_SUPPLEMENTALCREDENTIALS "LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS" #include "lib/ldb-samba/ldif_handlers_proto.h" #undef _PRINTF_ATTRIBUTE |