diff --git a/ChangeLog b/ChangeLog index 6b2a4a3c..8c3bc2c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-12 Chris Allegretta + * Add check for RESTRICTED mode back to speller, suspend and insert file + routines, since adding key bindings broke the fact that they should be + disabled in restricted mode. Fixes Savannah bug 31625 reported by + Charlie Somerville. + GNU nano 2.2.5 - 2010.08.05 2010-08-04 Lauri Kasanen * doc/syntax/mgp.nanorc: New Magicpoint syntax highlighting definition diff --git a/src/files.c b/src/files.c index 95559613..8ae3cef4 100644 --- a/src/files.c +++ b/src/files.c @@ -1066,6 +1066,12 @@ void do_insertfile( * allow inserting a file into a new buffer. */ void do_insertfile_void(void) { + + if (ISSET(RESTRICTED)) { + nano_disabled_msg(); + return; + } + #ifdef ENABLE_MULTIBUFFER if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER)) statusbar(_("Key invalid in non-multibuffer mode")); diff --git a/src/global.c b/src/global.c index 50134062..7958864c 100644 --- a/src/global.c +++ b/src/global.c @@ -690,7 +690,8 @@ void shortcut_init(bool unjustify) * restricted mode, inserting files is disabled, since it allows * reading from or writing to files not specified on the command * line. */ - add_to_funcs(!ISSET(RESTRICTED) ? DO_INSERTFILE_VOID : NANO_DISABLED_MSG, + + add_to_funcs(DO_INSERTFILE_VOID, /* TRANSLATORS: Try to keep this at most 10 characters. */ MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE, #ifdef ENABLE_MULTIBUFFER @@ -732,10 +733,9 @@ void shortcut_init(bool unjustify) * because it allows reading from or writing to files not specified * on the command line. */ #ifndef DISABLE_SPELLER - if (!ISSET(RESTRICTED)) - /* TRANSLATORS: Try to keep this at most 10 characters. */ - add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg), - TRUE, NOVIEW); + /* TRANSLATORS: Try to keep this at most 10 characters. */ + add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg), + TRUE, NOVIEW); #endif add_to_funcs(DO_FIRST_LINE, diff --git a/src/nano.c b/src/nano.c index 66706b46..9db84603 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1185,6 +1185,12 @@ RETSIGTYPE handle_hupterm(int signal) /* Handler for SIGTSTP (suspend). */ RETSIGTYPE do_suspend(int signal) { + + if (ISSET(RESTRICTED)) { + nano_disabled_msg(); + return; + } + #ifndef DISABLE_MOUSE /* Turn mouse support off. */ disable_mouse_support(); @@ -1212,7 +1218,7 @@ RETSIGTYPE do_suspend(int signal) } /* the subnfunc version */ -void do_suspend_void(void) +void do_suspend_void(void) { if (ISSET(SUSPEND)) do_suspend(0); diff --git a/src/text.c b/src/text.c index 1536fb4e..d34763d1 100644 --- a/src/text.c +++ b/src/text.c @@ -2920,6 +2920,11 @@ void do_spell(void) char *temp = safe_tempfile(&temp_file); const char *spell_msg; + if (ISSET(RESTRICTED)) { + nano_disabled_msg(); + return; + } + if (temp == NULL) { statusbar(_("Error writing temp file: %s"), strerror(errno)); return;