2010-11-12 Chris Allegretta <chrisa@asty.org>

* 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2010-11-12 06:22:12 +00:00
parent 8deebeb904
commit ab53864de7
5 changed files with 29 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2010-11-12 Chris Allegretta <chrisa@asty.org>
* 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 GNU nano 2.2.5 - 2010.08.05
2010-08-04 Lauri Kasanen <curaga@operamail.comcuraga@operamail.com> 2010-08-04 Lauri Kasanen <curaga@operamail.comcuraga@operamail.com>
* doc/syntax/mgp.nanorc: New Magicpoint syntax highlighting definition * doc/syntax/mgp.nanorc: New Magicpoint syntax highlighting definition

View File

@ -1066,6 +1066,12 @@ void do_insertfile(
* allow inserting a file into a new buffer. */ * allow inserting a file into a new buffer. */
void do_insertfile_void(void) void do_insertfile_void(void)
{ {
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER)) if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER))
statusbar(_("Key invalid in non-multibuffer mode")); statusbar(_("Key invalid in non-multibuffer mode"));

View File

@ -690,7 +690,8 @@ void shortcut_init(bool unjustify)
* restricted mode, inserting files is disabled, since it allows * restricted mode, inserting files is disabled, since it allows
* reading from or writing to files not specified on the command * reading from or writing to files not specified on the command
* line. */ * 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. */ /* TRANSLATORS: Try to keep this at most 10 characters. */
MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE, MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE,
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
@ -732,10 +733,9 @@ void shortcut_init(bool unjustify)
* because it allows reading from or writing to files not specified * because it allows reading from or writing to files not specified
* on the command line. */ * on the command line. */
#ifndef DISABLE_SPELLER #ifndef DISABLE_SPELLER
if (!ISSET(RESTRICTED)) /* TRANSLATORS: Try to keep this at most 10 characters. */
/* TRANSLATORS: Try to keep this at most 10 characters. */ add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg),
add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg), TRUE, NOVIEW);
TRUE, NOVIEW);
#endif #endif
add_to_funcs(DO_FIRST_LINE, add_to_funcs(DO_FIRST_LINE,

View File

@ -1185,6 +1185,12 @@ RETSIGTYPE handle_hupterm(int signal)
/* Handler for SIGTSTP (suspend). */ /* Handler for SIGTSTP (suspend). */
RETSIGTYPE do_suspend(int signal) RETSIGTYPE do_suspend(int signal)
{ {
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
/* Turn mouse support off. */ /* Turn mouse support off. */
disable_mouse_support(); disable_mouse_support();

View File

@ -2920,6 +2920,11 @@ void do_spell(void)
char *temp = safe_tempfile(&temp_file); char *temp = safe_tempfile(&temp_file);
const char *spell_msg; const char *spell_msg;
if (ISSET(RESTRICTED)) {
nano_disabled_msg();
return;
}
if (temp == NULL) { if (temp == NULL) {
statusbar(_("Error writing temp file: %s"), strerror(errno)); statusbar(_("Error writing temp file: %s"), strerror(errno));
return; return;