diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-12-18 13:40:33 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-01-01 19:28:07 +0100 |
commit | 1f89d641d09ef983f6a5055bb75099dc0ce57aa8 (patch) | |
tree | c706dee65bd9cb9d0124a4e262dd26a5165df89c | |
parent | 91f7f2c04fd00e281b0755a331ca632a4905e3b5 (diff) | |
download | samba-1f89d641d09ef983f6a5055bb75099dc0ce57aa8.tar.gz samba-1f89d641d09ef983f6a5055bb75099dc0ce57aa8.tar.bz2 samba-1f89d641d09ef983f6a5055bb75099dc0ce57aa8.zip |
s4:drsuapi: check the source_dsa_invocation_id (bug #9508)
The given highwatermark is only valid relative to the
specified source_dsa_invocation_id.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source4/rpc_server/drsuapi/getncchanges.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c index e06aeed9c2..10965a3e81 100644 --- a/source4/rpc_server/drsuapi/getncchanges.c +++ b/source4/rpc_server/drsuapi/getncchanges.c @@ -1483,12 +1483,15 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_ time_t start = time(NULL); bool max_wait_reached = false; bool has_get_all_changes = false; + struct GUID invocation_id; DCESRV_PULL_HANDLE_WERR(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE); b_state = h->data; sam_ctx = b_state->sam_ctx_system?b_state->sam_ctx_system:b_state->sam_ctx; + invocation_id = *(samdb_ntds_invocation_id(sam_ctx)); + *r->out.level_out = 6; /* TODO: linked attributes*/ r->out.ctr->ctr6.linked_attributes_count = 0; @@ -1606,6 +1609,18 @@ allowed: req10->uptodateness_vector = NULL; } + if (GUID_all_zero(&req10->source_dsa_invocation_id)) { + req10->source_dsa_invocation_id = invocation_id; + } + + if (!GUID_equal(&req10->source_dsa_invocation_id, &invocation_id)) { + /* + * The given highwatermark is only valid relative to the + * specified source_dsa_invocation_id. + */ + ZERO_STRUCT(req10->highwatermark); + } + getnc_state = b_state->getncchanges_state; /* see if a previous replication has been abandoned */ |