From: nethack.rankin Date: Thu, 22 Aug 2002 03:05:18 +0000 (+0000) Subject: trickery bulletproofing X-Git-Tag: MOVE2GIT~2475 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b840adcb6228c794994f480b611a483dce944274;p=nethack trickery bulletproofing Prevent the pardoning of trickery in wizard mode from attempting to continue when there's no longer any current level. Also prevent the ZEROCOMP configuration from trying to read from file descriptor -1 in case there're any other places which still let that slip through. And fix an oddity in the VMS port's error() routine which has gone unnoticed for years. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 84a24430f..7d855f861 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -220,6 +220,8 @@ If there were a hole outside a shop, you could kick stuff out of the door curing hallucination while wielding Grayswandir should print a message removing unowned pick-axe from container in shop gave inappropriate message don't let monster end up with more current HP than max HP after life drain +make sure that missing file trickery in wizard mode which is discovered during + level change doesn't try to keep going after discarding current level Platform- and/or Interface-Specific Fixes @@ -262,6 +264,7 @@ Gnome/Linux: more portable getres*id workaround msdos: compiling without NO_TERMS resulted in a link-time error msdos: reworked Makefile.GCC to get rid of need to duplicate source files msdos,win32: stop doing chdir when NOCWD_ASSUMPTIONS is defined +vms: prevent error() from indirectly triggering hangup save during forced exit General New Features diff --git a/src/do.c b/src/do.c index 9d5f067c1..e320e28a8 100644 --- a/src/do.c +++ b/src/do.c @@ -1055,6 +1055,8 @@ boolean at_stairs, falling, portal; (int) new_ledger, depth(&u.uz), errno); pline("Probably someone removed it."); done(TRICKED); + /* we'll reach here if running in wizard mode */ + error("Cannot continue this game."); } minit(); /* ZEROCOMP */ getlev(fd, hackpid, new_ledger, FALSE); diff --git a/src/restore.c b/src/restore.c index 899b5a69d..3874c5f2a 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)restore.c 3.4 1999/11/20 */ +/* SCCS Id: @(#)restore.c 3.4 2002/08/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1026,6 +1026,7 @@ genericptr_t buf; register unsigned len; { /*register int readlen = 0;*/ + if (fd < 0) error("Restore error; mread attempting to read file %d.", fd); mreadfd = fd; while (len--) { if (inrunlength > 0) { diff --git a/sys/vms/vmstty.c b/sys/vms/vmstty.c index e9add7639..894c1eff8 100644 --- a/sys/vms/vmstty.c +++ b/sys/vms/vmstty.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)vmstty.c 3.4 1995/07/09 */ +/* SCCS Id: @(#)vmstty.c 3.4 2002/08/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* tty.c - (VMS) version */ @@ -477,5 +477,9 @@ error VA_DECL(const char *,s) Vprintf(s,VA_ARGS); (void) putchar('\n'); VA_END(); +#ifndef SAVE_ON_FATAL_ERROR + /* prevent vmsmain's exit handler byebye() from calling hangup() */ + (void)signal(SIGHUP, SIG_DFL); +#endif exit(EXIT_FAILURE); }