1 --- lightdm-1.19.3/src/session-child.c.~7~ 2017-04-25 12:24:59.852060367 +0300
2 +++ lightdm-1.19.3/src/session-child.c 2017-04-25 12:27:23.569942688 +0300
16 + * lightdm_read_default
18 + * This function is used to support systems that have the /etc/default/login
19 + * interface to control programs that affect security. This is a Solaris
20 + * thing, though some users on other systems may find it useful.
23 +lightdm_read_default (gchar *key)
25 + gchar *retval = NULL;
27 + if (defopen ("/etc/default/login") == 0) {
28 + int flags = defcntl (DC_GETFLAGS, 0);
30 + TURNOFF (flags, DC_CASE);
31 + (void) defcntl (DC_SETFLAGS, flags); /* ignore case */
32 + retval = g_strdup (defread (key));
33 + (void) defopen ((char *)NULL);
39 run_linc_cleanup(User *user)
45 + char * path_str = NULL;
47 /* Set POSIX variables */
48 - pam_putenv (pam_handle, "PATH=/usr/local/bin:/usr/bin:/bin");
49 + if (user_get_uid(user) == 0)
50 + path_str = lightdm_read_default ("SUPATH=");
52 + if (path_str == NULL)
53 + path_str = lightdm_read_default ("PATH=");
56 + if (path_str == NULL)
57 + path_str = "/usr/bin:/usr/sbin:/sbin:/usr/gnu/bin";
59 + pam_putenv (pam_handle, g_strdup_printf ("PATH=%s", path_str));
60 pam_putenv (pam_handle, g_strdup_printf ("USER=%s", username));
61 pam_putenv (pam_handle, g_strdup_printf ("LOGNAME=%s", username));
62 pam_putenv (pam_handle, g_strdup_printf ("HOME=%s", user_get_home_directory (user)));