diff options
author | Fernando J V da Silva <fernandojvsilva@yahoo.com.br> | 2010-04-15 17:37:40 -0300 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-22 19:36:15 +1000 |
commit | 57bcdf008fa44d4c550819cbceada968b11be63c (patch) | |
tree | c404018cef84c2e07b26a48f7618cfa31b76c622 /source4/dsdb/repl | |
parent | c023fc217ed370e5c890c1984da533e0133060d9 (diff) | |
download | samba-57bcdf008fa44d4c550819cbceada968b11be63c.tar.gz samba-57bcdf008fa44d4c550819cbceada968b11be63c.tar.bz2 samba-57bcdf008fa44d4c550819cbceada968b11be63c.zip |
s4-drs: samdb_is_rodc() function and new samdb_rodc() function
This patch creates the samdb_is_rodc() function, which looks for
the NTDSDSA object for a DC that has a specific invocationId
and if msDS-isRODC is present on such object and it is TRUE, then
consider the DC as a RODC.
The new samdb_rodc() function uses the samdb_is_rodc() function
for the local server.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/dsdb/repl')
-rw-r--r-- | source4/dsdb/repl/drepl_out_helpers.c | 5 | ||||
-rw-r--r-- | source4/dsdb/repl/drepl_service.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c index a12481b897..07fb0b3d62 100644 --- a/source4/dsdb/repl/drepl_out_helpers.c +++ b/source4/dsdb/repl/drepl_out_helpers.c @@ -542,6 +542,8 @@ static void dreplsrv_update_refs_trigger(struct tevent_req *req) char *ntds_guid_str; char *ntds_dns_name; struct tevent_req *subreq; + bool am_rodc; + int ret; r = talloc(state, struct drsuapi_DsReplicaUpdateRefs); if (tevent_req_nomem(r, req)) { @@ -566,7 +568,8 @@ static void dreplsrv_update_refs_trigger(struct tevent_req *req) r->in.req.req1.dest_dsa_dns_name = ntds_dns_name; r->in.req.req1.dest_dsa_guid = service->ntds_guid; r->in.req.req1.options = DRSUAPI_DRS_ADD_REF | DRSUAPI_DRS_DEL_REF; - if (!samdb_rodc(service->samdb)) { + ret = samdb_rodc(service->samdb, &am_rodc); + if (ret == LDB_SUCCESS && !am_rodc) { r->in.req.req1.options |= DRSUAPI_DRS_WRIT_REP; } diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c index 4196f94234..59436d6c0c 100644 --- a/source4/dsdb/repl/drepl_service.c +++ b/source4/dsdb/repl/drepl_service.c @@ -132,6 +132,8 @@ static void dreplsrv_task_init(struct task_server *task) WERROR status; struct dreplsrv_service *service; uint32_t periodic_startup_interval; + bool am_rodc; + int ret; switch (lp_server_role(task->lp_ctx)) { case ROLE_STANDALONE: @@ -194,7 +196,8 @@ static void dreplsrv_task_init(struct task_server *task) } /* if we are a RODC then we do not send DSReplicaSync*/ - if (!samdb_rodc(service->samdb)) { + ret = samdb_rodc(service->samdb, &am_rodc); + if (ret == LDB_SUCCESS && !am_rodc) { service->notify.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", "notify_interval", 5); /* in seconds */ status = dreplsrv_notify_schedule(service, service->notify.interval); |