s4-drs: put the GCSPN flag into the repsTo if requested
authorAndrew Tridgell <tridge@samba.org>
Thu, 30 Sep 2010 19:43:45 +0000 (12:43 -0700)
committerAndrew Tridgell <tridge@samba.org>
Thu, 30 Sep 2010 21:36:12 +0000 (14:36 -0700)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/rpc_server/drsuapi/getncchanges.c
source4/rpc_server/drsuapi/updaterefs.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",
index d628388849562c1b6bfffded035945d19a891303..a089586d24f20866941aeef83497372c6ab01559 100644 (file)
@@ -66,6 +66,8 @@ static WERROR uref_add_dest(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
        ZERO_STRUCT(reps.r[reps.count]);
        reps.r[reps.count].version = 1;
        reps.r[reps.count].ctr.ctr1 = *dest;
+       /* add the GCSPN flag if the client asked for it */
+       reps.r[reps.count].ctr.ctr1.replica_flags |= (options & DRSUAPI_DRS_REF_GCSPN);
        reps.count++;
 
        werr = dsdb_savereps(sam_ctx, mem_ctx, dn, "repsTo", reps.r, reps.count);