File dont-block-siguser1.patch of Package gdm
From a86f5985c282fbdb15aba9fab834fb9d41db7e01 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 30 May 2014 10:26:02 -0400
Subject: [PATCH] worker: don't block SIGUSR1
When the slaves were folded into the main manager process, we had
to add support for detecting multiple simultaneous X servers starting
up.
We did that by creating a detected thread to listen for SIGUSR1 and
then examining the siginfo to find out which X server is ready.
In order to ensure only the dedicated thread received the SIGUSR1
signals from the X server we blocked SIGUSR1 from the main thread.
That blocked signal is inherited to the worker processes and the
session. Some programs depend on SIGUSR1 but don't explicitly unblock
SIGUSR1 at start up, since the signal is presumed to be unblocked out
the box.
This commit makes sure SIGUSR1 is unblocked before starting the session
to keep these programs functioning correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=731228
---
daemon/gdm-session-worker.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 8af97b0..bc50b37 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1917,60 +1917,66 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
stdout_fd = open ("/dev/null", O_RDWR);
stderr_fd = dup (stdout_fd);
}
g_free (log_dir);
} else {
stdout_fd = open ("/dev/null", O_RDWR);
stderr_fd = dup (stdout_fd);
}
}
g_free (home_dir);
if (stdout_fd != -1) {
dup2 (stdout_fd, STDOUT_FILENO);
close (stdout_fd);
}
if (stderr_fd != -1) {
dup2 (stderr_fd, STDERR_FILENO);
close (stderr_fd);
}
gdm_log_shutdown ();
/*
* Reset SIGPIPE to default so that any process in the user
* session get the default SIGPIPE behavior instead of ignoring
* SIGPIPE.
*/
signal (SIGPIPE, SIG_DFL);
+ /*
+ * Reset SIGUSR1 to default since it was blocked by the manager
+ * process for the X server startup handshake
+ */
+ signal (SIGUSR1, SIG_DFL);
+
gdm_session_execute (worker->priv->arguments[0],
worker->priv->arguments,
(char **)
environment,
TRUE);
gdm_log_init ();
g_debug ("GdmSessionWorker: child '%s' could not be started: %s",
worker->priv->arguments[0],
g_strerror (errno));
_exit (127);
}
if (worker->priv->session_tty_fd > 0) {
close (worker->priv->session_tty_fd);
worker->priv->session_tty_fd = -1;
}
/* If we end up execing again, make sure we don't use the executable context set up
* by pam_selinux durin pam_open_session
*/
#ifdef HAVE_SELINUX
setexeccon (NULL);
#endif
worker->priv->child_pid = session_pid;
g_debug ("GdmSessionWorker: session opened creating reply...");
g_assert (sizeof (GPid) <= sizeof (int));
--
1.9.3