summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-07-18 16:40:58 -0400
committerRay Strode <rstrode@redhat.com>2018-08-13 11:01:36 -0400
commit702d7b16af99db9f5c47553984f0e4a046b64f76 (patch)
treea7f37d1e242823e894b2d550437d93e99c634879
parent765b306c364885dd89d47fe9fe8618ce6a467bc1 (diff)
downloadgdm-702d7b16af99db9f5c47553984f0e4a046b64f76.tar.gz
session-worker: unblock SIGUSR1 before PAM
Right now we unblock SIGUSR1 just before starting the session, but we should really do it before starting the worker/PAM. This commit fixes that and removes a useless call to set SIGUSR1 back to the default disposition, right before exec (which does the same thing anyway) Closes: https://gitlab.gnome.org/GNOME/gdm/issues/399
-rw-r--r--daemon/gdm-session-worker-job.c7
-rw-r--r--daemon/gdm-session-worker.c15
2 files changed, 7 insertions, 15 deletions
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c
index 69dca2e5..7f3b4c14 100644
--- a/daemon/gdm-session-worker-job.c
+++ b/daemon/gdm-session-worker-job.c
@@ -117,12 +117,19 @@ session_worker_job_setup_journal_fds (void)
static void
session_worker_job_child_setup (GdmSessionWorkerJob *session_worker_job)
{
+ sigset_t mask;
session_worker_job_setup_journal_fds ();
/* Terminate the process when the parent dies */
#ifdef HAVE_SYS_PRCTL_H
prctl (PR_SET_PDEATHSIG, SIGTERM);
#endif
+ /*
+ * Reset signal mask to default since it was altered by the
+ * manager process
+ */
+ sigemptyset (&mask);
+ sigprocmask (SIG_SETMASK, &mask, NULL);
}
static void
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 34b3bf7f..2dce5c86 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -2025,8 +2025,6 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
char *home_dir;
int stdin_fd = -1, stdout_fd = -1, stderr_fd = -1;
gboolean has_journald = FALSE, needs_controlling_terminal = FALSE;
- sigset_t mask;
-
/* Leak the TTY into the session as stdin so that it stays open
* without any races. */
if (worker->priv->session_tty_fd > 0) {
@@ -2147,19 +2145,6 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
*/
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);
-
- /*
- * Reset signal mask to default since it was altered by the
- * manager process
- */
- sigemptyset (&mask);
- sigprocmask (SIG_SETMASK, &mask, NULL);
-
gdm_session_execute (worker->priv->arguments[0],
worker->priv->arguments,
(char **)