Package: lightdm / 1.18.3-1

01_set-default-path.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Author: Yves-Alexis Perez <corsac@debian.org>
Author: Lionel Le Folgoc <mrpouit@gmail.com>
Bug: https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/798277
Description: Fix default PATH environment variable
--- a/src/seat.c
+++ b/src/seat.c
@@ -306,7 +306,10 @@ run_script (Seat *seat, DisplayServer *d
         process_set_env (script, "PATH", g_getenv ("PATH"));
     }
     else
-        process_set_env (script, "PATH", "/usr/local/bin:/usr/bin:/bin");
+        if (user_get_uid (user) == 0)
+          process_set_env (script, "PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin");
+        else
+          process_set_env (script, "PATH", "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games");
 
     if (user)
     {
--- a/src/session-child.c
+++ b/src/session-child.c
@@ -410,7 +410,10 @@ session_child_run (int argc, char **argv
         else
         {
             /* Set POSIX variables */
-            pam_putenv (pam_handle, "PATH=/usr/local/bin:/usr/bin:/bin");
+            if (user_get_uid (user) == 0)
+              pam_putenv (pam_handle, "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin");
+            else
+              pam_putenv (pam_handle, "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games");
             pam_putenv (pam_handle, g_strdup_printf ("USER=%s", username));
             pam_putenv (pam_handle, g_strdup_printf ("LOGNAME=%s", username));
             pam_putenv (pam_handle, g_strdup_printf ("HOME=%s", user_get_home_directory (user)));