+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.
+
2010-08-10 - nano 2.2 branch cut here
GNU nano 2.2.5 - 2010.08.05
* 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"));
* 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
* 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,
/* 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();
}
/* the subnfunc version */
-void do_suspend_void(void)
+void do_suspend_void(void)
{
if (ISSET(SUSPEND))
do_suspend(0);
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;