1 --- lightdm-1.19.3/src/session.c 2016-08-12 00:32:27.703931801 +0300
2 +++ session.c 2016-08-12 00:32:21.342169373 +0300
4 #include <glib/gstdio.h>
8 +#include <sys/param.h>
12 #ifdef HAVE_SMF_CONTRACTS
15 G_IMPLEMENT_INTERFACE (
16 LOGGER_TYPE, session_logger_iface_init));
20 +create_device (const char *dev);
23 +create_device (const char *dev)
25 + gchar buf[MAXPATHLEN + 1];
28 + if (dev == NULL || dev[0] == '\0')
31 + if (strcmp (dev, "/dev/dtlocal") != 0 &&
32 + strcmp (dev, "/dev/dtremote") != 0 )
35 + memset (buf, 0, sizeof (gchar) * (MAXPATHLEN + 1));
37 + if (stat (dev, &st) != 0) {
38 + g_debug ("Creating pseudo-device %s", dev);
39 + symlink ("/dev/null", dev);
40 + } else if (readlink (dev, buf, MAXPATHLEN) > 0) {
41 + if (strcmp (buf, "/dev/null") == 0) {
43 + struct utimbuf timebuf;
45 + timebuf.modtime = time ((time_t *) 0);
46 + timebuf.actime = timebuf.modtime;
48 + if ((utime (dev, &timebuf)) != 0)
49 + g_debug ("Problem updating access time of pseudo-device %s", dev);
51 + g_debug ("Touching pseudo-device %s", dev);
53 + g_debug ("Device %s points to %s", dev, buf);
56 + g_debug ("Device %s is not a symlink", dev);
61 #ifdef HAVE_SMF_CONTRACTS
62 static int contracts_fd = -1;
66 write_data (session, &version, sizeof (version));
69 + if(priv->remote_host_name) {
70 + create_device("/dev/dtremote");
71 + } else if (!g_str_equal (priv->xdisplay,":0")) {
72 + create_device("/dev/dtlocal");
76 /* Send configuration */
77 write_string (session, session->priv->pam_service);
78 write_string (session, session->priv->username);