packages: sudo/sudo.spec, sudo/bug-440.patch (NEW) - restore to pre 1.7.4 b...

glen glen at pld-linux.org
Tue Sep 14 23:15:20 CEST 2010


Author: glen                         Date: Tue Sep 14 21:15:20 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- restore to pre 1.7.4 behaviour of -H and $HOME ($MAIL)

---- Files affected:
packages/sudo:
   sudo.spec (1.172 -> 1.173) , bug-440.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/sudo/sudo.spec
diff -u packages/sudo/sudo.spec:1.172 packages/sudo/sudo.spec:1.173
--- packages/sudo/sudo.spec:1.172	Tue Sep 14 22:17:51 2010
+++ packages/sudo/sudo.spec	Tue Sep 14 23:15:15 2010
@@ -1,7 +1,4 @@
 # $Revision$, $Date$
-# 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)
@@ -25,7 +22,7 @@
 Summary(uk.UTF-8):	Дозволяє вказаним користувачам виконувати команди від імені root
 Name:		sudo
 Version:	1.7.4p4
-Release:	1
+Release:	2
 Epoch:		1
 License:	BSD
 Group:		Applications/System
@@ -36,6 +33,7 @@
 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
@@ -147,6 +145,7 @@
 
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__mv} install-sh install-custom-sh
@@ -264,6 +263,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.173  2010/09/14 21:15:15  glen
+- restore to pre 1.7.4 behaviour of -H and $HOME ($MAIL)
+
 Revision 1.172  2010/09/14 20:17:51  glen
 - upstream bug
 

================================================================
Index: packages/sudo/bug-440.patch
diff -u /dev/null packages/sudo/bug-440.patch:1.1
--- /dev/null	Tue Sep 14 23:15:20 2010
+++ packages/sudo/bug-440.patch	Tue Sep 14 23:15:15 2010
@@ -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. */
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/sudo/sudo.spec?r1=1.172&r2=1.173&f=u



More information about the pld-cvs-commit mailing list