Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Fri, 14 Dec 2007 02:37:48 +0000 (02:37 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Fri, 14 Dec 2007 02:37:48 +0000 (02:37 +0000)
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.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1859 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/gline.c
ircd/m_gline.c

index c022d2147ee5f6ddbf1d4c446cb08e80d76936ac..fe31642c7756cec252e58cf12653aac4d582e6c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-12-13  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * 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 <mdpoole@troilus.org>
 
        * include/patchlevel.h (PATCHLEVEL): Bump for u2.10.12.12 release.
index fd63607159dd3f1bd4c3392d9232524b41dda0c6..f294d99f456f07694a4c5fd5e22324339c299ebd 100644 (file)
@@ -142,6 +142,8 @@ make_gline(char *user, char *host, char *reason, time_t expire, time_t lastmod,
 {
   struct Gline *gline;
 
+  assert(0 != expire);
+
   gline = (struct Gline *)MyMalloc(sizeof(struct Gline)); /* alloc memory */
   assert(0 != gline);
 
index cd930a9da2047a8fe80f1f51aa360b5bf64bb1fd..95e2ac173b29471b0898194b303e27d3543f98e9 100644 (file)
@@ -347,6 +347,18 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   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));
 }