Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Mon, 11 Dec 2000 20:27:14 +0000 (20:27 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Mon, 11 Dec 2000 20:27:14 +0000 (20:27 +0000)
Log message:

Fix a G-line bug reported by maniac@cetlink.net in private email.

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

ChangeLog
ircd/gline.c

index 6f7b0715ec1d910a4f054dad9ce46c7f03924036..ce78b49046f9a8f8ed6da429d88c97dce8e262cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-12-11  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * ircd/gline.c: When Uworld removed Uworld-set G-lines, only the
+       uplink would remove them.  This is because the removal protocol
+       message wasn't being sent to the uplinks.  This is fixed by fixing
+       propagate_gline() to send the proper number of arguments depending
+       on whether or not we're adding or deleting the Uworld gline, and
+       by having gline_deactivate() make sure to turn off the active bit
+       and call propagate_gline() if it's a Uworld gline
+
 2000-12-10  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/os_generic.c: make sure IOV_MAX gets defined, just in case
index f32671b490830f2e3cad7a044110ab72df30ebbd..7cd6655dcfe53e787dc5f752531b7238ae6003c7 100644 (file)
@@ -213,9 +213,10 @@ propagate_gline(struct Client *cptr, struct Client *sptr, struct Gline *gline)
                          gline->gl_expire - CurrentTime, gline->gl_lastmod,
                          gline->gl_reason);
   else
-    sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %c%s%s%s %Tu :%s",
-                         GlineIsRemActive(gline) ? '+' : '-', gline->gl_user,
-                         GlineIsBadChan(gline) ? "" : "@",
+    sendcmdto_serv_butone(sptr, CMD_GLINE, cptr,
+                         (GlineIsRemActive(gline) ?
+                          "* +%s%s%s %Tu :%s" : "* -%s%s%s"),
+                         gline->gl_user, GlineIsBadChan(gline) ? "" : "@",
                          GlineIsBadChan(gline) ? "" : gline->gl_host,
                          gline->gl_expire - CurrentTime, gline->gl_reason);
 }
@@ -342,9 +343,10 @@ gline_deactivate(struct Client *cptr, struct Client *sptr, struct Gline *gline,
 
   if (GlineIsLocal(gline))
     msg = "removing local";
-  else if (!gline->gl_lastmod && !(flags & GLINE_LOCAL))
+  else if (!gline->gl_lastmod && !(flags & GLINE_LOCAL)) {
     msg = "removing global";
-  else {
+    gline->gl_flags &= ~GLINE_ACTIVE; /* propagate a -<mask> */
+  } else {
     msg = "deactivating global";
 
     if (flags & GLINE_LOCAL)
@@ -378,11 +380,13 @@ gline_deactivate(struct Client *cptr, struct Client *sptr, struct Gline *gline,
            GlineIsBadChan(gline) ? "" : gline->gl_host,
            gline->gl_expire + TSoffset, gline->gl_reason);
 
-  if (GlineIsLocal(gline) || (!gline->gl_lastmod && !(flags & GLINE_LOCAL)))
-    gline_free(gline);
-  else if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */
+  if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */
     propagate_gline(cptr, sptr, gline);
 
+  /* if it's a local gline or a Uworld gline (and not locally deactivated).. */
+  if (GlineIsLocal(gline) || (!gline->gl_lastmod && !(flags & GLINE_LOCAL)))
+    gline_free(gline); /* get rid of it */
+
   return 0;
 }