Explorar o código

* Added some debug logging when a telnet connection is ignored.

svn: 2013
Bryan Drewery %!s(int64=21) %!d(string=hai) anos
pai
achega
43a1afccda
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  1. 1 1
      doc/UPDATES
  2. 3 0
      src/dcc.c

+ 1 - 1
doc/UPDATES

@@ -82,7 +82,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Added options 'enable' and 'disable' to cmd_conf for bots
 * Added options 'enable' and 'disable' to cmd_conf for bots
 * Fixed dccauth not correctly working according to it's [bot]config setting (#30)
 * Fixed dccauth not correctly working according to it's [bot]config setting (#30)
 * Added match option for cmd_botcmd: '$' will match on all localhubs (first bot in config) (#28)
 * Added match option for cmd_botcmd: '$' will match on all localhubs (first bot in config) (#28)
-
+* Added some debug logging when a telnet connection is ignored.
 
 
 1.2.2
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 3 - 0
src/dcc.c

@@ -1262,6 +1262,7 @@ dcc_telnet(int idx, char *buf, int ii)
   simple_sprintf(x, "-telnet!telnet@%s", iptostr(htonl(ip)));
   simple_sprintf(x, "-telnet!telnet@%s", iptostr(htonl(ip)));
 
 
   if (match_ignore(x) || detect_telnet_flood(x)) {
   if (match_ignore(x) || detect_telnet_flood(x)) {
+    putlog(LOG_DEBUG, "*", "Ignored telnet connection from: %s", x);
     killsock(sock);
     killsock(sock);
     return;
     return;
   }
   }
@@ -1310,6 +1311,7 @@ static void dcc_telnet_dns_callback(int id, void *client_data, const char *ip, c
   simple_sprintf(s2, "-telnet!telnet@%s", dcc[i].host);
   simple_sprintf(s2, "-telnet!telnet@%s", dcc[i].host);
 
 
   if (match_ignore(s2)) {
   if (match_ignore(s2)) {
+    putlog(LOG_DEBUG, "*", "Ignored telnet connection from: %s", s2);
     killsock(dcc[i].sock);
     killsock(dcc[i].sock);
     lostdcc(i);
     lostdcc(i);
     return;
     return;
@@ -1801,6 +1803,7 @@ dcc_telnet_got_ident(int i, char *host)
   simple_snprintf(sip, sizeof(sip), "-telnet!%s@%s", host, iptostr(htonl(dcc[i].addr)));
   simple_snprintf(sip, sizeof(sip), "-telnet!%s@%s", host, iptostr(htonl(dcc[i].addr)));
 
 
   if (match_ignore(shost) || match_ignore(sip)) {
   if (match_ignore(shost) || match_ignore(sip)) {
+    putlog(LOG_DEBUG, "*", "Ignored telnet connection from: %s[%s]",dcc[i].host, iptostr(htonl(dcc[i].addr)));
     killsock(dcc[i].sock);
     killsock(dcc[i].sock);
     lostdcc(i);
     lostdcc(i);
     return;
     return;