summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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);