1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s4-ldb: added ldif handler for the dnsRecord attribute

This commit is contained in:
Andrew Tridgell 2010-08-05 15:22:49 +10:00
parent 2883bc94c7
commit 1a701914fd
3 changed files with 25 additions and 2 deletions

View File

@ -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)

View File

@ -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"

View File

@ -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'
)