Import of pkgsrc-2015Q1

This commit is contained in:
2015-04-22 14:34:26 +02:00
committed by Lionel Sambuc
parent 9a8c06dafb
commit 4af1cdf7a9
25114 changed files with 870550 additions and 795435 deletions

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-shell.c,v 1.1 2014/09/27 03:00:06 christos Exp $
Add flag to disable importing of function unless explicitly enabled
--- shell.c.orig 2002-07-01 11:27:11.000000000 -0400
+++ shell.c 2014-09-26 22:52:27.000000000 -0400
@@ -197,6 +197,7 @@
int dump_translatable_strings; /* Dump strings in $"...", don't execute. */
int dump_po_strings; /* Dump strings in $"..." in po format */
int wordexp_only = 0; /* Do word expansion only */
+int import_functions = 0; /* Import functions from environment */
/* Some long-winded argument names. These are obviously new. */
#define Int 1
@@ -213,6 +214,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 },

View File

@@ -0,0 +1,23 @@
$NetBSD: patch-variables.c,v 1.2 2014/09/30 18:27:40 christos Exp $
Only read functions from environment if flag is set.
--- variables.c.orig 2014-09-30 14:22:56.000000000 -0400
+++ variables.c 2014-09-30 14:23:31.000000000 -0400
@@ -87,6 +87,7 @@
extern SHELL_VAR *this_shell_function;
extern char *this_command_name;
extern time_t shell_start_time;
+extern int import_functions;
/* The list of shell variables that the user has created at the global
scope, or that came from the environment. */
@@ -265,7 +266,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 &&
+ if (import_functions && privmode == 0 && read_but_dont_execute == 0 &&
STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
STREQN ("() {", string, 4))