summaryrefslogtreecommitdiff
path: root/shells/bash/patches/patch-variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'shells/bash/patches/patch-variables.c')
-rw-r--r--shells/bash/patches/patch-variables.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/shells/bash/patches/patch-variables.c b/shells/bash/patches/patch-variables.c
new file mode 100644
index 00000000000..bb93ba5b9dd
--- /dev/null
+++ b/shells/bash/patches/patch-variables.c
@@ -0,0 +1,23 @@
+$NetBSD: patch-variables.c,v 1.1 2014/09/25 20:28:32 christos Exp $
+
+Only read functions from environment if flag is set.
+
+--- variables.c.christos 2014-09-25 16:09:41.000000000 -0400
++++ variables.c 2014-09-25 16:12:10.000000000 -0400
+@@ -105,6 +105,7 @@
+ extern int assigning_in_environment;
+ extern int executing_builtin;
+ extern int funcnest_max;
++extern int import_functions;
+
+ #if defined (READLINE)
+ extern int no_line_editing;
+@@ -349,7 +350,7 @@
+
+ /* If exported function, define it now. Don't import functions from
+ the environment in privileged mode. */
+- if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
++ if (import_functions && privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
+ {
+ string_length = strlen (string);
+ temp_string = (char *)xmalloc (3 + string_length + char_index);