summaryrefslogtreecommitdiff
path: root/source4/rpc_server/drsuapi/getncchanges.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server/drsuapi/getncchanges.c')
-rw-r--r--source4/rpc_server/drsuapi/getncchanges.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index 725a380f89..4dce07e24a 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -315,8 +315,8 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
ncRoot_dn = ldb_dn_new(mem_ctx, sam_ctx, ncRoot->dn);
ret = drsuapi_search_with_extended_dn(sam_ctx, mem_ctx, &site_res,
ncRoot_dn, LDB_SCOPE_SUBTREE, attrs,
- "(&(uSNChanged>=%llu)(objectClass=*))",
- (unsigned long long)r->in.req->req8.highwatermark.highest_usn);
+ "uSNChanged>=%llu",
+ (unsigned long long)(r->in.req->req8.highwatermark.highest_usn+1));
if (ret != LDB_SUCCESS) {
return WERR_DS_DRA_INTERNAL_ERROR;
}
@@ -363,6 +363,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
uSN = ldb_msg_find_attr_as_int(site_res->msgs[i], "uSNChanged", -1);
if (uSN > r->out.ctr->ctr6.new_highwatermark.highest_usn) {
+ r->out.ctr->ctr6.new_highwatermark.tmp_highest_usn = uSN;
r->out.ctr->ctr6.new_highwatermark.highest_usn = uSN;
}
@@ -390,9 +391,13 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
}
- DEBUG(4,("DsGetNSChanges with uSNChanged >= %llu on %s gave %u objects\n",
- (unsigned long long)r->in.req->req8.highwatermark.highest_usn,
+ DEBUG(4,("DsGetNCChanges with uSNChanged >= %llu on %s gave %u objects\n",
+ (unsigned long long)(r->in.req->req8.highwatermark.highest_usn+1),
ncRoot->dn, r->out.ctr->ctr6.object_count));
+ if (r->out.ctr->ctr6.object_count <= 10 && DEBUGLVL(6)) {
+ NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetNCChanges, NDR_IN|NDR_OUT, r);
+ }
+
return WERR_OK;
}