Thu Sep 25 20:28:32 2014 UTC ()
Disable function import by default, enabled only with -import-functions.


(christos)
diff -r1.65 -r1.66 pkgsrc/shells/bash/Makefile
diff -r1.32 -r1.33 pkgsrc/shells/bash/distinfo
diff -r0 -r1.1 pkgsrc/shells/bash/patches/patch-shell.c
diff -r0 -r1.1 pkgsrc/shells/bash/patches/patch-variables.c

cvs diff -r1.65 -r1.66 pkgsrc/shells/bash/Makefile (expand / switch to unified diff)

--- pkgsrc/shells/bash/Makefile 2014/09/25 14:02:34 1.65
+++ pkgsrc/shells/bash/Makefile 2014/09/25 20:28:32 1.66
@@ -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
3BASH_VERSION= 4.3 3BASH_VERSION= 4.3
4BASH_PATCHLEVEL= 025 4BASH_PATCHLEVEL= 025
 5PKGREVISION=1
5 6
6DISTNAME= bash-${BASH_VERSION} 7DISTNAME= bash-${BASH_VERSION}
7PKGNAME= bash-${BASH_VERSION}.${BASH_PATCHLEVEL} 8PKGNAME= bash-${BASH_VERSION}.${BASH_PATCHLEVEL}
8PKGREVISION= 1 9PKGREVISION= 1
9CATEGORIES= shells 10CATEGORIES= shells
10MASTER_SITES= ${MASTER_SITE_GNU:=bash/} \ 11MASTER_SITES= ${MASTER_SITE_GNU:=bash/} \
11 ftp://ftp.cwru.edu/pub/bash/ 12 ftp://ftp.cwru.edu/pub/bash/
12 13
13PATCH_SITES= ${MASTER_SITES:=bash-4.3-patches/} 14PATCH_SITES= ${MASTER_SITES:=bash-4.3-patches/}
14PATCHFILES+= bash43-001 bash43-002 bash43-003 bash43-004 bash43-005 15PATCHFILES+= bash43-001 bash43-002 bash43-003 bash43-004 bash43-005
15PATCHFILES+= bash43-006 bash43-007 bash43-008 bash43-009 bash43-010 16PATCHFILES+= bash43-006 bash43-007 bash43-008 bash43-009 bash43-010
16PATCHFILES+= bash43-011 bash43-012 bash43-013 bash43-014 bash43-015 17PATCHFILES+= bash43-011 bash43-012 bash43-013 bash43-014 bash43-015
17PATCHFILES+= bash43-016 bash43-017 bash43-018 bash43-019 bash43-020 18PATCHFILES+= bash43-016 bash43-017 bash43-018 bash43-019 bash43-020

cvs diff -r1.32 -r1.33 pkgsrc/shells/bash/distinfo (expand / switch to unified diff)

--- pkgsrc/shells/bash/distinfo 2014/09/25 14:02:34 1.32
+++ pkgsrc/shells/bash/distinfo 2014/09/25 20:28:32 1.33
@@ -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
3SHA1 (bash-4.3.tar.gz) = 45ac3c5727e7262334f4dfadecdf601b39434e84 3SHA1 (bash-4.3.tar.gz) = 45ac3c5727e7262334f4dfadecdf601b39434e84
4RMD160 (bash-4.3.tar.gz) = cd21a9f51ea7780994d4e2c9c7d16d5eb000f845 4RMD160 (bash-4.3.tar.gz) = cd21a9f51ea7780994d4e2c9c7d16d5eb000f845
5Size (bash-4.3.tar.gz) = 7955839 bytes 5Size (bash-4.3.tar.gz) = 7955839 bytes
6SHA1 (bash43-001) = d67ffd6833b30fd41f429205953714a184caa03b 6SHA1 (bash43-001) = d67ffd6833b30fd41f429205953714a184caa03b
7RMD160 (bash43-001) = 6fc9c8c814602c60f6cda0965848dc19a2601a62 7RMD160 (bash43-001) = 6fc9c8c814602c60f6cda0965848dc19a2601a62
8Size (bash43-001) = 1617 bytes 8Size (bash43-001) = 1617 bytes
9SHA1 (bash43-002) = 0c1d486387e5f3bea6a97b317de54f9c3de71c7c 9SHA1 (bash43-002) = 0c1d486387e5f3bea6a97b317de54f9c3de71c7c
10RMD160 (bash43-002) = eecdd1863f8cb8f6ae6055d88b5ea811f5cc5674 10RMD160 (bash43-002) = eecdd1863f8cb8f6ae6055d88b5ea811f5cc5674
11Size (bash43-002) = 1594 bytes 11Size (bash43-002) = 1594 bytes
12SHA1 (bash43-003) = 024d9a6dc6822bb5424f83478b495de29883fb3c 12SHA1 (bash43-003) = 024d9a6dc6822bb5424f83478b495de29883fb3c
13RMD160 (bash43-003) = 957f27933224699fff6c508be93ac9b378af174d 13RMD160 (bash43-003) = 957f27933224699fff6c508be93ac9b378af174d
14Size (bash43-003) = 1465 bytes 14Size (bash43-003) = 1465 bytes
@@ -74,13 +74,15 @@ RMD160 (bash43-023) = 86e0fe2326a81b7182 @@ -74,13 +74,15 @@ RMD160 (bash43-023) = 86e0fe2326a81b7182
74Size (bash43-023) = 3414 bytes 74Size (bash43-023) = 3414 bytes
75SHA1 (bash43-024) = 875accb818ebecdb77a2fc3dc6167056ea1ce347 75SHA1 (bash43-024) = 875accb818ebecdb77a2fc3dc6167056ea1ce347
76RMD160 (bash43-024) = a1fd34a95f55b37b065e824b494f3a35c4eb4361 76RMD160 (bash43-024) = a1fd34a95f55b37b065e824b494f3a35c4eb4361
77Size (bash43-024) = 1909 bytes 77Size (bash43-024) = 1909 bytes
78SHA1 (bash43-025) = 484d85e54547a18f9702284c55145e34e74768d1 78SHA1 (bash43-025) = 484d85e54547a18f9702284c55145e34e74768d1
79RMD160 (bash43-025) = 9fd51a95756fcaf9b57cab9c29d6e3f6e3b900fe 79RMD160 (bash43-025) = 9fd51a95756fcaf9b57cab9c29d6e3f6e3b900fe
80Size (bash43-025) = 3940 bytes 80Size (bash43-025) = 3940 bytes
81SHA1 (patch-af) = dfd1d1be3d822cfc3ae0fd21bb2bbd3e35b11f0d 81SHA1 (patch-af) = dfd1d1be3d822cfc3ae0fd21bb2bbd3e35b11f0d
82SHA1 (patch-ag) = 4da0a43f6b890482affff46b18eef4be67770e48 82SHA1 (patch-ag) = 4da0a43f6b890482affff46b18eef4be67770e48
83SHA1 (patch-aj) = 8b3c52c2aee9cf53ee5a9ce64ead243d0970305e 83SHA1 (patch-aj) = 8b3c52c2aee9cf53ee5a9ce64ead243d0970305e
84SHA1 (patch-builtins_ulimit.def) = d4cb59bedc6a6199f9a99a3530c99374e428baeb 84SHA1 (patch-builtins_ulimit.def) = d4cb59bedc6a6199f9a99a3530c99374e428baeb
85SHA1 (patch-lib_readline_colors.c) = f2f47e7aa0b5c1e999368109de10f80e39fd4438 85SHA1 (patch-lib_readline_colors.c) = f2f47e7aa0b5c1e999368109de10f80e39fd4438
86SHA1 (patch-parse.y) = 41c747ef8095b43c6b077a3fab54105d338f156e 86SHA1 (patch-parse.y) = 41c747ef8095b43c6b077a3fab54105d338f156e
 87SHA1 (patch-shell.c) = 08e55c3fa57a9e8eb6366c4eba91aa70f487acb2
 88SHA1 (patch-variables.c) = 9fa0c4fc7650581b23d4fa768a0c76757a8874aa

File Added: pkgsrc/shells/bash/patches/Attic/patch-shell.c
$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 },

File Added: pkgsrc/shells/bash/patches/Attic/patch-variables.c
$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);