chiark / gitweb /
Disable all exported shell functions
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Sep 2014 12:24:50 +0000 (13:24 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Sep 2014 14:48:25 +0000 (15:48 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/patches/0001-Disable-all-exported-shell-functions.diff [new file with mode: 0644]
debian/patches/series.in

diff --git a/debian/patches/0001-Disable-all-exported-shell-functions.diff b/debian/patches/0001-Disable-all-exported-shell-functions.diff
new file mode 100644 (file)
index 0000000..07e9ef8
--- /dev/null
@@ -0,0 +1,27 @@
+# DP: [PATCH] Disable all exported shell functions.
+
+diff --git a/bash/variables.c b/bash/variables.c
+index 92a5a10..fe0832e 100644
+--- a/bash/variables.c
++++ b/bash/variables.c
+@@ -347,6 +347,7 @@ initialize_shell_variables (env, privmode)
+       temp_var = (SHELL_VAR *)NULL;
++#if 0 /* Disable exporting shell functions because they are mad. */
+       /* 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))
+@@ -380,6 +381,9 @@ initialize_shell_variables (env, privmode)
+             report_error (_("error importing function definition for `%s'"), name);
+           }
+       }
++#else
++      if (0) ; /* needed for syntax */
++#endif
+ #if defined (ARRAY_VARS)
+ #  if ARRAY_EXPORT
+       /* Array variables may not yet be exported. */
+-- 
+1.7.10.4
+
index 0cee65c033fe1d3ac364b4987224136c555ca67a..05e18bc5773646f9fcfe9131d3b311e28abb3889 100644 (file)
@@ -62,3 +62,4 @@ exec-redirections-texi.diff
 #endif
 hardening-formatstring.diff
 unicode-escape-bug.diff
+0001-Disable-all-exported-shell-functions.diff