SYSCF bits
(This covers some thing that Pat found and some things I found while working on those.) Unscramble duplicate use of GREPPATH and GDBPATH symbols. Add some more info to config.h. Make missing SYSCF_FILE a fatal error. Make a parse error in SYSCF_FILE a fatal error. Rename PANICTRACE_GLIBC (et al) to PANICTRACE_LIBC (et al) since FreeBSD and Mac OS X (at least) also implement the needed API. Allow SYSCF_FILE to be unreadable by the user (for setgid installs). If SYSCF, do NOT fall back to the compiled in WIZARD account. Put WIZARD into sysopt and remove special cases in authorize_wizard_mode().
This commit is contained in:
@@ -150,7 +150,8 @@
|
||||
* If SYSCF is defined, the following configuration info is
|
||||
* available in a global config space, with the compiled-in
|
||||
* entries as defaults:
|
||||
* WIZARDS ( a value of * allows anyone to be wizard)
|
||||
* WIZARDS (a value of * allows anyone to be wizard)
|
||||
* (this does NOT default to compiled-in value)
|
||||
* MAXPLAYERS (see MAX_NR_OF_PLAYERS above and nethack.sh)
|
||||
* SUPPORT (how to get local support)(no default)
|
||||
* RECOVER (how to recover a game at your site)(no default)
|
||||
@@ -164,6 +165,10 @@
|
||||
*
|
||||
* The following options select how the config space is stored:
|
||||
* SYSCF_FILE in the named file
|
||||
*
|
||||
* The following options pertain to crash reporting:
|
||||
* GREPPATH (the path to the system grep(1) utility)
|
||||
* GDBPATH (the path to the system gdb(1) program)
|
||||
*/
|
||||
|
||||
#ifndef WIZARD /* allow for compile-time or Makefile changes */
|
||||
@@ -177,6 +182,13 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef GDBPATH
|
||||
# define GDBPATH "/usr/bin/gdb"
|
||||
#endif
|
||||
#ifndef GREPPATH
|
||||
# define GREPPATH "/bin/grep"
|
||||
#endif
|
||||
|
||||
#define LOGFILE "logfile" /* larger file for debugging purposes */
|
||||
#define NEWS "news" /* the file containing the latest hack news */
|
||||
#define PANICLOG "paniclog" /* log of panic and impossible events */
|
||||
|
||||
@@ -742,7 +742,7 @@ E void FDECL(unlock_file, (const char *));
|
||||
#ifdef USER_SOUNDS
|
||||
E boolean FDECL(can_read_file, (const char *));
|
||||
#endif
|
||||
E void FDECL(read_config_file, (const char *, int));
|
||||
E boolean FDECL(read_config_file, (const char *, int));
|
||||
E void FDECL(check_recordfile, (const char *));
|
||||
#if defined(WIZARD)
|
||||
E void NDECL(read_wizkit);
|
||||
@@ -2357,6 +2357,9 @@ E void NDECL(port_help);
|
||||
E void FDECL(sethanguphandler, (void (*)(int)));
|
||||
E boolean NDECL(authorize_wizard_mode);
|
||||
E boolean FDECL(check_user_string, (char *));
|
||||
# ifdef SYSCF_FILE
|
||||
E void NDECL(assure_syscf_file);
|
||||
# endif
|
||||
#endif /* UNIX */
|
||||
|
||||
/* ### unixtty.c ### */
|
||||
@@ -2384,6 +2387,9 @@ E int NDECL(dosh);
|
||||
# if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)
|
||||
E int FDECL(child, (int));
|
||||
# endif
|
||||
# ifdef PANICTRACE
|
||||
E boolean FDECL(file_exists, (const char *));
|
||||
# endif
|
||||
#endif /* UNIX */
|
||||
|
||||
/* ### unixres.c ### */
|
||||
|
||||
@@ -382,7 +382,10 @@ struct savefile_info {
|
||||
#endif
|
||||
/* The following are meaningless if PANICTRACE is not defined: */
|
||||
#if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
|
||||
# define PANICTRACE_GLIBC
|
||||
# define PANICTRACE_LIBC
|
||||
#endif
|
||||
#if defined(MACOSX)
|
||||
# define PANICTRACE_LIBC
|
||||
#endif
|
||||
#ifdef UNIX
|
||||
# define PANICTRACE_GDB
|
||||
|
||||
@@ -25,8 +25,8 @@ struct sysopt {
|
||||
char *gdbpath;
|
||||
char *greppath;
|
||||
int panictrace_gdb;
|
||||
# ifdef PANICTRACE_GLIBC
|
||||
int panictrace_glibc;
|
||||
# ifdef PANICTRACE_LIBC
|
||||
int panictrace_libc;
|
||||
# endif
|
||||
#endif
|
||||
int seduce;
|
||||
|
||||
Reference in New Issue
Block a user