canon_userhost() will return user = 0 when the userhost supplied does not
include a '@', which caused the problem comparing the gline->gl_user against
a bad pointer and comparing an empty gline->gl_host against the realname.

Cheers,
netski

Index: ChangeLog
===================================================================
RCS file: /cvsroot/undernet-ircu/ircu2.10/ChangeLog,v
retrieving revision 1.290.2.129.2.26
diff -b -u -d -r1.290.2.129.2.26 ChangeLog
--- ChangeLog   22 Nov 2003 17:07:41 -0000      1.290.2.129.2.26
+++ ChangeLog   29 Nov 2003 01:31:01 -0000
@@ -1,3 +1,8 @@
+2003-11-28  Timothy Grant Vogelsang  <[EMAIL PROTECTED]>
+
+       * ircd/gline.c (gline_find): fixed realname gline issue that was
+         was resulting in multiple identical realname glines to circulate
+
 2003-11-22  Kevin L Mitchell  <[EMAIL PROTECTED]>
 
        * tools/wrapper.c: commit uid on chroot fix from ubra
Index: ircd/gline.c
===================================================================
RCS file: /cvsroot/undernet-ircu/ircu2.10/ircd/gline.c,v
retrieving revision 1.38.2.8.2.10
diff -b -u -d -r1.38.2.8.2.10 gline.c
--- ircd/gline.c        22 Nov 2003 15:07:57 -0000      1.38.2.8.2.10
+++ ircd/gline.c        29 Nov 2003 01:31:01 -0000
@@ -573,7 +573,7 @@
 {
   struct Gline *gline;
   struct Gline *sgline;
-  char *user, *host, *t_uh;
+  char *user, *host, *t_uh = 0;
 
   if (flags & (GLINE_BADCHAN | GLINE_ANY)) {
     for (gline = BadChanGlineList; gline; gline = sgline) {
@@ -598,11 +598,16 @@
       )
     return 0;
 
+  if (userhost[0] == '$' && userhost[1] == 'R') {
+    DupString(user, userhost);
+    host = 0;
+  } else {
   DupString(t_uh, userhost);
   canon_userhost(t_uh, &user, &host, 0);
 
   if(BadPtr(user))
     return 0;
+  }
 
   for (gline = GlobalGlineList; gline; gline = sgline) {
     sgline = gline->gl_next;
@@ -613,18 +618,19 @@
             (flags & GLINE_LASTMOD && !gline->gl_lastmod))
       continue;
     else if (flags & GLINE_EXACT) {
-      if (gline->gl_host && ircd_strcmp(gline->gl_host, host) == 0 &&
+      if ((!gline->gl_host || ircd_strcmp(gline->gl_host, host) == 0) &&
          ((!user && ircd_strcmp(gline->gl_user, "*") == 0) ||
           ircd_strcmp(gline->gl_user, user) == 0))
        break;
     } else {
-      if (gline->gl_host && match(gline->gl_host, host) == 0 &&
+      if ((!gline->gl_host || match(gline->gl_host, host) == 0) &&
          ((!user && ircd_strcmp(gline->gl_user, "*") == 0) ||
           match(gline->gl_user, user) == 0))
       break;
     }
   }
 
+  if (!BadPtr(t_uh))
   MyFree(t_uh);
 
   return gline;

Timothy Grant Vogelsang
Customer Support Rep.
Spectrum Global Communications Inc.
122 King Street North
Waterloo, ON N2J 2X8
519.725.2000 Head Office
519.725.1070 Fax
519.824.2005 Guelph
Email: [EMAIL PROTECTED]
Web: www.sgci.com
"Your Connectivity Specialist"

Reply via email to