]> git.pld-linux.org Git - packages/sudo.git/commitdiff
- restore to pre 1.7.4 behaviour of -H and $HOME ($MAIL) auto/th/sudo-1_7_4p4-2 auto/ti/sudo-1_7_4p4-2
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 14 Sep 2010 21:15:15 +0000 (21:15 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bug-440.patch -> 1.1
    sudo.spec -> 1.173

bug-440.patch [new file with mode: 0644]
sudo.spec

diff --git a/bug-440.patch b/bug-440.patch
new file mode 100644 (file)
index 0000000..57f255e
--- /dev/null
@@ -0,0 +1,57 @@
+--- 1.7.4p4/env.c      Wed Aug 18 15:27:03 2010
++++ 1.7/env.c  Tue Sep 14 11:41:50 2010
+@@ -608,10 +608,16 @@
+ #ifdef ENV_DEBUG
+     memset(env.envp, 0, env.env_size * sizeof(char *));
+ #endif
+-    if (def_env_reset || ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
+-      /* Reset HOME based on target user unless keeping old value. */
+-      reset_home = TRUE;
++    /* Reset HOME based on target user if configured to. */
++    if (ISSET(sudo_mode, MODE_RUN)) {
++      if (def_always_set_home ||
++          ISSET(sudo_mode, MODE_RESET_HOME | MODE_LOGIN_SHELL) || 
++          (ISSET(sudo_mode, MODE_SHELL) && def_set_home))
++          reset_home = TRUE;
++    }
++
++    if (def_env_reset || ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
+       /* Pull in vars we want to keep from the old environment. */
+       for (ep = old_envp; *ep; ep++) {
+           int keepit;
+@@ -696,6 +702,11 @@
+           if (!ISSET(didvar, DID_USERNAME))
+               sudo_setenv("USERNAME", user_name, FALSE);
+       }
++
++      /* If we didn't keep HOME, reset it based on target user. */
++      if (!ISSET(didvar, KEPT_HOME))
++          reset_home = TRUE;
++
+       /*
+        * Set MAIL to target user in -i mode or if MAIL is not preserved
+        * from user's environment.
+@@ -709,13 +720,6 @@
+           sudo_putenv(cp, ISSET(didvar, DID_MAIL), TRUE);
+       }
+     } else {
+-      /* Reset HOME based on target user if configured to. */
+-      if (ISSET(sudo_mode, MODE_RUN)) {
+-          if (def_always_set_home || ISSET(sudo_mode, MODE_RESET_HOME) || 
+-              (ISSET(sudo_mode, MODE_SHELL) && def_set_home))
+-              reset_home = TRUE;
+-      }
+-
+       /*
+        * Copy environ entries as long as they don't match env_delete or
+        * env_check.
+@@ -765,7 +769,7 @@
+     }
+     /* Set $HOME to target user if not preserving user's value. */
+-    if (reset_home && !ISSET(didvar, KEPT_HOME))
++    if (reset_home)
+       sudo_setenv("HOME", runas_pw->pw_dir, TRUE);
+     /* Provide default values for $TERM and $PATH if they are not set. */
index e23dff4ec40787f9637d878f9c821044a148e8cd..a345266c4e223aaf76f537639f34918047236215 100644 (file)
--- a/sudo.spec
+++ b/sudo.spec
@@ -1,6 +1,3 @@
-# TODO
-# - think of reverting 1.7.4 "behaviour" for -H and $HOME:
-#   http://www.gratisoft.us/bugzilla/show_bug.cgi?id=440
 #
 # Conditional build:
 %bcond_with    kerberos5       # enable Kerberos V support (conflicts with PAM)
@@ -24,7 +21,7 @@ Summary(ru.UTF-8):    Позволяет определенным пользова
 Summary(uk.UTF-8):     Дозволяє вказаним користувачам виконувати команди від імені root
 Name:          sudo
 Version:       1.7.4p4
-Release:       1
+Release:       2
 Epoch:         1
 License:       BSD
 Group:         Applications/System
@@ -35,6 +32,7 @@ Source2:      %{name}-i.pamd
 Source3:       %{name}.logrotate
 Patch0:                %{name}-libtool.patch
 Patch1:                %{name}-env.patch
+Patch2:                bug-440.patch
 URL:           http://www.sudo.ws/sudo/
 BuildRequires: autoconf >= 2.53
 BuildRequires: automake
@@ -146,6 +144,7 @@ rm -f acsite.m4
 
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__mv} install-sh install-custom-sh
This page took 0.046414 seconds and 4 git commands to generate.