summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-01-09 10:12:54 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-09 10:15:14 +1100
commit9e6eb22f7fda88e1d2336ac4b2ec42a8d84c2138 (patch)
tree4626b254f6c7b82e98d67c0925cc1a49132d0027 /source4/rpc_server
parent273a4d9803f1a92f0e248b707937703d84b0edc6 (diff)
downloadsamba-9e6eb22f7fda88e1d2336ac4b2ec42a8d84c2138.tar.gz
samba-9e6eb22f7fda88e1d2336ac4b2ec42a8d84c2138.tar.bz2
samba-9e6eb22f7fda88e1d2336ac4b2ec42a8d84c2138.zip
s4-drs: fixed the NC in the getncchanges RID alloc reply
the search happens on a different DN to the NC of the request, but the reply is with the original NC
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/drsuapi/getncchanges.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index 07e7972dfa..d0ce8198b8 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -653,16 +653,6 @@ static WERROR getncchanges_rid_alloc(struct drsuapi_bind_state *b_state,
DEBUG(2,("Allocated RID pool for server %s\n",
GUID_string(mem_ctx, &req8->destination_dsa_guid)));
- /* to complete the rest of the operation we need to point
- getncchanges at the base DN for the domain */
- req8->naming_context->dn = ldb_dn_get_linearized(base_dn);
- ret = dsdb_find_guid_by_dn(ldb, base_dn, &req8->naming_context->guid);
- if (ret != LDB_SUCCESS) {
- DEBUG(0,(__location__ ": Failed to find base DN GUID - %s\n",
- ldb_errstring(ldb)));
- return WERR_DS_DRA_INTERNAL_ERROR;
- }
-
return WERR_OK;
}
@@ -713,6 +703,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
struct drsuapi_DsGetNCChangesRequest8 *req8;
uint32_t options;
uint32_t max_objects;
+ struct ldb_dn *search_dn = NULL;
DCESRV_PULL_HANDLE_WERR(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE);
b_state = h->data;
@@ -781,6 +772,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
case DRSUAPI_EXOP_FSMO_RID_ALLOC:
werr = getncchanges_rid_alloc(b_state, mem_ctx, req8, &r->out.ctr->ctr6);
W_ERROR_NOT_OK_RETURN(werr);
+ search_dn = samdb_base_dn(b_state->sam_ctx);
break;
case DRSUAPI_EXOP_FSMO_REQ_ROLE:
@@ -863,10 +855,14 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
scope = LDB_SCOPE_BASE;
}
+ if (!search_dn) {
+ search_dn = getnc_state->ncRoot_dn;
+ }
+
DEBUG(1,(__location__ ": getncchanges on %s using filter %s\n",
ldb_dn_get_linearized(getnc_state->ncRoot_dn), search_filter));
ret = drsuapi_search_with_extended_dn(b_state->sam_ctx, getnc_state, &getnc_state->site_res,
- getnc_state->ncRoot_dn, scope, attrs,
+ search_dn, scope, attrs,
search_filter);
if (ret != LDB_SUCCESS) {
return WERR_DS_DRA_INTERNAL_ERROR;
@@ -1037,6 +1033,12 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
b_state->getncchanges_state = NULL;
}
+ if (req8->extended_op != DRSUAPI_EXOP_NONE) {
+ r->out.ctr->ctr6.uptodateness_vector = NULL;
+ r->out.ctr->ctr6.nc_object_count = 0;
+ ZERO_STRUCT(r->out.ctr->ctr6.new_highwatermark);
+ }
+
DEBUG(r->out.ctr->ctr6.more_data?2:1,
("DsGetNCChanges with uSNChanged >= %llu flags 0x%08x on %s gave %u objects (done %d/%d la=%d)\n",
(unsigned long long)(req8->highwatermark.highest_usn+1),