Browse Source

Protect tcl/script commands

Bryan Drewery 14 năm trước cách đây
mục cha
commit
173a7738f0
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/cmds.c

+ 2 - 1
src/cmds.c

@@ -1420,7 +1420,8 @@ static void cmd_botcmd(int idx, char *par)
   // Restrict dangerous mass commands ('botcmd *' (any *) or 'botcmd &')
   if ((strchr(botm, '*') && !findbot(botm)) || !strcmp(botm, "&") || botm[0] == '%') {
     if (!strncasecmp(cmd, "di", 2) || (!strncasecmp(cmd, "res", 3) && strncasecmp(cmd, "reset", 5)) || !strncasecmp(cmd, "sui", 3) || !strncasecmp(cmd, "pl", 2) || !strncasecmp(cmd, "ac", 2) ||
-        !strncasecmp(cmd, "j", 1) || (!strncasecmp(cmd, "dump", 4) && (!strncasecmp(par, "privmsg", 7) || !strncasecmp(par, "notice", 6) || !strncasecmp(par, "quit", 4)))) {
+        !strncasecmp(cmd, "j", 1) || (!strncasecmp(cmd, "dump", 4) && (!strncasecmp(par, "privmsg", 7) || !strncasecmp(par, "notice", 6) || !strncasecmp(par, "quit", 4))) ||
+        ((!strncasecmp(cmd, "tcl", 3) || !strncasecmp(cmd, "script", 6)) && strstr(cmd, "privmsg"))) {
       dprintf(idx, "Not a good idea.\n");
       return;
     } else if (strchr(botm, '*') && !(dcc[idx].user->flags & USER_OWNER)) {