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

cvs at eggheads.org cvs at eggheads.org
Mon Jan 25 14:12:06 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2010-01-25 20:12:05 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     doc/Changes1.6 src/dcc.c src/patch.h src/userrec.c

Log message:

Fixed a fixfrom() bug, breaking userhost matching. Fixed a bug in telnet autodetection, which prevented cvs bots from linking reliably with bots running older versions.

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/Changes1.6
diff -u eggdrop1.6/doc/Changes1.6:1.57 eggdrop1.6/doc/Changes1.6:1.58
--- eggdrop1.6/doc/Changes1.6:1.57	Fri Jan 15 13:51:49 2010
+++ eggdrop1.6/doc/Changes1.6	Mon Jan 25 14:11:55 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.6,v 1.57 2010/01/15 19:51:49 pseudo Exp $
+$Id: Changes1.6,v 1.58 2010/01/25 20:11:55 pseudo Exp $
 
 Eggdrop Changes (since version 1.6.0)
 
@@ -6,6 +6,13 @@
 
 1.6.20 (CVS):
 
+  - Fixed a bug in fixfrom(), breaking userhost matching.
+    Found by: Tothwolf, thommey
+  - Fixed a bug in telnet autodetection, which prevented cvs bots from linking
+    reliably with bots running older versions.
+    Found by: FireEgl, Tothwolf
+    Patch by: pseudo
+
   - Replaced the LOG_TS definition with a config variable "timestamp-format",
     defaulting to "[%H:%M:%S]".
   - Added support for silent backups and logfile switching with higher
Index: eggdrop1.6/src/dcc.c
diff -u eggdrop1.6/src/dcc.c:1.91 eggdrop1.6/src/dcc.c:1.92
--- eggdrop1.6/src/dcc.c:1.91	Mon Jan  4 07:15:11 2010
+++ eggdrop1.6/src/dcc.c	Mon Jan 25 14:11:55 2010
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.91 2010/01/04 13:15:11 pseudo Exp $
+ * $Id: dcc.c,v 1.92 2010/01/25 20:11:55 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -69,6 +69,23 @@
 static void dcc_telnet_pass(int, int);
 
 
+/* This is not a universal telnet detector. You need to send WILL STATUS to the
+ * other side and pass the reply to this function. A telnet client will respond
+ * to this with either DO or DONT STATUS.
+ */
+static int detect_telnet(unsigned char *buf)
+{
+  if (!buf || !buf[0] || !buf[1])
+    return 0;
+  while (buf[2]) {
+    if (buf[0] == TLN_IAC && (buf[1] == TLN_DO || buf[1] == TLN_DONT) &&
+        buf[2] == TLN_STATUS)
+      return 1;
+    buf++;
+  }
+  return 0;
+}
+
 /* Escape telnet IAC and prepend CR to LF */
 static char *escape_telnet(char *s)
 {
@@ -557,6 +574,8 @@
     return;
   if (dcc[idx].status & STAT_TELNET)
     strip_telnet(dcc[idx].sock, buf, &atr);
+  else if (detect_telnet((unsigned char *) buf))
+    buf += 3; /* 'IAC','DO(DONT)','STATUS' */
   atr = dcc[idx].user ? dcc[idx].user->flags : 0;
 
   /* Check for MD5 digest from remote _bot_. <cybah> */
@@ -1338,23 +1357,6 @@
     }
 }
 
-/* This is not a universal telnet detector. You need to send WILL STATUS to the
- * other side and pass the reply to this function. A telnet client will respond
- * to this with either DO or DONT STATUS.
- */
-static int detect_telnet(unsigned char *buf)
-{
-  if (!buf || !buf[0] || !buf[1])
-    return 0;
-  while (buf[2]) {
-    if (buf[0] == TLN_IAC && (buf[1] == TLN_DO || buf[1] == TLN_DONT) &&
-        buf[2] == TLN_STATUS)
-      return 1;
-    buf++;
-  }
-  return 0;
-}
-
 static void dcc_telnet_id(int idx, char *buf, int atr)
 {
   int ok = 0;
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1229 eggdrop1.6/src/patch.h:1.1230
--- eggdrop1.6/src/patch.h:1.1229	Fri Jan 15 13:51:49 2010
+++ eggdrop1.6/src/patch.h	Mon Jan 25 14:11:55 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1229 2010/01/15 19:51:49 pseudo Exp $
+ * $Id: patch.h,v 1.1230 2010/01/25 20:11:55 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1263584963");            /* current unixtime */
+patch("1264446765");            /* current unixtime */
 /*
  *
  *
  */
-patch("logts");
+patch("fixtelnetfrom");
 /*
  *
  *
Index: eggdrop1.6/src/userrec.c
diff -u eggdrop1.6/src/userrec.c:1.61 eggdrop1.6/src/userrec.c:1.62
--- eggdrop1.6/src/userrec.c:1.61	Sun Jan 10 16:28:57 2010
+++ eggdrop1.6/src/userrec.c	Mon Jan 25 14:11:55 2010
@@ -4,7 +4,7 @@
  *   a bunch of functions to find and change user records
  *   change and check user (and channel-specific) flags
  *
- * $Id: userrec.c,v 1.61 2010/01/10 22:28:57 pseudo Exp $
+ * $Id: userrec.c,v 1.62 2010/01/25 20:11:55 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -178,11 +178,12 @@
     *p++ = *s;
     if (*s == '!' && strchr("~+-^=", s[1]) && s[2] != '@') {
       strcpy(p, s + 2);
-      break;
+      return uhost;
     }
     s++;
   }
 
+  *p = 0;
   return uhost;
 }
 
----------------------- End of diff -----------------------


More information about the Changes mailing list