From ab5a6712b6cc83716ad73d99d3235ecafa8d5717 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 30 Jul 2008 12:35:45 +0200 Subject: libnet dssync: move determination of request level into build_request() ...where it belongs. Michael (This used to be commit 012b33f1c52df086e4f20e7494248d98fbced76a) --- source3/libnet/libnet_dssync.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'source3/libnet') diff --git a/source3/libnet/libnet_dssync.c b/source3/libnet/libnet_dssync.c index c829757a3d..f8e31e87a6 100644 --- a/source3/libnet/libnet_dssync.c +++ b/source3/libnet/libnet_dssync.c @@ -363,11 +363,12 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx, struct dssync_context *ctx, const char *dn, struct replUpToDateVectorBlob *utdv, - int32_t level, + int32_t *plevel, union drsuapi_DsGetNCChangesRequest *preq) { NTSTATUS status; uint32_t count; + int32_t level; union drsuapi_DsGetNCChangesRequest req; struct dom_sid null_sid; enum drsuapi_DsExtendedOperation extended_op; @@ -383,6 +384,14 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx, ZERO_STRUCT(null_sid); ZERO_STRUCT(req); + if (ctx->remote_info28.supported_extensions + & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) + { + level = 8; + } else { + level = 5; + } + nc = TALLOC_ZERO_P(mem_ctx, struct drsuapi_DsReplicaObjectIdentifier); if (!nc) { status = NT_STATUS_NO_MEMORY; @@ -449,6 +458,10 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx, goto fail; } + if (plevel) { + *plevel = level; + } + if (preq) { *preq = req; } @@ -627,21 +640,13 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx, goto out; } - if (ctx->remote_info28.supported_extensions - & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) - { - level = 8; - } else { - level = 5; - } - if (ctx->single && ctx->object_dn) { dn = ctx->object_dn; } else { dn = ctx->nc_dn; } - status = libnet_dssync_build_request(mem_ctx, ctx, dn, old_utdv, level, + status = libnet_dssync_build_request(mem_ctx, ctx, dn, old_utdv, &level, &req); if (!NT_STATUS_IS_OK(status)) { goto out; -- cgit