forward port Alex Badea's gline patch from 2.10.11
authorMichael Poole <mdpoole@troilus.org>
Wed, 23 Jun 2004 03:13:38 +0000 (03:13 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 23 Jun 2004 03:13:38 +0000 (03:13 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1080 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/gline.c
ircd/s_conf.c

index 3ad5b62c0ed5187b608740b653aa4db39de6c5df..ebfcee6a5489322241e191803de2770a7f755da1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-06-18  Alex Badea  <decampos@users.sourceforge.net>
+
+       * ircd/gline.c (gline_lookup): only return a gline if it's
+       active
+
+       * ircd/s_conf.c (find_kill): don't check for active gline,
+       since gline_lookup does now
+
 2002-11-11  hikari <shadow@undernet.org>
        * ircd/ircd.c: added call to irc_crypt_init() - someone hurry up and 
        modularise :P
index d865e176f21f9001fb9f7898808bd78048aef7b8..2583e0d9125627c0e837a90afe00714e0097ec6b 100644 (file)
@@ -656,7 +656,8 @@ gline_lookup(struct Client *cptr, unsigned int flags)
       Debug((DEBUG_DEBUG,"realname gline: '%s' '%s'",gline->gl_user,cli_info(cptr)));
       if (match(gline->gl_user+2, cli_info(cptr)) != 0)
         continue;
-
+      if (!GlineIsActive(gline))
+        continue;
       return gline;
     }
     else {
@@ -671,6 +672,8 @@ gline_lookup(struct Client *cptr, unsigned int flags)
       else {
         if (match(gline->gl_host, (cli_user(cptr))->realhost) != 0) 
           continue;
+        if (!GlineIsActive(gline))
+          continue;
       }
     }
     return gline;
index 714622f1ebf8f612b05449bf939065ec585f5187..63e5bfe26876cf093e632a8c1a599da88555f3d1 100644 (file)
@@ -1211,15 +1211,13 @@ int find_kill(struct Client *cptr)
         send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", deny->message);
     }
   }
-  else if ((agline = gline_lookup(cptr, 0)) && GlineIsActive(agline)) {
+  else if ((agline = gline_lookup(cptr, 0))) {
     /*
      * find active glines
      * added a check against the user's IP address to find_gline() -Kev
      */
     send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", GlineReason(agline));
   }
-  else
-    agline = 0;          /* if a gline was found, it was inactive */
 
   if (deny)
     return -1;