Magellan Linux

Annotation of /trunk/shadow/patches/shadow-4.0.13-su-fix-environment.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 1070 byte(s)
-import

1 niro 153 The patch from upstream (shadow-4.0.11.1-SUPATH.patch) sets environ too
2     early when using PAM, so move it to !USE_PAM. Also set USER and SHELL.
3    
4     --- shadow-4.0.11.1/src/su.c 2005-08-04 12:34:35.000000000 +0200
5     +++ shadow-4.0.11.1.az/src/su.c 2005-08-04 12:38:57.000000000 +0200
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    
27     @@ -676,8 +676,11 @@
28     if (fakelogin)
29     setup_env (&pwent);
30     #if 1 /* Suggested by Joey Hess. XXX - is this right? */
31     - else
32     + else {
33     addenv ("HOME", pwent.pw_dir);
34     + addenv ("USER", pwent.pw_name);
35     + addenv ("SHELL", pwent.pw_shell);
36     + }
37     #endif
38    
39     /*