debug_fuzzer vs '!' and ^Z

My sysconf allows shell escape, and the fuzzer seems fond of that.
Suppress '!' and also '^Z', although I didn't notice it execute the
latter.  Without this hack, the sequence '!', sub-shell exit, '&'
causes nethack to be killed via SIGTTOU while fiddling with terminal
settings for introff().
This commit is contained in:
PatR
2018-12-01 16:43:13 -08:00
parent e19ad7d2bc
commit f12565398a

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1542673290 2018/11/20 00:21:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.302 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1543711385 2018/12/02 00:43:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.309 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -5501,6 +5501,12 @@ parse()
alt_esc = FALSE; /* readchar() reset */
#endif
if (iflags.debug_fuzzer /* if fuzzing, override '!' and ^Z */
&& (Cmd.commands[foo & 0x0ff]
&& (Cmd.commands[foo & 0x0ff]->ef_funct == dosuspend_core
|| Cmd.commands[foo & 0x0ff]->ef_funct == dosh)))
foo = Cmd.spkeys[NHKF_ESC];
if (foo == Cmd.spkeys[NHKF_ESC]) { /* esc cancels count (TH) */
clear_nhwindow(WIN_MESSAGE);
multi = last_multi = 0;