s4-drs: put the GCSPN flag into the repsTo if requested
[mat/samba.git] / source4 / rpc_server / drsuapi / getncchanges.c
index c04a8c7450356a1bcc9288a1c88187c29b20a25d..54b04307ab81e95d67dd876e75cd3afc173c1c39 100644 (file)
@@ -1589,6 +1589,12 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
                ureq.options = DRSUAPI_DRS_ADD_REF |
                        DRSUAPI_DRS_ASYNC_OP |
                        DRSUAPI_DRS_GETCHG_CHECK;
+
+               /* we also need to pass through the
+                  DRSUAPI_DRS_REF_GCSPN bit so that repsTo gets flagged
+                  to send notifies using the GC SPN */
+               ureq.options |= (req10->replica_flags & DRSUAPI_DRS_REF_GCSPN);
+
                werr = drsuapi_UpdateRefs(b_state, mem_ctx, &ureq);
                if (!W_ERROR_IS_OK(werr)) {
                        DEBUG(0,(__location__ ": Failed UpdateRefs in DsGetNCChanges - %s\n",