s4-drs: If we are a RODC then do not send DSReplicaSync messages
authorFernando J V da Silva <fernandojvsilva@yahoo.com.br>
Wed, 24 Mar 2010 16:02:36 +0000 (13:02 -0300)
committerAndrew Tridgell <tridge@samba.org>
Thu, 25 Mar 2010 04:02:19 +0000 (15:02 +1100)
source4/dsdb/repl/drepl_service.c

index 3ed588566fae37e16b337fb133ba56ec03fe8220..4196f942340a8424dd7c937a33555d87bbd8fba7 100644 (file)
@@ -193,14 +193,17 @@ static void dreplsrv_task_init(struct task_server *task)
                return;
        }
 
-       service->notify.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", 
-                                              "notify_interval", 5); /* in seconds */
-       status = dreplsrv_notify_schedule(service, service->notify.interval);
-       if (!W_ERROR_IS_OK(status)) {
-               task_server_terminate(task, talloc_asprintf(task,
-                                     "dreplsrv: Failed to setup notify schedule: %s\n",
-                                                           win_errstr(status)), true);
-               return;
+       /* if we are a RODC then we do not send DSReplicaSync*/
+       if (!samdb_rodc(service->samdb)) {
+               service->notify.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv",
+                                                          "notify_interval", 5); /* in seconds */
+               status = dreplsrv_notify_schedule(service, service->notify.interval);
+               if (!W_ERROR_IS_OK(status)) {
+                       task_server_terminate(task, talloc_asprintf(task,
+                                                 "dreplsrv: Failed to setup notify schedule: %s\n",
+                                                                       win_errstr(status)), true);
+                       return;
+               }
        }
 
        irpc_add_name(task->msg_ctx, "dreplsrv");