0 or 1 to disable or enable, respectively, the SEDUCE option (see the source
for details on this function).
.lp
+CHECK_PLNAME
+Setting this to 1 will make the EXPLORERS, WIZARDS, and SHELLERS check
+for the player name instead of the user's login name.
+.lp
CHECK_SAVE_UID
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
.pg
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source)
for details on this function.
%.lp
+\item[\ib{CHECK\verb+_+PLNAME}]
+Setting this to 1 will make the EXPLORERS, WIZARDS, and SHELLERS check
+for the player name instead of the user's login name.
+%.lp
\item[\ib{CHECK\verb+_+SAVE\verb+_+UID}]
0 or 1 to disable or enable, respectively, the UID checking for savefiles.
\elist
X11: support pre-selected entries in menu windows
X11: make the extended command menu be easier to use and look a little nicer
X11: make the getline text entry widget display a bigger text entry area
+unix: add CHECK_PLNAME-option to sysconf to make WIZARDS, EXPLORERS, and
+ SHELLERS check player name instead of user's login name
General New Features
int maxplayers;
int seduce;
int check_save_uid; /* restoring savefile checks UID? */
+ int check_plname; /* use plname for checking wizards/explorers/shellers */
/* record file */
int persmax;
&& match_varname(buf, "CHECK_SAVE_UID", 14)) {
n = atoi(bufp);
sysopt.check_save_uid = n;
+ } else if (src == SET_IN_SYS
+ && match_varname(buf, "CHECK_PLNAME", 12)) {
+ n = atoi(bufp);
+ sysopt.check_plname = 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*/
#endif
sysopt.check_save_uid = 1;
+ sysopt.check_plname = 0;
sysopt.seduce = 1; /* if it's compiled in, default to on */
sysopt_seduce_set(sysopt.seduce);
return;
# Uses the same syntax as the WIZARDS and EXPLORERS options above.
#SHELLERS=
+# Use the player name for matching WIZARDS, EXPLORERS and SHELLERS,
+# instead of the user's login name.
+#CHECK_PLNAME=1
+
# Limit the number of simultaneous games (see also nethack.sh).
# Valid values are 0-25.
# Commenting this out or setting the value to 0 constructs lock files
struct passwd *pw = get_unix_pw();
int pwlen;
char *eop, *w;
+ char *pwname;
if (optstr[0] == '*')
return TRUE; /* allow any user */
if (!pw)
return FALSE;
- pwlen = strlen(pw->pw_name);
+ if (sysopt.check_plname)
+ pwname = plname;
+ else
+ pwname = pw->pw_name;
+ pwlen = strlen(pwname);
eop = eos(optstr);
w = optstr;
while (w + pwlen <= eop) {
w++;
continue;
}
- if (!strncmp(w, pw->pw_name, pwlen)) {
+ if (!strncmp(w, pwname, pwlen)) {
if (!w[pwlen] || isspace(w[pwlen]))
return TRUE;
}