[IRCServices] akick not setting channel ban

Andrew Church achurch at achurch.org
Mon Sep 12 11:51:18 PDT 2005


>I suspect that some of the irc servers in the network drop a ban
>silently, resulting in services having this ban on their list, which
>is desynched from the rest of the network in this case. I've seen
>similar situations with old hybrid servers and other services, but who
>knows..

     That's an interesting possibility.  To the original poster: try
applying the following patch to Services, then recompiling and restarting
in debug mode (ircservices -debug).  When you see the bug happening, check
the logfile and see if the ban in question is listed.  (Also, if you could
privately send me the full debug logfile for further analysis I'd
appreciate it.)

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/

---------------------------------------------------------------------------

Index: channels.c
===================================================================
RCS file: /var/local/cvsroot/ircservices/channels.c,v
retrieving revision 2.43.2.1
diff -u -r2.43.2.1 channels.c
--- channels.c	6 Jan 2005 17:15:11 -0000	2.43.2.1
+++ channels.c	12 Sep 2005 03:01:04 -0000
@@ -192,22 +192,33 @@
 
     t = strchr(ban, '!');
     i = 0;
+    if (debug)
+	log("find_ban([%s],[%s])", chan->name, ban);
     ARRAY_FOREACH (i, chan->bans) {
+	if (debug)
+	    log("... checking [%s]", chan->bans[i]);
 	s = strchr(chan->bans[i], '!');
 	if (s && t) {
 	    if (s-(chan->bans[i]) == t-ban
 	     && irc_strnicmp(chan->bans[i], ban, s-(chan->bans[i])) == 0
 	     && stricmp(s+1, t+1) == 0
 	    ) {
+		if (debug)
+		    log("... found!");
 		return i;
 	    }
 	} else if (!s && !t) {
 	    /* Bans without '!' should be impossible; just
 	     * do a case-insensitive compare */
-	    if (stricmp(chan->bans[i], ban) == 0)
+	    if (stricmp(chan->bans[i], ban) == 0) {
+		if (debug)
+		    log("... found!");
 		return i;
+	    }
 	}
     }
+    if (debug)
+	log("... NOT found");
     return -1;
 }