strip bash functions from environment
authorTavis Ormandy <taviso@gentoo.org>
Thu, 11 Nov 2004 23:25:15 +0000 (23:25 +0000)
committerTavis Ormandy <taviso@gentoo.org>
Thu, 11 Nov 2004 23:25:15 +0000 (23:25 +0000)
app-admin/sudo/Manifest
app-admin/sudo/files/sudo-strip-bash-functions.diff [new file with mode: 0644]
app-admin/sudo/sudo-1.6.8_p1-r2.ebuild

index 500cc14f516fdf87018d12ba562c788da3a83863..f7e9657262cd56abaf5f90a6063894f0dfbb0c38 100644 (file)
@@ -5,7 +5,7 @@ MD5 81fb337f88166432ab3ab058a6f9df0e sudo-1.6.8_p1-r1.ebuild 1433
 MD5 8c94167c21e8ef1c80a87dd4a7d448bf sudo-1.6.7_p5-r1.ebuild 1371
 MD5 c4364dcfd263577598949e28a081203a sudo-1.6.7_p5.ebuild 976
 MD5 42569f9df316909f79f5ddd7802a21a8 ChangeLog 3539
-MD5 12798f99839d9dedd0cd74db02d23fa7 sudo-1.6.8_p1-r2.ebuild 1501
+MD5 0209e0398b74dcb8dfd570e1fa4d8b56 sudo-1.6.8_p1-r2.ebuild 1552
 MD5 a5463236fbb98e4ee6b1a0faba8c9c52 files/sudo 135
 MD5 ea5d9d51e647a2dbd410d952019ff19b files/digest-sudo-1.6.7_p5-r1 64
 MD5 ea5d9d51e647a2dbd410d952019ff19b files/digest-sudo-1.6.7_p5-r2 64
@@ -15,5 +15,6 @@ MD5 0b50aabedf9bb326893b5f1c333e46b2 files/sudo-skeychallengeargs.diff 567
 MD5 d3a1edd41e6a44e7dae35d250aea266e files/digest-sudo-1.6.6 62
 MD5 3ec686ddc0fb74ee3a84e182e23ceb96 files/sudoers 854
 MD5 46618a1b8f9dd4b3d35476c1e63217b0 files/sudo-1.6.8_p1-suid_fix.patch 434
+MD5 4362800877ccb8e27de5437707d8a954 files/sudo-strip-bash-functions.diff 1335
 MD5 ea5d9d51e647a2dbd410d952019ff19b files/digest-sudo-1.6.7_p5 64
 MD5 703a1c523c89153f9bf6f11be6b65778 files/digest-sudo-1.6.8_p1 64
diff --git a/app-admin/sudo/files/sudo-strip-bash-functions.diff b/app-admin/sudo/files/sudo-strip-bash-functions.diff
new file mode 100644 (file)
index 0000000..1bd6d64
--- /dev/null
@@ -0,0 +1,44 @@
+Index: env.c
+===================================================================
+RCS file: /home/cvs/courtesan/sudo/env.c,v
+retrieving revision 1.42
+retrieving revision 1.43
+diff -u -r1.42 -r1.43
+--- env.c      8 Sep 2004 15:57:49 -0000       1.42
++++ env.c      11 Nov 2004 16:20:59 -0000      1.43
+@@ -52,7 +52,7 @@
+ #include "sudo.h"
+ 
+ #ifndef lint
+-static const char rcsid[] = "$Sudo: env.c,v 1.42 2004/09/08 15:57:49 millert Exp $";
++static const char rcsid[] = "$Sudo: env.c,v 1.43 2004/11/11 16:20:59 millert Exp $";
+ #endif /* lint */
+ 
+ /*
+@@ -323,6 +323,13 @@
+       /* Pull in vars we want to keep from the old environment. */
+       for (ep = envp; *ep; ep++) {
+           keepit = 0;
++
++          /* Skip variables with values beginning with () (bash functions) */
++          if ((cp = strchr(*ep, '=')) != NULL) {
++              if (strncmp(cp, "=() ", 3) == 0)
++                  continue;
++          }
++
+           for (cur = def_env_keep; cur; cur = cur->next) {
+               len = strlen(cur->value);
+               /* Deal with '*' wildcard */
+@@ -404,6 +411,12 @@
+        */
+       for (ep = envp; *ep; ep++) {
+           okvar = 1;
++
++          /* Skip variables with values beginning with () (bash functions) */
++          if ((cp = strchr(*ep, '=')) != NULL) {
++              if (strncmp(cp, "=() ", 3) == 0)
++                  continue;
++          }
+ 
+           /* Skip anything listed in env_delete. */
+           for (cur = def_env_delete; cur && okvar; cur = cur->next) {
index 3749a8dba87c4d86ad35ba738b2888c72f6a78cf..f4f6b8e2e133ee13f1905e5ebe9b4a5f8a398e5d 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild,v 1.1 2004/11/11 23:15:15 taviso Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild,v 1.2 2004/11/11 23:25:15 taviso Exp $
 
 inherit gnuconfig eutils
 
@@ -29,6 +29,7 @@ src_unpack() {
 
        epatch ${FILESDIR}/${P}-suid_fix.patch
        use skey && epatch ${FILESDIR}/${PN}-skeychallengeargs.diff
+       epatch ${FILESDIR}/sudo-strip-bash-functions.diff
 }
 
 src_compile() {