From 1ca2ec1188098c051fe7ab6d44c9b1cd1f802b18 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Sat, 26 Feb 2011 23:13:49 +0200 Subject: [PATCH] s4-drepl: Schedule event to trigger replication rather than calling run_pending_ops directly Executing dreplsrv_run_pending_ops() directly may cause a segfault as in case of failure, the _drepl_replica_sync_done_cb() callback gets called *before* drepl_replica_sync() returns. In such case, irpc message gets freed twice - once when irpc_send_reply() gets called and once when drepl_replica_sync() returns --- source4/dsdb/repl/drepl_service.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c index f4364afeebb..9248c831110 100644 --- a/source4/dsdb/repl/drepl_service.c +++ b/source4/dsdb/repl/drepl_service.c @@ -324,8 +324,11 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg, /* if we got here, everything is OK */ r->out.result = WERR_OK; - /* force execution of scheduled replications */ - dreplsrv_run_pending_ops(service); + /* + * schedule replication event to force + * replication as soon as possible + */ + dreplsrv_periodic_schedule(service, 0); done: return NT_STATUS_OK; -- 2.34.1