]> git.wh0rd.org - patches.git/blame - shadow-4.0.14-su-fix-environment.patch
initial import
[patches.git] / shadow-4.0.14-su-fix-environment.patch
CommitLineData
5e993f12 1The patch from upstream (shadow-4.0.11.1-SUPATH.patch) sets environ too
2early when using PAM, so move it to !USE_PAM.
3
4--- shadow-4.0.14/src/su.c
5+++ shadow-4.0.14/src/su.c
6@@ -594,11 +594,6 @@
7 addenv ("PATH", cp);
8 }
9
10-#ifndef USE_PAM
11- /* setup the environment for PAM later on, else we run into auth problems */
12- environ = newenvp; /* make new environment active */
13-#endif
14-
15 if (getenv ("IFS")) /* don't export user IFS ... */
16 addenv ("IFS= \t\n", NULL); /* ... instead, set a safe IFS */
17
18@@ -666,6 +664,8 @@
19 exit (1);
20 }
21 #else /* !USE_PAM */
22+ environ = newenvp; /* make new environment active */
23+
24 if (!amroot) /* no limits if su from root */
25 setup_limits (&pwent);
26