--- ./shell.c.org 2005-09-05 11:32:08.000000000 +0900 +++ ./shell.c 2014-10-18 02:46:37.000000000 +0900 @@ -197,6 +197,7 @@ int debugging_mode = 0; /* In debugging mode with --debugger */ int no_line_editing = 0; /* Don't do fancy line editing. */ +int import_functions = 0; /* Import functions from environment */ 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 */ @@ -227,6 +228,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-10-18 02:38:40.000000000 +0900 +++ ./variables.c 2014-10-18 02:38:40.000000000 +0900 @@ -97,6 +97,7 @@ extern char *this_command_name; extern char *command_execution_string; extern time_t shell_start_time; +extern int import_functions; #if defined (READLINE) extern int no_line_editing; @@ -306,7 +307,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))