[arch-commits] Commit in sudo/trunk (PKGBUILD allow-preserve-env-with-arg.patch)

Evangelos Foutras foutrelis at archlinux.org
Wed May 16 15:41:31 UTC 2018


    Date: Wednesday, May 16, 2018 @ 15:41:31
  Author: foutrelis
Revision: 324364

upgpkg: sudo 1.8.23-2

Allow using --preserve-env=VARIABLE together with --login (bug #835 upstream).

Added:
  sudo/trunk/allow-preserve-env-with-arg.patch
Modified:
  sudo/trunk/PKGBUILD

-----------------------------------+
 PKGBUILD                          |    7 ++++++-
 allow-preserve-env-with-arg.patch |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-05-16 15:12:20 UTC (rev 324363)
+++ PKGBUILD	2018-05-16 15:41:31 UTC (rev 324364)
@@ -6,7 +6,7 @@
 pkgname=sudo
 _sudover=1.8.23
 pkgver=${_sudover/p/.p}
-pkgrel=1
+pkgrel=2
 pkgdesc="Give certain users the ability to run some commands as root"
 arch=('x86_64')
 url="https://www.sudo.ws/sudo/"
@@ -16,14 +16,19 @@
 backup=('etc/sudoers' 'etc/pam.d/sudo')
 install=$pkgname.install
 source=(https://www.sudo.ws/sudo/dist/$pkgname-$_sudover.tar.gz{,.sig}
+        allow-preserve-env-with-arg.patch
         sudo.pam)
 sha256sums=('d863d29b6fc87bc784a3223350e2b28a2ff2c4738f0fb8f1c92bb38c3017e679'
             'SKIP'
+            '439edd65dbc0115794dec833968c538c98a275522ec9a2e0ac3d4a9eb9cc3b33'
             'd1738818070684a5d2c9b26224906aad69a4fea77aabd960fc2675aee2df1fa2')
 validpgpkeys=('59D1E9CCBA2B376704FDD35BA9F4C021CEA470FB')
 
 prepare() {
   cd "$srcdir/$pkgname-$_sudover"
+
+  # https://bugzilla.sudo.ws/show_bug.cgi?id=835
+  patch -Np1 -i ../allow-preserve-env-with-arg.patch
 }
 
 build() {

Added: allow-preserve-env-with-arg.patch
===================================================================
--- allow-preserve-env-with-arg.patch	                        (rev 0)
+++ allow-preserve-env-with-arg.patch	2018-05-16 15:41:31 UTC (rev 324364)
@@ -0,0 +1,35 @@
+
+# HG changeset patch
+# User Todd C. Miller <Todd.Miller at sudo.ws>
+# Date 1526483443 21600
+# Node ID 8ea75ca8fbd2de3877fed1b83a63d9ac8a9c14b1
+# Parent  7972215392428f23eb47c11ddffc0cc8a824fff0
+Only set MODE_PRESERVE_ENV when preserving the entire environment.
+Fixes a problem introduced in 1.8.23 where "sudo -i" could not be
+used in conjunction with --preserve-env=VARIABLE.  Bug #835
+
+diff -r 797221539242 -r 8ea75ca8fbd2 src/parse_args.c
+--- a/src/parse_args.c	Tue May 15 16:35:07 2018 -0600
++++ b/src/parse_args.c	Wed May 16 09:10:43 2018 -0600
+@@ -330,14 +330,15 @@
+ 		case 'E':
+ 		    /*
+ 		     * Optional argument is a comma-separated list of
+-		     * environment variables to preserve.  If not present,
+-		     * preserve everything.
++		     * environment variables to preserve.
++		     * If not present, preserve everything.
+ 		     */
+-		    if (optarg == NULL)
++		    if (optarg == NULL) {
+ 			sudo_settings[ARG_PRESERVE_ENVIRONMENT].value = "true";
+-		    else
++			SET(flags, MODE_PRESERVE_ENV);
++		    } else {
+ 			parse_env_list(&extra_env, optarg);
+-		    SET(flags, MODE_PRESERVE_ENV);
++		    }
+ 		    break;
+ 		case 'e':
+ 		    if (mode && mode != MODE_EDIT)
+



More information about the arch-commits mailing list