summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-04-17 16:45:22 -0400
committerRay Strode <rstrode@redhat.com>2014-04-22 13:32:16 -0400
commit50c1d35b48d77215774e37ccde1cfc399199c0e0 (patch)
tree3324f2154d9f31c33fe6b8cc85989f97f94633ec
parentd07db1e9f4c494b045b0cb2bb6c1b45a6252f3e5 (diff)
downloadgdm-50c1d35b48d77215774e37ccde1cfc399199c0e0.tar.gz
worker: hackity hack hack hack
-rw-r--r--daemon/gdm-session-worker.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 4cbb5291..c3de1481 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: