Allow disabling savefile UID checking in sysconf
This commit is contained in:
@@ -2206,6 +2206,9 @@ int src;
|
||||
} else if (src == SET_IN_SYS && match_varname(buf, "RECOVER", 7)) {
|
||||
if (sysopt.recover) free(sysopt.recover);
|
||||
sysopt.recover = dupstr(bufp);
|
||||
} else if (src == SET_IN_SYS && match_varname(buf, "CHECK_SAVE_UID", 14)) {
|
||||
n = atoi(bufp);
|
||||
sysopt.check_save_uid = n;
|
||||
} else if (match_varname(buf, "SEDUCE", 6)) {
|
||||
n = !!atoi(bufp); /* XXX this could be tighter */
|
||||
/* allow anyone to turn it off, but only sysconf to turn it on*/
|
||||
|
||||
@@ -502,6 +502,13 @@ register struct obj *otmp;
|
||||
else otmp->spe = fruitadd(oldf->fname, (struct fruit *)0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef SYSCF
|
||||
#define SYSOPT_CHECK_SAVE_UID sysopt.check_save_uid
|
||||
#else
|
||||
#define SYSOPT_CHECK_SAVE_UID TRUE
|
||||
#endif
|
||||
|
||||
STATIC_OVL
|
||||
boolean
|
||||
restgamestate(fd, stuckid, steedid)
|
||||
@@ -517,7 +524,7 @@ unsigned int *stuckid, *steedid;
|
||||
unsigned long uid;
|
||||
|
||||
mread(fd, (genericptr_t) &uid, sizeof uid);
|
||||
if (uid != (unsigned long)getuid()) { /* strange ... */
|
||||
if (SYSOPT_CHECK_SAVE_UID && uid != (unsigned long)getuid()) { /* strange ... */
|
||||
/* for wizard mode, issue a reminder; for others, treat it
|
||||
as an attempt to cheat and refuse to restore this file */
|
||||
pline("Saved game was not yours.");
|
||||
|
||||
Reference in New Issue
Block a user