-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A temporary signal handler for SIGTERM is set up in server_setup()
that calls exit() from within a pure signal handler. This causes a
race condition where it's possible that if the SSSD is restarted
immediately while it is still initializing the sysdb caches for
the first time, it can leave the cache in a corrupt and unusable
state.

https://bugzilla.redhat.com/show_bug.cgi?id=658444

- -- 
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkz1K/IACgkQeiVVYja6o6MC4ACcC4U1FUB/R4OaGdVXGHlFyk0v
0+oAnjPMJFC14pijWYDI9pg0r1dg2Fv0
=Zz8+
-----END PGP SIGNATURE-----
From e515ee6e8c29e3ce1ab55e96d9e15579b48c8c32 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Tue, 30 Nov 2010 11:50:05 -0500
Subject: [PATCH] Set up signal handlers before initializing sysdb

A temporary signal handler for SIGTERM is set up in server_setup()
that calls exit() from within a pure signal handler. This causes a
race condition where it's possible that if the SSSD is restarted
immediately while it is still initializing the sysdb caches for
the first time, it can leave the cache in a corrupt and unusable
state.

https://bugzilla.redhat.com/show_bug.cgi?id=658444
---
 src/monitor/monitor.c |   76 ++++++++++++++++++++++++------------------------
 1 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 3eca76498b20b6e0fe353f61c51921b6e00a0828..ac6ef19040e16f3497fb5fc3c682c81d74ffd175 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1817,6 +1817,44 @@ int monitor_process_init(struct mt_ctx *ctx,
     int num_providers;
     int ret;
 
+    /* Set up an event handler for a SIGHUP */
+    tes = tevent_add_signal(ctx->ev, ctx, SIGHUP, 0,
+                            monitor_hup, ctx);
+    if (tes == NULL) {
+        return EIO;
+    }
+
+    /* Set up an event handler for a SIGINT */
+    BlockSignals(false, SIGINT);
+    tes = tevent_add_signal(ctx->ev, ctx, SIGINT, 0,
+                            monitor_quit, ctx);
+    if (tes == NULL) {
+        return EIO;
+    }
+
+    /* Set up an event handler for a SIGTERM */
+    tes = tevent_add_signal(ctx->ev, ctx, SIGTERM, 0,
+                            monitor_quit, ctx);
+    if (tes == NULL) {
+        return EIO;
+    }
+
+    /* Handle SIGUSR1 (tell all providers to go offline) */
+    BlockSignals(false, SIGUSR1);
+    tes = tevent_add_signal(ctx->ev, ctx, SIGUSR1, 0,
+                            signal_offline, ctx);
+    if (tes == NULL) {
+        return EIO;
+    }
+
+    /* Handle SIGUSR2 (tell all providers to go reset offline) */
+    BlockSignals(false, SIGUSR2);
+    tes = tevent_add_signal(ctx->ev, ctx, SIGUSR2, 0,
+                            signal_offline_reset, ctx);
+    if (tes == NULL) {
+        return EIO;
+    }
+
 #if 0
     This feature is incomplete and can leave the SSSD in a bad state if the
     config file is changed while the SSSD is running.
@@ -1901,44 +1939,6 @@ int monitor_process_init(struct mt_ctx *ctx,
     /* now start checking for global events */
     set_global_checker(ctx);
 
-    /* Set up an event handler for a SIGHUP */
-    tes = tevent_add_signal(ctx->ev, ctx, SIGHUP, 0,
-                            monitor_hup, ctx);
-    if (tes == NULL) {
-        return EIO;
-    }
-
-    /* Set up an event handler for a SIGINT */
-    BlockSignals(false, SIGINT);
-    tes = tevent_add_signal(ctx->ev, ctx, SIGINT, 0,
-                            monitor_quit, ctx);
-    if (tes == NULL) {
-        return EIO;
-    }
-
-    /* Set up an event handler for a SIGTERM */
-    tes = tevent_add_signal(ctx->ev, ctx, SIGTERM, 0,
-                            monitor_quit, ctx);
-    if (tes == NULL) {
-        return EIO;
-    }
-
-    /* Handle SIGUSR1 (tell all providers to go offline) */
-    BlockSignals(false, SIGUSR1);
-    tes = tevent_add_signal(ctx->ev, ctx, SIGUSR1, 0,
-                            signal_offline, ctx);
-    if (tes == NULL) {
-        return EIO;
-    }
-
-    /* Handle SIGUSR2 (tell all providers to go reset offline) */
-    BlockSignals(false, SIGUSR2);
-    tes = tevent_add_signal(ctx->ev, ctx, SIGUSR2, 0,
-                            signal_offline_reset, ctx);
-    if (tes == NULL) {
-        return EIO;
-    }
-
     return EOK;
 }
 
-- 
1.7.3.2

Attachment: 0001-Set-up-signal-handlers-before-initializing-sysdb.patch.sig
Description: PGP signature

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to