s4: allow repl:RODC=true/false to set ourselves as a RODC
authorAndrew Tridgell <tridge@samba.org>
Wed, 9 Sep 2009 01:26:50 +0000 (11:26 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 9 Sep 2009 02:36:51 +0000 (12:36 +1000)
I think this is what windows DCs use to see that we are read-only, but
I am not sure. Needs more testing.

source4/libnet/libnet_become_dc.c

index 2d35b40cfa793730b9672afc1ae4db3905a6397c..9ba801bb6f5b40311be03bbeae1cc779ba6d1b69 100644 (file)
@@ -2767,8 +2767,12 @@ static void becomeDC_drsuapi_update_refs_send(struct libnet_BecomeDC_state *s,
        r->in.req.req1.dest_dsa_dns_name= ntds_dns_name;
        r->in.req.req1.dest_dsa_guid    = s->dest_dsa.ntds_guid;
        r->in.req.req1.options          = DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE
-                                       | DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE
-                                       | DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE;
+                                       | DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE;
+
+       /* I think this is how we mark ourselves as a RODC */
+       if (!lp_parm_bool(s->libnet->lp_ctx, NULL, "repl", "RODC", false)) {
+               r->in.req.req1.options |= DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE;
+       }
 
        req = dcerpc_drsuapi_DsReplicaUpdateRefs_send(drsuapi->pipe, r, r);
        composite_continue_rpc(c, req, recv_fn, s);