summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTavis Ormandy <taviso@gentoo.org>2004-11-13 09:31:38 +0000
committerTavis Ormandy <taviso@gentoo.org>2004-11-13 09:31:38 +0000
commit65004d5f36a4aa7e2da6a06bbfdbb0faae4b0102 (patch)
treeebe9a569e160f8f9001375c714bddb0c91b49972 /app-admin/sudo/files
parentdigest wrong (Manifest recommit) (diff)
downloadgentoo-2-65004d5f36a4aa7e2da6a06bbfdbb0faae4b0102.tar.gz
gentoo-2-65004d5f36a4aa7e2da6a06bbfdbb0faae4b0102.tar.bz2
gentoo-2-65004d5f36a4aa7e2da6a06bbfdbb0faae4b0102.zip
commit patch
Diffstat (limited to 'app-admin/sudo/files')
-rw-r--r--app-admin/sudo/files/sudo-1.6.7_p5-strip-bash-functions.diff32
1 files changed, 32 insertions, 0 deletions
diff --git a/app-admin/sudo/files/sudo-1.6.7_p5-strip-bash-functions.diff b/app-admin/sudo/files/sudo-1.6.7_p5-strip-bash-functions.diff
new file mode 100644
index 000000000000..021005f888c4
--- /dev/null
+++ b/app-admin/sudo/files/sudo-1.6.7_p5-strip-bash-functions.diff
@@ -0,0 +1,32 @@
+diff -ruN sudo-1.6.7p5/env.c sudo-1.6.7p5.new/env.c
+--- sudo-1.6.7p5/env.c 2003-05-06 05:32:22.000000000 +0100
++++ sudo-1.6.7p5.new/env.c 2004-11-11 23:27:47.659539072 +0000
+@@ -296,7 +296,14 @@
+ /* Pull in vars we want to keep from the old environment. */
+ for (ep = envp; *ep; ep++) {
+ keepit = 0;
+- for (cur = def_list(I_ENV_KEEP); cur; cur = cur->next) {
++
++ /* Skip variables with values beginning with () (bash functions) */
++ if ((cp = strchr(*ep, '=')) != NULL) {
++ if (strncmp(cp, "=() ", 3) == 0)
++ continue;
++ }
++
++ for (cur = def_list(I_ENV_KEEP); cur; cur = cur->next) {
+ len = strlen(cur->value);
+ /* Deal with '*' wildcard */
+ if (cur->value[len - 1] == '*') {
+@@ -370,6 +377,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_list(I_ENV_DELETE); cur && okvar; cur = cur->next) {
+ len = strlen(cur->value);