summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2010-01-20 18:10:05 +0200
committerStefan Metzmacher <metze@samba.org>2010-02-01 15:23:31 +0100
commit93142e4a3a0a7dbe5f8ba737bd45f01c61d997da (patch)
treedba7797933a26ba6f31c66368c35c2079e01e931
parent83068b42ae22af18c5a06dc05a86021db0e25634 (diff)
downloadsamba-93142e4a3a0a7dbe5f8ba737bd45f01c61d997da.tar.gz
samba-93142e4a3a0a7dbe5f8ba737bd45f01c61d997da.tar.bz2
samba-93142e4a3a0a7dbe5f8ba737bd45f01c61d997da.zip
s4/ldif: Handle Schema:prefixMap blobs in W2K3 and W2K8
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/lib/ldb-samba/ldif_handlers.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c
index 84bee78231..a3400dd774 100644
--- a/source4/lib/ldb-samba/ldif_handlers.c
+++ b/source4/lib/ldb-samba/ldif_handlers.c
@@ -597,12 +597,22 @@ static int ldif_write_prefixMap(struct ldb_context *ldb, void *mem_ctx,
uint32_t i;
if (ldb_get_flags(ldb) & LDB_FLG_SHOW_BINARY) {
- return ldif_write_NDR(ldb, mem_ctx, in, out,
- sizeof(struct prefixMapBlob),
- (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob,
- (ndr_print_fn_t)ndr_print_prefixMapBlob,
- true);
-
+ int err;
+ /* try to decode the blob as S4 prefixMap */
+ err = ldif_write_NDR(ldb, mem_ctx, in, out,
+ sizeof(struct prefixMapBlob),
+ (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob,
+ (ndr_print_fn_t)ndr_print_prefixMapBlob,
+ false);
+ if (0 == err) {
+ return err;
+ }
+ /* try parsing it as Windows PrefixMap value */
+ return ldif_write_NDR(ldb, mem_ctx, in, out,
+ sizeof(struct drsuapi_MSPrefixMap_Ctr),
+ (ndr_pull_flags_fn_t)ndr_pull_drsuapi_MSPrefixMap_Ctr,
+ (ndr_print_fn_t)ndr_print_drsuapi_MSPrefixMap_Ctr,
+ true);
}
blob = talloc(mem_ctx, struct prefixMapBlob);