Committer  : klmitch
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2007-12-14 02:37:58 UTC

Modified files:
  Tag: u2_10_12_branch
     ChangeLog ircd/gline.c ircd/m_gline.c

Log message:

Author: Kev <[EMAIL PROTECTED]>
Log message:

Correct the issue where a 0 expiration time on a new G-line causes funny
behavior.  Instead, for server-issued G-lines, try hard by propagating a
G-line activation/deactivation for G-lines we know nothing about, instead
of calling gline_add().

Also, the make_gline() function now asserts that expire != 0.

Note: it will not be necessary to release a .13 immediately.  The REMGLINE
issue can be easily worked around within euworld, and Isomer is making the
appropriate changes.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.223 ircu2.10/ChangeLog:1.710.2.224
--- ircu2.10/ChangeLog:1.710.2.223      Mon Dec  3 20:25:15 2007
+++ ircu2.10/ChangeLog  Thu Dec 13 18:37:48 2007
@@ -1,3 +1,13 @@
+2007-12-13  Kevin L. Mitchell  <[EMAIL PROTECTED]>
+
+       * ircd/m_gline.c (ms_gline): if we got an activate or deactivate
+       for a global G-line we never heard of, and we cannot create it
+       because no expire time was sent, manually propagate the G-line
+       instead of trying to call gline_add()
+
+       * ircd/gline.c (make_gline): never allow a G-line to be created
+       with a 0 expire time
+
 2007-12-03  Michael Poole <[EMAIL PROTECTED]>
 
        * include/patchlevel.h (PATCHLEVEL): Bump for u2.10.12.12 release.
Index: ircu2.10/ircd/gline.c
diff -u ircu2.10/ircd/gline.c:1.61.2.6 ircu2.10/ircd/gline.c:1.61.2.7
--- ircu2.10/ircd/gline.c:1.61.2.6      Fri Nov 30 14:10:04 2007
+++ ircu2.10/ircd/gline.c       Thu Dec 13 18:37:48 2007
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Implementation of Gline manipulation functions.
- * @version $Id: gline.c,v 1.61.2.6 2007/11/30 22:10:04 klmitch Exp $
+ * @version $Id: gline.c,v 1.61.2.7 2007/12/14 02:37:48 klmitch Exp $
  */
 #include "config.h"
 
@@ -142,6 +142,8 @@
 {
   struct Gline *gline;
 
+  assert(0 != expire);
+
   gline = (struct Gline *)MyMalloc(sizeof(struct Gline)); /* alloc memory */
   assert(0 != gline);
 
Index: ircu2.10/ircd/m_gline.c
diff -u ircu2.10/ircd/m_gline.c:1.26.2.9 ircu2.10/ircd/m_gline.c:1.26.2.10
--- ircu2.10/ircd/m_gline.c:1.26.2.9    Mon Oct 29 18:19:52 2007
+++ ircu2.10/ircd/m_gline.c     Thu Dec 13 18:37:48 2007
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_gline.c,v 1.26.2.9 2007/10/30 01:19:52 entrope Exp $
+ * $Id: m_gline.c,v 1.26.2.10 2007/12/14 02:37:48 klmitch Exp $
  */
 
 /*
@@ -347,6 +347,18 @@
   assert(action != GLINE_LOCAL_DEACTIVATE);
   assert(action != GLINE_MODIFY);
 
+  if (!expire) { /* Cannot *add* a G-line we don't have, but try hard */
+    Debug((DEBUG_DEBUG, "Propagating G-line %s for G-line we don't have",
+          action == GLINE_ACTIVATE ? "activation" : "deactivation"));
+
+    /* propagate the G-line, even though we don't have it */
+    sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %c%s %Tu",
+                         action == GLINE_ACTIVATE ? '+' : '-',
+                         mask, lastmod);
+
+    return 0;
+  }
+
   return gline_add(cptr, sptr, mask, reason, expire, lastmod, lifetime,
                   flags | ((action == GLINE_ACTIVATE) ? GLINE_ACTIVE : 0));
 }
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to