/[packages]/cauldron/sudo/current/SOURCES/sudo-1.7.4p4-sudoi.patch
ViewVC logotype

Contents of /cauldron/sudo/current/SOURCES/sudo-1.7.4p4-sudoi.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17466 - (show annotations) (download)
Fri Jan 14 12:18:05 2011 UTC (10 years, 8 months ago) by blino
File size: 1845 byte(s)
imported package sudo
1 --- env.c Wed Aug 18 15:27:03 2010
2 +++ env.c Tue Sep 14 11:41:50 2010
3 @@ -608,10 +608,16 @@
4 #ifdef ENV_DEBUG
5 memset(env.envp, 0, env.env_size * sizeof(char *));
6 #endif
7 - if (def_env_reset || ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
8 - /* Reset HOME based on target user unless keeping old value. */
9 - reset_home = TRUE;
10
11 + /* Reset HOME based on target user if configured to. */
12 + if (ISSET(sudo_mode, MODE_RUN)) {
13 + if (def_always_set_home ||
14 + ISSET(sudo_mode, MODE_RESET_HOME | MODE_LOGIN_SHELL) ||
15 + (ISSET(sudo_mode, MODE_SHELL) && def_set_home))
16 + reset_home = TRUE;
17 + }
18 +
19 + if (def_env_reset || ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
20 /* Pull in vars we want to keep from the old environment. */
21 for (ep = old_envp; *ep; ep++) {
22 int keepit;
23 @@ -696,6 +702,11 @@
24 if (!ISSET(didvar, DID_USERNAME))
25 sudo_setenv("USERNAME", user_name, FALSE);
26 }
27 +
28 + /* If we didn't keep HOME, reset it based on target user. */
29 + if (!ISSET(didvar, KEPT_HOME))
30 + reset_home = TRUE;
31 +
32 /*
33 * Set MAIL to target user in -i mode or if MAIL is not preserved
34 * from user's environment.
35 @@ -709,13 +720,6 @@
36 sudo_putenv(cp, ISSET(didvar, DID_MAIL), TRUE);
37 }
38 } else {
39 - /* Reset HOME based on target user if configured to. */
40 - if (ISSET(sudo_mode, MODE_RUN)) {
41 - if (def_always_set_home || ISSET(sudo_mode, MODE_RESET_HOME) ||
42 - (ISSET(sudo_mode, MODE_SHELL) && def_set_home))
43 - reset_home = TRUE;
44 - }
45 -
46 /*
47 * Copy environ entries as long as they don't match env_delete or
48 * env_check.
49 @@ -765,7 +769,7 @@
50 }
51
52 /* Set $HOME to target user if not preserving user's value. */
53 - if (reset_home && !ISSET(didvar, KEPT_HOME))
54 + if (reset_home)
55 sudo_setenv("HOME", runas_pw->pw_dir, TRUE);
56
57 /* Provide default values for $TERM and $PATH if they are not set. */

  ViewVC Help
Powered by ViewVC 1.1.28