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:
keni
2012-01-27 20:15:31 +00:00
parent a871ad06e9
commit 1d219b4e1b
11 changed files with 147 additions and 82 deletions

View File

@@ -4,16 +4,25 @@
#include "hack.h"
/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string;
for usual config, WIZARD is the string; forcing WIZARD_NAME to match it
eliminates conditional testing for which one to use in string ops */
#ifndef KR1ED
# undef WIZARD_NAME
# define WIZARD_NAME WIZARD
#endif
struct sysopt sysopt;
void
sys_early_init(){
sysopt.support = NULL;
sysopt.recover = NULL;
#ifdef notyet
/* replace use of WIZARD vs WIZARD_NAME vs KR1ED, by filling this in */
#endif
#ifdef SYSCF
sysopt.wizards = NULL;
#else
sysopt.wizards = WIZARD_NAME;
#endif
sysopt.shellers = NULL;
sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */
@@ -32,17 +41,17 @@ sys_early_init(){
#ifdef PANICTRACE
/* panic options */
sysopt.gdbpath = NULL;
sysopt.greppath = NULL;
sysopt.gdbpath = strdup(GDBPATH);
sysopt.greppath = strdup(GREPPATH);
# ifdef BETA
sysopt.panictrace_gdb = 1;
# ifdef PANICTRACE_GLIBC
sysopt.panictrace_glibc = 2;
# ifdef PANICTRACE_LIBC
sysopt.panictrace_libc = 2;
# endif
# else
sysopt.panictrace_gdb = 0;
# ifdef PANICTRACE_GLIBC
sysopt.panictrace_glibc = 0;
# ifdef PANICTRACE_LIBC
sysopt.panictrace_libc = 0;
# endif
# endif
#endif