Disable function import by default, enabled only with -import-functions.diff -r1.65 -r1.66 pkgsrc/shells/bash/Makefile
(christos)
@@ -1,17 +1,18 @@ | @@ -1,17 +1,18 @@ | |||
1 | # $NetBSD: Makefile,v 1.65 2014/09/25 14:02:34 tron Exp $ | 1 | # $NetBSD: Makefile,v 1.66 2014/09/25 20:28:32 christos Exp $ | |
2 | 2 | |||
3 | BASH_VERSION= 4.3 | 3 | BASH_VERSION= 4.3 | |
4 | BASH_PATCHLEVEL= 025 | 4 | BASH_PATCHLEVEL= 025 | |
5 | PKGREVISION=1 | |||
5 | 6 | |||
6 | DISTNAME= bash-${BASH_VERSION} | 7 | DISTNAME= bash-${BASH_VERSION} | |
7 | PKGNAME= bash-${BASH_VERSION}.${BASH_PATCHLEVEL} | 8 | PKGNAME= bash-${BASH_VERSION}.${BASH_PATCHLEVEL} | |
8 | PKGREVISION= 1 | 9 | PKGREVISION= 1 | |
9 | CATEGORIES= shells | 10 | CATEGORIES= shells | |
10 | MASTER_SITES= ${MASTER_SITE_GNU:=bash/} \ | 11 | MASTER_SITES= ${MASTER_SITE_GNU:=bash/} \ | |
11 | ftp://ftp.cwru.edu/pub/bash/ | 12 | ftp://ftp.cwru.edu/pub/bash/ | |
12 | 13 | |||
13 | PATCH_SITES= ${MASTER_SITES:=bash-4.3-patches/} | 14 | PATCH_SITES= ${MASTER_SITES:=bash-4.3-patches/} | |
14 | PATCHFILES+= bash43-001 bash43-002 bash43-003 bash43-004 bash43-005 | 15 | PATCHFILES+= bash43-001 bash43-002 bash43-003 bash43-004 bash43-005 | |
15 | PATCHFILES+= bash43-006 bash43-007 bash43-008 bash43-009 bash43-010 | 16 | PATCHFILES+= bash43-006 bash43-007 bash43-008 bash43-009 bash43-010 | |
16 | PATCHFILES+= bash43-011 bash43-012 bash43-013 bash43-014 bash43-015 | 17 | PATCHFILES+= bash43-011 bash43-012 bash43-013 bash43-014 bash43-015 | |
17 | PATCHFILES+= bash43-016 bash43-017 bash43-018 bash43-019 bash43-020 | 18 | PATCHFILES+= bash43-016 bash43-017 bash43-018 bash43-019 bash43-020 |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | $NetBSD: distinfo,v 1.32 2014/09/25 14:02:34 tron Exp $ | 1 | $NetBSD: distinfo,v 1.33 2014/09/25 20:28:32 christos Exp $ | |
2 | 2 | |||
3 | SHA1 (bash-4.3.tar.gz) = 45ac3c5727e7262334f4dfadecdf601b39434e84 | 3 | SHA1 (bash-4.3.tar.gz) = 45ac3c5727e7262334f4dfadecdf601b39434e84 | |
4 | RMD160 (bash-4.3.tar.gz) = cd21a9f51ea7780994d4e2c9c7d16d5eb000f845 | 4 | RMD160 (bash-4.3.tar.gz) = cd21a9f51ea7780994d4e2c9c7d16d5eb000f845 | |
5 | Size (bash-4.3.tar.gz) = 7955839 bytes | 5 | Size (bash-4.3.tar.gz) = 7955839 bytes | |
6 | SHA1 (bash43-001) = d67ffd6833b30fd41f429205953714a184caa03b | 6 | SHA1 (bash43-001) = d67ffd6833b30fd41f429205953714a184caa03b | |
7 | RMD160 (bash43-001) = 6fc9c8c814602c60f6cda0965848dc19a2601a62 | 7 | RMD160 (bash43-001) = 6fc9c8c814602c60f6cda0965848dc19a2601a62 | |
8 | Size (bash43-001) = 1617 bytes | 8 | Size (bash43-001) = 1617 bytes | |
9 | SHA1 (bash43-002) = 0c1d486387e5f3bea6a97b317de54f9c3de71c7c | 9 | SHA1 (bash43-002) = 0c1d486387e5f3bea6a97b317de54f9c3de71c7c | |
10 | RMD160 (bash43-002) = eecdd1863f8cb8f6ae6055d88b5ea811f5cc5674 | 10 | RMD160 (bash43-002) = eecdd1863f8cb8f6ae6055d88b5ea811f5cc5674 | |
11 | Size (bash43-002) = 1594 bytes | 11 | Size (bash43-002) = 1594 bytes | |
12 | SHA1 (bash43-003) = 024d9a6dc6822bb5424f83478b495de29883fb3c | 12 | SHA1 (bash43-003) = 024d9a6dc6822bb5424f83478b495de29883fb3c | |
13 | RMD160 (bash43-003) = 957f27933224699fff6c508be93ac9b378af174d | 13 | RMD160 (bash43-003) = 957f27933224699fff6c508be93ac9b378af174d | |
14 | Size (bash43-003) = 1465 bytes | 14 | Size (bash43-003) = 1465 bytes | |
@@ -74,13 +74,15 @@ RMD160 (bash43-023) = 86e0fe2326a81b7182 | @@ -74,13 +74,15 @@ RMD160 (bash43-023) = 86e0fe2326a81b7182 | |||
74 | Size (bash43-023) = 3414 bytes | 74 | Size (bash43-023) = 3414 bytes | |
75 | SHA1 (bash43-024) = 875accb818ebecdb77a2fc3dc6167056ea1ce347 | 75 | SHA1 (bash43-024) = 875accb818ebecdb77a2fc3dc6167056ea1ce347 | |
76 | RMD160 (bash43-024) = a1fd34a95f55b37b065e824b494f3a35c4eb4361 | 76 | RMD160 (bash43-024) = a1fd34a95f55b37b065e824b494f3a35c4eb4361 | |
77 | Size (bash43-024) = 1909 bytes | 77 | Size (bash43-024) = 1909 bytes | |
78 | SHA1 (bash43-025) = 484d85e54547a18f9702284c55145e34e74768d1 | 78 | SHA1 (bash43-025) = 484d85e54547a18f9702284c55145e34e74768d1 | |
79 | RMD160 (bash43-025) = 9fd51a95756fcaf9b57cab9c29d6e3f6e3b900fe | 79 | RMD160 (bash43-025) = 9fd51a95756fcaf9b57cab9c29d6e3f6e3b900fe | |
80 | Size (bash43-025) = 3940 bytes | 80 | Size (bash43-025) = 3940 bytes | |
81 | SHA1 (patch-af) = dfd1d1be3d822cfc3ae0fd21bb2bbd3e35b11f0d | 81 | SHA1 (patch-af) = dfd1d1be3d822cfc3ae0fd21bb2bbd3e35b11f0d | |
82 | SHA1 (patch-ag) = 4da0a43f6b890482affff46b18eef4be67770e48 | 82 | SHA1 (patch-ag) = 4da0a43f6b890482affff46b18eef4be67770e48 | |
83 | SHA1 (patch-aj) = 8b3c52c2aee9cf53ee5a9ce64ead243d0970305e | 83 | SHA1 (patch-aj) = 8b3c52c2aee9cf53ee5a9ce64ead243d0970305e | |
84 | SHA1 (patch-builtins_ulimit.def) = d4cb59bedc6a6199f9a99a3530c99374e428baeb | 84 | SHA1 (patch-builtins_ulimit.def) = d4cb59bedc6a6199f9a99a3530c99374e428baeb | |
85 | SHA1 (patch-lib_readline_colors.c) = f2f47e7aa0b5c1e999368109de10f80e39fd4438 | 85 | SHA1 (patch-lib_readline_colors.c) = f2f47e7aa0b5c1e999368109de10f80e39fd4438 | |
86 | SHA1 (patch-parse.y) = 41c747ef8095b43c6b077a3fab54105d338f156e | 86 | SHA1 (patch-parse.y) = 41c747ef8095b43c6b077a3fab54105d338f156e | |
87 | SHA1 (patch-shell.c) = 08e55c3fa57a9e8eb6366c4eba91aa70f487acb2 | |||
88 | SHA1 (patch-variables.c) = 9fa0c4fc7650581b23d4fa768a0c76757a8874aa |
$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 },
$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);