summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-30 12:35:45 +0200
committerMichael Adam <obnox@samba.org>2008-08-01 16:07:04 +0200
commitab5a6712b6cc83716ad73d99d3235ecafa8d5717 (patch)
tree18193411bcbb983744631396264ef754918c15c7 /source3
parent89d817386c8fd1f92f490a844aa198af7fec12cb (diff)
downloadsamba-ab5a6712b6cc83716ad73d99d3235ecafa8d5717.tar.gz
samba-ab5a6712b6cc83716ad73d99d3235ecafa8d5717.tar.bz2
samba-ab5a6712b6cc83716ad73d99d3235ecafa8d5717.zip
libnet dssync: move determination of request level into build_request()
...where it belongs. Michael (This used to be commit 012b33f1c52df086e4f20e7494248d98fbced76a)
Diffstat (limited to 'source3')
-rw-r--r--source3/libnet/libnet_dssync.c25
1 files changed, 15 insertions, 10 deletions
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;