소스 검색

* Changed order of match_ignore() calls in dcc.c

svn: 1237
Bryan Drewery 22 년 전
부모
커밋
e4e91985a9
2개의 변경된 파일17개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 0
      doc/UPDATES
  2. 16 11
      src/dcc.c

+ 1 - 0
doc/UPDATES

@@ -36,6 +36,7 @@ This is a summary of ChangeLog basically.
 * Fixed an obscure memory bug with the perm-owner list
 * Fixed /me over partyline; now auto changes into cmd_me
 * Fixed cosmetic error in cmd_mns/invite/ban/exempt regarding which chan was displayed in log
+* Ignores are now checked before host is checked for access for telnet
 
 1.1.9
 

+ 16 - 11
src/dcc.c

@@ -1276,6 +1276,14 @@ dcc_telnet_hostresolved(int i)
     if ((dcc[idx].type == &DCC_TELNET) && (dcc[idx].sock == dcc[i].u.dns->ibuf)) {
       break;
     }
+
+  sprintf(s2, "-telnet!telnet@%s", dcc[i].host);
+  if (match_ignore(s2) || detect_telnet_flood(s2)) {
+    killsock(dcc[i].sock);
+    lostdcc(i);
+    return;
+  }
+
   if (dcc_total == idx) {
     putlog(LOG_BOTS, "*", "Lost listening socket while resolving %s", dcc[i].host);
     killsock(dcc[i].sock);
@@ -1291,12 +1299,6 @@ dcc_telnet_hostresolved(int i)
       return;
     }
   }
-  sprintf(s2, "-telnet!telnet@%s", dcc[i].host);
-  if (match_ignore(s2) || detect_telnet_flood(s2)) {
-    killsock(dcc[i].sock);
-    lostdcc(i);
-    return;
-  }
 /* .  ssl_link(dcc[i].sock, ACCEPT_SSL); */
 
   changeover_dcc(i, &DCC_IDENTWAIT, 0);
@@ -1818,6 +1820,13 @@ dcc_telnet_got_ident(int i, char *host)
   }
   strncpyz(dcc[i].host, host, UHOSTLEN);
   egg_snprintf(x, sizeof x, "-telnet!%s", dcc[i].host);
+
+  if (match_ignore(x)) {
+    killsock(dcc[i].sock);
+    lostdcc(i);
+    return;
+  }
+
   if (protect_telnet) {
     struct userrec *u;
     int ok = 1;
@@ -1847,11 +1856,7 @@ dcc_telnet_got_ident(int i, char *host)
       return;
     }
   }
-  if (match_ignore(x)) {
-    killsock(dcc[i].sock);
-    lostdcc(i);
-    return;
-  }
+
   /* Do not buffer data anymore. All received and stored data is passed
    * over to the dcc functions from now on.  */
   sockoptions(dcc[i].sock, EGG_OPTION_UNSET, SOCK_BUFFER);