system-wide configuration file

Add options SYSCF (to add a system-wide configuration file) and SYSCF_FILE
(for a file-based implementation of SYSCF) - this allows a binary distribution
to be configured at install time.  The only option supported at this time is
WIZARDS - a list of usernames which can use -D; currently only for unix-likes
but should be extendable to anything that has a concept of multiple users.
Add mac tty multiuser config using sgid.
This commit is contained in:
keni
2008-01-09 01:57:41 +00:00
parent 9c3f6f78b9
commit f2d37bac2e
17 changed files with 269 additions and 26 deletions

View File

@@ -144,11 +144,21 @@
* feature from the game; otherwise set the appropriate wizard
* name. LOGFILE, NEWS and PANICLOG refer to files in the
* playground.
*
* If SYSCF is defined, the following configuration info is
* available in a global config space, with the compiled-in
* entries as defaults:
* WIZARD ( a value of * allows anyone to be wizard)
*
* The following options select how the config space is stored:
* SYSCF_FILE in the named file
*/
#ifndef WIZARD /* allow for compile-time or Makefile changes */
# ifndef KR1ED
# define WIZARD "wizard" /* the person allowed to use the -D option */
/* #define SYSCF */ /* use a global configuration */
/* #define SYSCF_FILE "sysconf" */ /* global configuration is in a file */
# else
# define WIZARD
# define WIZARD_NAME "wizard"

View File

@@ -199,6 +199,9 @@ E const char *occtxt; /* defined when occupation != NULL */
E const char *nomovemsg;
E const char nul[];
E char lock[];
#ifdef SYSCF
E char wizards[];
#endif
E const schar xdir[], ydir[], zdir[];

View File

@@ -730,7 +730,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 *));
E void FDECL(read_config_file, (const char *, int));
E void FDECL(check_recordfile, (const char *));
#if defined(WIZARD)
E void NDECL(read_wizkit);
@@ -1580,6 +1580,8 @@ E char *FDECL(safe_qbuf, (char *,const char *,const char *,struct obj *,
E boolean FDECL(match_optname, (const char *,const char *,int,BOOLEAN_P));
E void NDECL(initoptions);
E void NDECL(initoptions_init);
E void NDECL(initoptions_finish);
E void FDECL(parseoptions, (char *,BOOLEAN_P,BOOLEAN_P));
E int NDECL(doset);
E int NDECL(dotogglepickup);

View File

@@ -340,10 +340,13 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
* Each higher number includes the characteristics of the numbers
* below it.
*/
#define SET_IN_FILE 0 /* config file option only */
#define SET_VIA_PROG 1 /* may be set via extern program, not seen in game */
#define DISP_IN_GAME 2 /* may be set via extern program, displayed in game */
#define SET_IN_GAME 3 /* may be set via extern program or set in the game */
/* XXX This should be replaced with a bitmap. */
#define SET_IN_SYS 0 /* system config file option only */
#define SET_IN_FILE 1 /* config file option only */
#define SET_VIA_PROG 2 /* may be set via extern program, not seen in game */
#define DISP_IN_GAME 3 /* may be set via extern program, displayed in game */
#define SET_IN_GAME 4 /* may be set via extern program or set in the game */
#define SET__IS_VALUE_VALID(s) ( (s < SET_IN_SYS) || (s > SET_IN_GAME) )
#define FEATURE_NOTICE_VER(major,minor,patch) (((unsigned long)major << 24) | \
((unsigned long)minor << 16) | \