1 --- lightdm-1.26.0/src/x-server.c 2018-02-07 00:31:03.000000000 +0000
2 +++ lightdm-1.26.0/src/x-server.c.new 2018-06-01 07:07:33.856561224 +0000
3 @@ -142,7 +142,11 @@ x_server_connect_session (DisplayServer
4 g_autofree gchar *tty_text = NULL;
5 g_autofree gchar *vt_text = NULL;
8 + tty_text = g_strdup_printf ("/dev/vt/%d", vt);
10 tty_text = g_strdup_printf ("/dev/tty%d", vt);
12 session_set_tty (session, tty_text);
14 vt_text = g_strdup_printf ("%d", vt);
15 --- lightdm-1.19.3/src/session-child.c.~4~ 2016-08-09 20:12:33.810235770 +0300
16 +++ lightdm-1.19.3/src/session-child.c 2016-08-09 20:24:45.765910776 +0300
26 pam_set_item (pam_handle, PAM_XDISPLAY, xdisplay);
31 + /* We can't get real device name for X display on this stage.
32 + * But we can use the following logic.
33 + * 1. Local sessions without VT support. If the display is ":0",
34 + * we can set device to tty if it starts with "/dev/vt/", otherwise we
35 + * set the device as "/dev/console" to gain device permissions.
36 + * The later only happens on those systems do not has VT support such as
37 + * old Solaris. So far, Linux and OpenSolaris with VT support.
38 + * 2. XDMCP sessions, we set device as "/dev/dtremote"
39 + * 3. Local sessions like SunRay, Xvfb, Xvnc, we set device as
42 + if (remote_host_name) {
43 + /* This is for XDMCP sessions. */
44 + out = "/dev/dtremote";
46 + if (g_str_equal (xdisplay, ":0")) {
47 + /* This is for local session run on console. */
48 + if (g_str_has_prefix(tty,"/dev/vt/")){
51 + out = "/dev/console";
54 + /* This is for local sessions like
55 + * SunRay, Xvfb, Xvnc, etc. */
56 + out = "/dev/dtlocal";
60 + g_printerr ("lightdm: Got tty: '%s'", out);
61 + pam_set_item (pam_handle, PAM_TTY, out);
63 pam_set_item (pam_handle, PAM_TTY, xdisplay);