diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-08-05 15:22:49 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-08-05 17:31:29 +1000 |
commit | 1a701914fd226f7d3844bd6feadcd58cb7144246 (patch) | |
tree | 177ab35141ee5d3972e6e3008b2e108e55c42e2f | |
parent | 2883bc94c76bc54187bb9bd0db1a36dd482a0aea (diff) | |
download | samba-1a701914fd226f7d3844bd6feadcd58cb7144246.tar.gz samba-1a701914fd226f7d3844bd6feadcd58cb7144246.tar.bz2 samba-1a701914fd226f7d3844bd6feadcd58cb7144246.zip |
s4-ldb: added ldif handler for the dnsRecord attribute
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.c | 24 | ||||
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.h | 1 | ||||
-rw-r--r-- | source4/lib/ldb-samba/wscript_build | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index a7706ac6dc..0ff6d32dee 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -30,6 +30,7 @@ #include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_drsblobs.h" +#include "librpc/gen_ndr/ndr_dnsp.h" #include "librpc/ndr/libndr.h" #include "libcli/security/security.h" #include "param/param.h" @@ -868,6 +869,20 @@ static int ldif_write_replUpToDateVector(struct ldb_context *ldb, void *mem_ctx, } +/* + convert a NDR formatted blob to a ldif formatted dnsRecord +*/ +static int ldif_write_dnsRecord(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_DnssrvRpcRecord), + (ndr_pull_flags_fn_t)ndr_pull_dnsp_DnssrvRpcRecord, + (ndr_print_fn_t)ndr_print_dnsp_DnssrvRpcRecord, + true); +} + + static int extended_dn_write_hex(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { @@ -1094,7 +1109,13 @@ static const struct ldb_schema_syntax samba_syntaxes[] = { .ldif_write_fn = ldif_write_range64, .canonicalise_fn = ldif_canonicalise_int64, .comparison_fn = ldif_comparison_int64 - }, + },{ + .name = LDB_SYNTAX_SAMBA_DNSRECORD, + .ldif_read_fn = ldb_handler_copy, + .ldif_write_fn = ldif_write_dnsRecord, + .canonicalise_fn = ldb_handler_copy, + .comparison_fn = ldb_comparison_binary + } }; static const struct ldb_dn_extended_syntax samba_dn_syntax[] = { @@ -1207,6 +1228,7 @@ static const struct { { "invocationId", LDB_SYNTAX_SAMBA_GUID }, { "parentGUID", LDB_SYNTAX_SAMBA_GUID }, { "msDS-OptionalFeatureGUID", LDB_SYNTAX_SAMBA_GUID }, + { "dnsRecord", LDB_SYNTAX_SAMBA_DNSRECORD }, }; 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 bd5ed3145e..33373fa01d 100644 --- a/source4/lib/ldb-samba/ldif_handlers.h +++ b/source4/lib/ldb-samba/ldif_handlers.h @@ -12,6 +12,7 @@ #define LDB_SYNTAX_SAMBA_REPLPROPERTYMETADATA "LDB_SYNTAX_SAMBA_REPLPROPERTYMETADATA" #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" #include "lib/ldb-samba/ldif_handlers_proto.h" diff --git a/source4/lib/ldb-samba/wscript_build b/source4/lib/ldb-samba/wscript_build index a58316ec13..7fdaac8b90 100644 --- a/source4/lib/ldb-samba/wscript_build +++ b/source4/lib/ldb-samba/wscript_build @@ -9,7 +9,7 @@ bld.SAMBA_SUBSYSTEM('LDBSAMBA', autoproto='ldif_handlers_proto.h', public_deps='ldb', public_headers='ldb_wrap.h', - deps='LIBSECURITY SAMDB_SCHEMA LIBNDR NDR_DRSBLOBS CREDENTIALS UTIL_LDB' + deps='LIBSECURITY SAMDB_SCHEMA LIBNDR NDR_DRSBLOBS CREDENTIALS UTIL_LDB NDR_DNSP' ) |