diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-06-10 08:51:30 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-06-12 11:17:59 +1000 |
commit | 6336f244758e78dfce61715b5de403e3db7fb02e (patch) | |
tree | be12dbdbfe984e75da0de4860a899949941ef9aa | |
parent | d6f5c1ace215131dc09611abcd2a52254bdab4d6 (diff) | |
download | samba-6336f244758e78dfce61715b5de403e3db7fb02e.tar.gz samba-6336f244758e78dfce61715b5de403e3db7fb02e.tar.bz2 samba-6336f244758e78dfce61715b5de403e3db7fb02e.zip |
s4:dsdb Allow a binary prefix map to be specified in the LDIF
This allows it to be specified in either binary or as a string.
Andrew Bartlett
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index 91abefcace..f335d6c4c9 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -526,6 +526,20 @@ static int ldif_read_prefixMap(struct ldb_context *ldb, void *mem_ctx, return -1; } + ndr_err = ndr_pull_struct_blob(in, blob, blob, + (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob); + if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + ndr_err = ndr_push_struct_blob(out, mem_ctx, + blob, + (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); + talloc_free(tmp_ctx); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + return -1; + } + return 0; + } + + /* If this does not parse, then it is probably the text version, and we should try it that way */ blob->version = PREFIX_MAP_VERSION_DSDB; string = talloc_strndup(mem_ctx, (const char *)in->data, in->length); |