[gdm/wip/systemd-activation: 3/4] worker: hackity hack hack hack



commit 50c1d35b48d77215774e37ccde1cfc399199c0e0
Author: Ray Strode <rstrode redhat com>
Date:   Thu Apr 17 16:45:22 2014 -0400

    worker: hackity hack hack hack

 daemon/gdm-session-worker.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 4cbb529..c3de148 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1989,6 +1989,7 @@ set_up_for_new_vt (GdmSessionWorker *worker)
         int fd;
         char vt_string[256], tty_string[256];
         struct vt_stat vt_state = { 0 };
+        char *display;
         int session_vt = 0;
 
         fd = open ("/dev/tty0", O_RDWR | O_NOCTTY);
@@ -2036,6 +2037,19 @@ set_up_for_new_vt (GdmSessionWorker *worker)
 
         pam_set_item (worker->priv->pam_handle, PAM_TTY, tty_string);
 
+        /* HACK HACK HACK
+         * leave the FD open to prevent OPENQRY races, but make sure it's "unknown"
+         * so the login shell doesn't try to take a controlling interest in the tty
+         * change the ownership so the unprivileged Xorg can open it.
+         */
+        worker->priv->session_tty_fd = -1;
+        display = g_strdup_printf ("/run/user/%u/x11/%s.socket", worker->priv->uid, 
worker->priv->display_seat_id);
+        gdm_session_worker_set_environment_variable (worker,
+                                                     "DISPLAY",
+                                                     display);
+        pam_set_item (worker->priv->pam_handle, PAM_XDISPLAY, display);
+        g_free (display);
+
         return TRUE;
 
 fail:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]