Selaa lähdekoodia

* Prevent use of botcmd for cmd_me

svn: 2284
Bryan Drewery 21 vuotta sitten
vanhempi
commit
a5edeb4d57
2 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 1 1
      doc/UPDATES
  2. 8 3
      src/cmds.c

+ 1 - 1
doc/UPDATES

@@ -33,7 +33,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * 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.
-* Disabled cmd_away/cmd_back over 'botcmd'
+* Prevent use of cmd_botcmd for cmds: cmd_me, cmd_away, cmd_back
 * Fixed security flaw with 'auth-obscure', and improved: auth-obscure now gives a hash regardless of 'dccauth'.
 * Possibly fixed a random segfault after linking/connecting to irc.
 * Fixed a segfault/cpu-spin during WHO parsing, although, it could have occurred at any time. (#110)

+ 8 - 3
src/cmds.c

@@ -311,6 +311,11 @@ static void cmd_lagged(int idx, char *par)
 
 static void cmd_me(int idx, char *par)
 {
+  if (dcc[idx].simul >= 0) {
+    dprintf(idx, "Sorry, that cmd isn't available over botcmd.\n");
+    return;
+  }
+
   if (dcc[idx].u.chat->channel < 0) {
     dprintf(idx, "You have chat turned off.\n");
     return;
@@ -1973,7 +1978,7 @@ static void cmd_unlink(int idx, char *par)
 static void cmd_relay(int idx, char *par)
 {
   if (dcc[idx].simul >= 0) {
-    dprintf(idx, "Sorry, this cmd is not available with remote cmds.\n");
+    dprintf(idx, "Sorry, that cmd isn't available over botcmd.\n");
     return;
   }
   if (!par[0]) {
@@ -2874,7 +2879,7 @@ static void cmd_strip(int idx, char *par)
 static void cmd_su(int idx, char *par)
 {
   if (dcc[idx].simul >= 0) {
-    dprintf(idx, "Sorry, this cmd is not available with remote cmds.\n");
+    dprintf(idx, "Sorry, that cmd isn't available over botcmd.\n");
     return;
   }
 
@@ -4123,7 +4128,7 @@ static void cmd_whoami(int idx, char *par)
 static void cmd_quit(int idx, char *text)
 {
   if (dcc[idx].simul >= 0) {
-    dprintf(idx, "Sorry, this cmd is not available with remote cmds.\n");
+    dprintf(idx, "Sorry, that cmd isn't available over botcmd.\n");
     return;
   }