summaryrefslogtreecommitdiff
path: root/shells
diff options
context:
space:
mode:
authorchristos <christos>2014-09-25 20:28:32 +0000
committerchristos <christos>2014-09-25 20:28:32 +0000
commitd71cfc5197f21437b19f2c51033f00e38ee44869 (patch)
tree8f8780e064c0944ae8054811b1f9b44ee6fe5045 /shells
parent68f288d9f7fb8cbceda1dd8e13643a816ccda5de (diff)
downloadpkgsrc-d71cfc5197f21437b19f2c51033f00e38ee44869.tar.gz
Disable function import by default, enabled only with -import-functions.
Diffstat (limited to 'shells')
-rw-r--r--shells/bash/Makefile3
-rw-r--r--shells/bash/distinfo4
-rw-r--r--shells/bash/patches/patch-shell.c22
-rw-r--r--shells/bash/patches/patch-variables.c23
4 files changed, 50 insertions, 2 deletions
diff --git a/shells/bash/Makefile b/shells/bash/Makefile
index a55ad08d84f..e6a124cce2e 100644
--- a/shells/bash/Makefile
+++ b/shells/bash/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.65 2014/09/25 14:02:34 tron Exp $
+# $NetBSD: Makefile,v 1.66 2014/09/25 20:28:32 christos Exp $
BASH_VERSION= 4.3
BASH_PATCHLEVEL= 025
+PKGREVISION=1
DISTNAME= bash-${BASH_VERSION}
PKGNAME= bash-${BASH_VERSION}.${BASH_PATCHLEVEL}
diff --git a/shells/bash/distinfo b/shells/bash/distinfo
index dc696f6e1ab..47bad9022d5 100644
--- a/shells/bash/distinfo
+++ b/shells/bash/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.32 2014/09/25 14:02:34 tron Exp $
+$NetBSD: distinfo,v 1.33 2014/09/25 20:28:32 christos Exp $
SHA1 (bash-4.3.tar.gz) = 45ac3c5727e7262334f4dfadecdf601b39434e84
RMD160 (bash-4.3.tar.gz) = cd21a9f51ea7780994d4e2c9c7d16d5eb000f845
@@ -84,3 +84,5 @@ SHA1 (patch-aj) = 8b3c52c2aee9cf53ee5a9ce64ead243d0970305e
SHA1 (patch-builtins_ulimit.def) = d4cb59bedc6a6199f9a99a3530c99374e428baeb
SHA1 (patch-lib_readline_colors.c) = f2f47e7aa0b5c1e999368109de10f80e39fd4438
SHA1 (patch-parse.y) = 41c747ef8095b43c6b077a3fab54105d338f156e
+SHA1 (patch-shell.c) = 08e55c3fa57a9e8eb6366c4eba91aa70f487acb2
+SHA1 (patch-variables.c) = 9fa0c4fc7650581b23d4fa768a0c76757a8874aa
diff --git a/shells/bash/patches/patch-shell.c b/shells/bash/patches/patch-shell.c
new file mode 100644
index 00000000000..7f37c86d4fe
--- /dev/null
+++ b/shells/bash/patches/patch-shell.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-shell.c,v 1.1 2014/09/25 20:28:32 christos Exp $
+
+Add flag to disable importing of function unless explicitly enabled
+
+--- shell.c.christos 2014-01-14 08:04:32.000000000 -0500
++++ shell.c 2014-09-25 16:11:51.000000000 -0400
+@@ -229,6 +229,7 @@
+ #else
+ int posixly_correct = 0; /* Non-zero means posix.2 superset. */
+ #endif
++int import_functions = 0; /* Import functions from environment */
+
+ /* Some long-winded argument names. These are obviously new. */
+ #define Int 1
+@@ -248,6 +249,7 @@
+ { "help", Int, &want_initial_help, (char **)0x0 },
+ { "init-file", Charp, (int *)0x0, &bashrc_file },
+ { "login", Int, &make_login_shell, (char **)0x0 },
++ { "import-functions", Int, &import_functions, (char **)0x0 },
+ { "noediting", Int, &no_line_editing, (char **)0x0 },
+ { "noprofile", Int, &no_profile, (char **)0x0 },
+ { "norc", Int, &no_rc, (char **)0x0 },
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);