Răsfoiți Sursa

* Added code to prevent cmd_botcmd from being chained over botnet.

svn: 2276
Bryan Drewery 21 ani în urmă
părinte
comite
a38f9c8c63
3 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 1 0
      doc/UPDATES
  2. 2 0
      misc/help.txt
  3. 6 0
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -32,6 +32,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed cmd_net[ps|last] not working. (#130, #131)
 * Added note at end of display for cmd_match to try using cmd_matchbot
 * Fixed 'reset*' being blocked with 'botcmd *'
+* Added code to prevent cmd_botcmd from being chained over botnet.
 
 1.2.4
 * Fixed cmd_botset not displaying botnick.

+ 2 - 0
misc/help.txt

@@ -251,6 +251,8 @@ See also: -ban, +ban, console%{+m|m}, chanset, chaninfo%{-}, stick, unstick
  
    Just using '?' for 'bot' will choose a random leaf bot.
    Just using '&' for 'bot' will do the cmd on all localhub bots. (first bot in config).
+
+   This cmd cannot be chained over the botnet, ie, no: .botcmd [bot] botcmd [bot2] ...
  
 See also: bc, cmdpass
 ::botjoin

+ 6 - 0
src/cmds.c

@@ -1245,6 +1245,12 @@ static void cmd_chsecpass(int idx, char *par)
 
 static void cmd_botcmd(int idx, char *par)
 {
+  if (dcc[idx].simul >= 0) {
+    dprintf(idx, "Sorry, you can't chain '%sbotcmd'.\n", settings.dcc_prefix);
+    putlog(LOG_WARN, "*", "%s attempted to chain 'botcmd' over the botnet.");
+    return;
+  }
+
   char *botm = newsplit(&par), *cmd = NULL;
   bool rand_leaf = 0, all_localhub = 0;