summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-06-19 11:28:49 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-06-19 11:58:10 -0400
commit12cbba5545aefa59e27f683e17e05b8e80063718 (patch)
tree5d063234368e98e3691eaaf060f2c13781f720a1
parent673c2ce9b3371241de872b2bd206f732485888cb (diff)
downloadsssd-12cbba5545aefa59e27f683e17e05b8e80063718.tar.gz
sssd-12cbba5545aefa59e27f683e17e05b8e80063718.tar.xz
sssd-12cbba5545aefa59e27f683e17e05b8e80063718.zip
Protect against segfault in service_signal_reload
There is a potential race condition where the monitor may attempt to signal a reload of a child process before the communication sbus channel is available. If this happens, we will just exit this function and let the monitor kill and restart the child process.
-rw-r--r--server/monitor/monitor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index e4fca25a8..5cc73c8b8 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -525,6 +525,15 @@ static int service_signal_reload(struct mt_svc *svc)
return EOK;
}
+ if (!svc->mt_conn) {
+ /* Avoid a race condition where we are trying to
+ * order a service to reload that hasn't started
+ * yet.
+ */
+ DEBUG(1,("Could not reload service [%s].\n", svc->name));
+ return EIO;
+ }
+
conn = sbus_get_connection(svc->mt_conn->conn_ctx);
msg = dbus_message_new_method_call(NULL,
SERVICE_PATH,