diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-01-03 19:09:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:36:04 -0500 |
commit | 57f5bf78fa9fc9d190c3cb25251e686a1488f790 (patch) | |
tree | e89b02a2e3878c2292906445ad14e1af651d8ee5 /source4/torture/rpc | |
parent | 8d139b0e93b871cfb26067ea4095b1d42a7382ea (diff) | |
download | samba-57f5bf78fa9fc9d190c3cb25251e686a1488f790.tar.gz samba-57f5bf78fa9fc9d190c3cb25251e686a1488f790.tar.bz2 samba-57f5bf78fa9fc9d190c3cb25251e686a1488f790.zip |
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)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/dssync.c | 59 |
1 files changed, 59 insertions, 0 deletions
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; } |