Debug patch (Re: [IRCServices Coding] SET RESTRICTED, and possibly AKICK flaw)

Andrew Church achurch at achurch.org
Sun Mar 19 17:47:59 PST 2006


     With regard to the AKICK issue, if someone could apply the patch below
to modules/chanserv/check.c and post the debug log messages generated when
the problem occurs, I'd appreciate it.

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

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

Index: modules/chanserv/check.c
===================================================================
RCS file: /var/local/cvsroot/ircservices/modules/chanserv/check.c,v
retrieving revision 2.59.2.8
diff -u -r2.59.2.8 check.c
--- modules/chanserv/check.c	8 Jan 2006 16:48:13 -0000	2.59.2.8
+++ modules/chanserv/check.c	19 Mar 2006 08:50:18 -0000
@@ -410,6 +410,8 @@
 	clear_channel(c, CLEAR_EXCEPTS, user);
     /* Apparently invites can get around bans, so check for ban first */
     if (!chan_has_ban(chan, mask)) {
+	module_log("[DEBUG] check_kick: adding ban [%s] to channel [%s]"
+		   " for nick [%s]", mask, chan, user->nick);
 	send_cmode_cmd(s_ChanServ, chan, "+b %s", mask);
 	if (c) {
 	    char *av[3];
@@ -418,6 +420,21 @@
 	    av[2] = mask;
 	    do_cmode(s_ChanServ, 3, av);
 	}
+    } else {
+	module_log("[DEBUG] check_kick: NOT adding ban [%s] to channel [%s]"
+		   " for user [%s]", mask, chan, user->nick);
+	module_log("[DEBUG]    ban list:");
+	if (c) {
+	    int i;
+	    ARRAY_FOREACH (i, c->bans)
+		module_log("[DEBUG]       %s", c->bans[i]);
+	}
+	module_log("[DEBUG]    exception list:");
+	if (c) {
+	    int i;
+	    ARRAY_FOREACH (i, c->excepts)
+		module_log("[DEBUG]       %s", c->bans[i]);
+	}
     }
     free(mask);
     send_channel_cmd(s_ChanServ, "KICK %s %s :%s", chan, user->nick, reason);