(comtch): Parameter god permitted execution of any command, even when
com->c_permit disagreed. Doesn't make sense and is inconsistent with output of list. Remove parameter. The only command affected is break.
This commit is contained in:
parent
0b037fc23c
commit
8329b8884a
4 changed files with 5 additions and 7 deletions
|
@ -543,7 +543,7 @@ extern void msl_sel(struct emp_qelem *, coord, coord, natid, int,
|
||||||
extern int msl_launch_mindam(struct emp_qelem *, coord, coord, int,
|
extern int msl_launch_mindam(struct emp_qelem *, coord, coord, int,
|
||||||
int, int, s_char *, int, int);
|
int, int, s_char *, int, int);
|
||||||
/* mtch.c */
|
/* mtch.c */
|
||||||
extern int comtch(register s_char *, struct cmndstr *, int, int);
|
extern int comtch(register s_char *, struct cmndstr *, int);
|
||||||
/* natarg.c */
|
/* natarg.c */
|
||||||
extern int natarg(s_char *, s_char *);
|
extern int natarg(s_char *, s_char *);
|
||||||
/* neigh.c */
|
/* neigh.c */
|
||||||
|
|
|
@ -62,8 +62,7 @@ dispatch(char *buf, char *redir)
|
||||||
struct cmndstr *command;
|
struct cmndstr *command;
|
||||||
int cmd;
|
int cmd;
|
||||||
|
|
||||||
cmd = comtch(player->argp[0], player_coms,
|
cmd = comtch(player->argp[0], player_coms, player->ncomstat);
|
||||||
player->ncomstat, player->god);
|
|
||||||
if (cmd < 0) {
|
if (cmd < 0) {
|
||||||
if (cmd == M_NOTUNIQUE)
|
if (cmd == M_NOTUNIQUE)
|
||||||
pr("Command \"%s\" is ambiguous -- ", player->argp[0]);
|
pr("Command \"%s\" is ambiguous -- ", player->argp[0]);
|
||||||
|
|
|
@ -79,7 +79,7 @@ player_login(void *ud)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ac = parse(buf, player->argp, NULL, space, NULL);
|
ac = parse(buf, player->argp, NULL, space, NULL);
|
||||||
cmd = comtch(player->argp[0], login_coms, 0, 0);
|
cmd = comtch(player->argp[0], login_coms, 0);
|
||||||
if (cmd < 0) {
|
if (cmd < 0) {
|
||||||
pr_id(player, C_BADCMD, "Command %s not found\n", player->argp[0]);
|
pr_id(player, C_BADCMD, "Command %s not found\n", player->argp[0]);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -46,8 +46,7 @@
|
||||||
* Ignore commands that require more permissions than COMSTAT.
|
* Ignore commands that require more permissions than COMSTAT.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
comtch(register s_char *command, struct cmndstr *coms, int comstat,
|
comtch(register s_char *command, struct cmndstr *coms, int comstat)
|
||||||
int god)
|
|
||||||
{
|
{
|
||||||
register struct cmndstr *com;
|
register struct cmndstr *com;
|
||||||
register int status;
|
register int status;
|
||||||
|
@ -56,7 +55,7 @@ comtch(register s_char *command, struct cmndstr *coms, int comstat,
|
||||||
return M_IGNORE;
|
return M_IGNORE;
|
||||||
status = M_NOTFOUND;
|
status = M_NOTFOUND;
|
||||||
for (com = coms; com->c_form != 0; com++) {
|
for (com = coms; com->c_form != 0; com++) {
|
||||||
if ((com->c_permit & comstat) != com->c_permit && !god)
|
if ((com->c_permit & comstat) != com->c_permit)
|
||||||
continue;
|
continue;
|
||||||
switch (mineq(command, com->c_form)) {
|
switch (mineq(command, com->c_form)) {
|
||||||
case ME_MISMATCH:
|
case ME_MISMATCH:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue