[cvslog] [CVS] Module eggdrop1.8: Change committed

cvs at eggheads.org cvs at eggheads.org
Sat Feb 26 13:22:48 CST 2011


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.8
Commit time: 2011-02-26 19:22:48 UTC
Committer  : Thomas Sader <thommey at gmail.com>

Modified files:
     doc/Changes1.8 doc/tcl-commands.doc doc/html/tcl-commands.html
     src/dcc.c src/patch.h

Log message:

script listen sockets with the pub flag no longer perform ident lookups

---------------------- diff included ----------------------
Index: eggdrop1.8/doc/Changes1.8
diff -u eggdrop1.8/doc/Changes1.8:1.49 eggdrop1.8/doc/Changes1.8:1.50
--- eggdrop1.8/doc/Changes1.8:1.49	Tue Feb 15 17:55:17 2011
+++ eggdrop1.8/doc/Changes1.8	Sat Feb 26 13:22:37 2011
@@ -1,4 +1,4 @@
-$Id: Changes1.8,v 1.49 2011/02/15 23:55:17 pseudo Exp $
+$Id: Changes1.8,v 1.50 2011/02/26 19:22:37 thommey Exp $
 
 Eggdrop Changes (since version 1.8.0)
 
@@ -6,6 +6,9 @@
 
 1.8.0 (CVS):
 
+  - script listen sockets with the pub flag no longer perform ident lookups
+    Found by: FireEgl / Patch by: thommey
+
   - Fixed a bug with connecting to numeric addresses when compiled with
     --disable-ipv6, reintroduced with a recent sync between branches.
     Found by: skydrome / Patch by: pseudo
Index: eggdrop1.8/doc/html/tcl-commands.html
diff -u eggdrop1.8/doc/html/tcl-commands.html:1.9 eggdrop1.8/doc/html/tcl-commands.html:1.10
--- eggdrop1.8/doc/html/tcl-commands.html:1.9	Fri Oct 29 14:53:43 2010
+++ eggdrop1.8/doc/html/tcl-commands.html	Sat Feb 26 13:22:37 2011
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: tcl-commands.html,v 1.9 2010/10/29 20:53:43 pseudo Exp $ -->
+<!-- $Id: tcl-commands.html,v 1.10 2011/02/26 19:22:37 thommey Exp $ -->
 
 <html>
   <head>
@@ -2349,7 +2349,7 @@
                 are immediately routed to a proc. The proc is called with
                 one parameter: the idx of the new connection. Flag may
                 currently only be &#39;pub&#39;, which makes the bot allow
-                anyone to connect.</p>
+                anyone to connect and not perform an ident lookup.</p>
 
                 <p><strong>Returns:</strong> port number</p>
               </dd>
Index: eggdrop1.8/doc/tcl-commands.doc
diff -u eggdrop1.8/doc/tcl-commands.doc:1.8 eggdrop1.8/doc/tcl-commands.doc:1.9
--- eggdrop1.8/doc/tcl-commands.doc:1.8	Fri Oct 29 14:53:43 2010
+++ eggdrop1.8/doc/tcl-commands.doc	Sat Feb 26 13:22:37 2011
@@ -1,4 +1,4 @@
-$Id: tcl-commands.doc,v 1.8 2010/10/29 20:53:43 pseudo Exp $
+$Id: tcl-commands.doc,v 1.9 2011/02/26 19:22:37 thommey Exp $
 
 Eggdrop Tcl Commands
 Last revised: October 24, 2010
@@ -1080,7 +1080,7 @@
           Description: accepts connections which are immediately routed to
             a proc. The proc is called with one parameter: the idx of the
             new connection. Flag may currently only be 'pub', which makes
-            the bot allow anyone to connect.
+            the bot allow anyone to connect and not perform an ident lookup.
           Returns: port number
 
         listen <port> off
Index: eggdrop1.8/src/dcc.c
diff -u eggdrop1.8/src/dcc.c:1.9 eggdrop1.8/src/dcc.c:1.10
--- eggdrop1.8/src/dcc.c:1.9	Thu Jan 27 05:20:16 2011
+++ eggdrop1.8/src/dcc.c	Sat Feb 26 13:22:37 2011
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.9 2011/01/27 11:20:16 pseudo Exp $
+ * $Id: dcc.c,v 1.10 2011/02/26 19:22:37 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1247,7 +1247,7 @@
 {
   int idx;
   int j = 0, sock;
-  char s[UHOSTLEN + 20];
+  char s[UHOSTLEN + 20], *userhost;
 
   strncpyz(dcc[i].host, dcc[i].u.dns->host, UHOSTLEN);
 
@@ -1273,6 +1273,7 @@
     }
   }
   sprintf(s, "-telnet!telnet@%s", dcc[i].host);
+  userhost = s + strlen("-telnet!");
   if (match_ignore(s) || detect_telnet_flood(s)) {
     killsock(dcc[i].sock);
     lostdcc(i);
@@ -1280,6 +1281,17 @@
   }
 
   putlog(LOG_MISC, "*", DCC_TELCONN, dcc[i].host, dcc[i].port);
+
+  /* Skip ident lookup for public script listeners */
+  if ((dcc[idx].status & LSTN_PUBLIC) && !strcmp(dcc[idx].nick, "(script)")) {
+    changeover_dcc(i, &DCC_SOCKET, 0);
+    dcc[i].u.other = NULL;
+    strcpy(dcc[i].nick, "*");
+    strncpyz(dcc[i].host, userhost, UHOSTLEN);
+    check_tcl_listen(dcc[idx].host, dcc[i].sock);
+    return;
+  }
+
   changeover_dcc(i, &DCC_IDENTWAIT, 0);
   dcc[i].timeval = now;
   dcc[i].u.ident_sock = dcc[idx].sock;
@@ -1307,8 +1319,7 @@
     }
   }
   if (j < 0) {
-    sprintf(s, "telnet@%s", dcc[i].host);
-    dcc_telnet_got_ident(i, s);
+    dcc_telnet_got_ident(i, userhost);
     return;
   }
   dcc[j].sock = sock;
Index: eggdrop1.8/src/patch.h
diff -u eggdrop1.8/src/patch.h:1.34 eggdrop1.8/src/patch.h:1.35
--- eggdrop1.8/src/patch.h:1.34	Tue Feb 15 17:55:17 2011
+++ eggdrop1.8/src/patch.h	Sat Feb 26 13:22:37 2011
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.34 2011/02/15 23:55:17 pseudo Exp $
+ * $Id: patch.h,v 1.35 2011/02/26 19:22:37 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1297814036");            /* current unixtime */
+patch("1298748085");            /* current unixtime */
 /*
  *
  *
  */
-patch("af_inet");
+patch("publistennoident");
 /*
  *
  *
----------------------- End of diff -----------------------


More information about the Changes mailing list