From 23e4470c31a1800065830205241295344057ca01 Mon Sep 17 00:00:00 2001 From: Anatoliy Atanasov Date: Wed, 23 Sep 2009 16:52:34 -0700 Subject: [PATCH] s4: Handle DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP in getncchanges When this flag is specified in the request we should return for ncRoot only and so scope of search is LDB_SCOPE_BASE. --- source4/rpc_server/drsuapi/getncchanges.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c index 22e82fb4e8d..75f62139630 100644 --- a/source4/rpc_server/drsuapi/getncchanges.c +++ b/source4/rpc_server/drsuapi/getncchanges.c @@ -307,6 +307,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ const char *attrs[] = { "*", "parentGUID", "distinguishedName", NULL }; WERROR werr; char* search_filter; + enum ldb_scope scope = LDB_SCOPE_SUBTREE; *r->out.level_out = 6; /* TODO: linked attributes*/ @@ -372,9 +373,14 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ "(&%s(isCriticalSystemObject=true))", search_filter); } + ncRoot_dn = ldb_dn_new(mem_ctx, sam_ctx, ncRoot->dn); + if ((r->in.req->req8.replica_flags & DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP) + == DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP) { + scope = LDB_SCOPE_BASE; + } ret = drsuapi_search_with_extended_dn(sam_ctx, mem_ctx, &site_res, - ncRoot_dn, LDB_SCOPE_SUBTREE, attrs, + ncRoot_dn, scope, attrs, "distinguishedName", search_filter); if (ret != LDB_SUCCESS) { -- 2.11.4.GIT