]> git.pond.sub.org Git - empserver/commitdiff
(comtch): Parameter god permitted execution of any command, even when
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 4 Jan 2006 19:12:44 +0000 (19:12 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 4 Jan 2006 19:12:44 +0000 (19:12 +0000)
com->c_permit disagreed.  Doesn't make sense and is inconsistent with
output of list.  Remove parameter.  The only command affected is
break.

include/prototypes.h
src/lib/player/dispatch.c
src/lib/player/login.c
src/lib/subs/mtch.c

index c096c808d8eb139077158846be42e17ba1b19b7e..016bdc6a39b0535aa3c56503d7abb69bbbbf5c9f 100644 (file)
@@ -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,
                             int, int, s_char *, int, int);
 /* mtch.c */
-extern int comtch(register s_char *, struct cmndstr *, int, int);
+extern int comtch(register s_char *, struct cmndstr *, int);
 /* natarg.c */
 extern int natarg(s_char *, s_char *);
 /* neigh.c */
index 9ade4e4868d98dd5ad0ff54dee1505b0d014c013..94108f285a4a555390b5d8067d42eb22488d18a5 100644 (file)
@@ -62,8 +62,7 @@ dispatch(char *buf, char *redir)
     struct cmndstr *command;
     int cmd;
 
-    cmd = comtch(player->argp[0], player_coms,
-                player->ncomstat, player->god);
+    cmd = comtch(player->argp[0], player_coms, player->ncomstat);
     if (cmd < 0) {
        if (cmd == M_NOTUNIQUE)
            pr("Command \"%s\" is ambiguous -- ", player->argp[0]);
index a1b94d3473d986a9043fdfc9f2213e09736b19f4..356d7fb65c0dd98ac4615bc51b5efd8e9c7ef9be 100644 (file)
@@ -79,7 +79,7 @@ player_login(void *ud)
            continue;
        }
        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) {
            pr_id(player, C_BADCMD, "Command %s not found\n", player->argp[0]);
            continue;
index 10e3e91b7e8d2a0e0e99c1ee42293e8f2c1c7c3d..0b27e0d368aa20b4e4d596a32d8b9b6fe734edf4 100644 (file)
@@ -46,8 +46,7 @@
  * Ignore commands that require more permissions than COMSTAT.
  */
 int
-comtch(register s_char *command, struct cmndstr *coms, int comstat,
-       int god)
+comtch(register s_char *command, struct cmndstr *coms, int comstat)
 {
     register struct cmndstr *com;
     register int status;
@@ -56,7 +55,7 @@ comtch(register s_char *command, struct cmndstr *coms, int comstat,
        return M_IGNORE;
     status = M_NOTFOUND;
     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;
        switch (mineq(command, com->c_form)) {
        case ME_MISMATCH: