diff options
author | Jari Aalto <jari.aalto@cante.net> | 1999-02-19 17:11:39 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:52 +0000 |
commit | b72432fdcc59300c6fe7c9d6c8a31ad3447933f5 (patch) | |
tree | b9899162338c2ff3fd83a8aef8831cb119e85cd7 /builtins/shopt.def | |
parent | bc4cd23ce958feda898c618215f94d8a4e8f4ffa (diff) | |
download | android_external_bash-b72432fdcc59300c6fe7c9d6c8a31ad3447933f5.tar.gz android_external_bash-b72432fdcc59300c6fe7c9d6c8a31ad3447933f5.tar.bz2 android_external_bash-b72432fdcc59300c6fe7c9d6c8a31ad3447933f5.zip |
Imported from ../bash-2.03.tar.gz.
Diffstat (limited to 'builtins/shopt.def')
-rw-r--r-- | builtins/shopt.def | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/builtins/shopt.def b/builtins/shopt.def index 762bb42..1ee5b54 100644 --- a/builtins/shopt.def +++ b/builtins/shopt.def @@ -79,10 +79,19 @@ extern int hist_verify, history_reediting, perform_hostname_completion; extern void enable_hostname_completion (); #endif +#if defined (RESTRICTED_SHELL) +extern int restricted_shell; +extern char *shell_name; +#endif + extern void set_shellopts (); static int set_interactive_comments (); +#if defined (RESTRICTED_SHELL) +static int set_restricted_shell (); +#endif + static struct { char *name; int *value; @@ -120,6 +129,9 @@ static struct { { "nocaseglob", &glob_ignore_case, (Function *)NULL }, { "nullglob", &allow_null_glob_expansion, (Function *)NULL }, { "promptvars", &promptvars, (Function *)NULL }, +#if defined (RESTRICTED_SHELL) + { "restricted_shell", &restricted_shell, set_restricted_shell }, +#endif { "shift_verbose", &print_shift_error, (Function *)NULL }, { "sourcepath", &source_uses_path, (Function *)NULL }, { (char *)0, (int *)0, (Function *)NULL } @@ -262,7 +274,7 @@ toggle_shopts (mode, list, quiet) return (rval); } -static int +static void print_shopt (name, val, flags) char *name; int val, flags; @@ -400,3 +412,20 @@ set_interactive_comments (mode) set_shellopts (); return (0); } + +#if defined (RESTRICTED_SHELL) +/* Don't allow the value of restricted_shell to be modified. */ + +static int +set_restricted_shell (mode) + int mode; +{ + static int save_restricted = -1; + + if (save_restricted == -1) + save_restricted = shell_is_restricted (shell_name); + + restricted_shell = save_restricted; + return (0); +} +#endif /* RESTRICTED_SHELL */ |