From 57f5bf78fa9fc9d190c3cb25251e686a1488f790 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 3 Jan 2007 19:09:34 +0000 Subject: r20514: implement idl for DsGetNT4ChangeLog() which transferres the meta data for NT4 DC's in mixed mode domains. This call is triggered by tranferring the PDC FSMO Role to another DC the real meta data is encoded in the user buffer which is just a DATA_BLOB in idl metze (This used to be commit d883815c8d64429e4dac26a93a15e67d31dc263e) --- source4/torture/rpc/dssync.c | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 972c2f1ecf..a4167b3dc3 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -563,6 +563,64 @@ static BOOL test_FetchData(struct DsSyncTest *ctx) return ret; } +static BOOL test_FetchNT4Data(struct DsSyncTest *ctx) +{ + NTSTATUS status; + BOOL ret = True; + int i, y = 0; + uint64_t highest_usn = 0; + const char *partition = NULL; + struct drsuapi_DsGetNT4ChangeLog r; + int32_t out_level = 0; + struct GUID null_guid; + struct dom_sid null_sid; + DATA_BLOB cookie; + + ZERO_STRUCT(null_guid); + ZERO_STRUCT(null_sid); + ZERO_STRUCT(cookie); + + ZERO_STRUCT(r); + r.in.bind_handle = &ctx->new_dc.drsuapi.bind_handle; + r.in.level = 1; + + r.in.req.req1.unknown1 = lp_parm_int(-1, "dssync", "nt4-1", 3); + r.in.req.req1.unknown2 = lp_parm_int(-1, "dssync", "nt4-2", 0x00004000); + + while (1) { + r.in.req.req1.length = cookie.length; + r.in.req.req1.data = cookie.data; + + status = dcerpc_drsuapi_DsGetNT4ChangeLog(ctx->new_dc.drsuapi.pipe, ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + const char *errstr = nt_errstr(status); + if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { + errstr = dcerpc_errstr(ctx, ctx->new_dc.drsuapi.pipe->last_fault_code); + } + printf("dcerpc_drsuapi_DsGetNT4ChangeLog failed - %s\n", errstr); + ret = False; + } else if (!W_ERROR_IS_OK(r.out.result)) { + printf("DsGetNT4ChangeLog failed - %s\n", win_errstr(r.out.result)); + ret = False; + } else if (r.out.level != 1) { + printf("DsGetNT4ChangeLog unknown level - %u\n", r.out.level); + ret = False; + } else if (NT_STATUS_IS_OK(r.out.info.info1.status)) { + } else if (NT_STATUS_EQUAL(r.out.info.info1.status, STATUS_MORE_ENTRIES)) { + cookie.length = r.out.info.info1.length1; + cookie.data = r.out.info.info1.data1; + continue; + } else { + printf("DsGetNT4ChangeLog failed - %s\n", nt_errstr(r.out.info.info1.status)); + ret = False; + } + + break; + } + + return ret; +} + BOOL torture_rpc_dssync(struct torture_context *torture) { BOOL ret = True; @@ -577,6 +635,7 @@ BOOL torture_rpc_dssync(struct torture_context *torture) ret &= test_GetInfo(ctx); ret &= _test_DsBind(ctx, ctx->admin.credentials, &ctx->new_dc.drsuapi); ret &= test_FetchData(ctx); + ret &= test_FetchNT4Data(ctx); return ret; } -- cgit