--- ./shell.c.org 2002-07-02 00:27:11.000000000 +0900 +++ ./shell.c 2014-09-30 23:20:58.000000000 +0900 @@ -193,6 +193,7 @@ static int want_initial_help; /* --help option */ int no_line_editing = 0; /* Don't do fancy line editing. */ +int import_functions = 0; /* Import functions from environment */ int posixly_correct = 0; /* Non-zero means posix.2 superset. */ int dump_translatable_strings; /* Dump strings in $"...", don't execute. */ int dump_po_strings; /* Dump strings in $"..." in po format */ @@ -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 }, --- ./variables.c.org 2014-09-30 23:20:17.000000000 +0900 +++ ./variables.c 2014-09-30 23:21:04.000000000 +0900 @@ -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))