]> jfr.im git - irc.git/blob - software/!RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2008/003325.html
RELEASE -> !RELEASE
[irc.git] / software / !RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2008 / 003325.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices Coding] [IRCServices] akick not setting channel ban
5 </TITLE>
6 <LINK REL="Index" HREF="index.html" >
7 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20%5BIRCServices%5D%20akick%20not%20setting%20channel%20ban&In-Reply-To=">
8 <META NAME="robots" CONTENT="index,nofollow">
9 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
10 <LINK REL="Previous" HREF="003324.html">
11 <LINK REL="Next" HREF="003326.html">
12 </HEAD>
13 <BODY BGCOLOR="#ffffff">
14 <H1>[IRCServices Coding] [IRCServices] akick not setting channel ban</H1>
15 <B>Aragon Gouveia</B>
16 <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20%5BIRCServices%5D%20akick%20not%20setting%20channel%20ban&In-Reply-To="
17 TITLE="[IRCServices Coding] [IRCServices] akick not setting channel ban">aragon at phat.za.net
18 </A><BR>
19 <I>Tue Nov 25 03:52:53 PST 2008</I>
20 <P><UL>
21 <LI>Previous message: <A HREF="003324.html">[IRCServices Coding] Migrating Modules to 5.1...
22 </A></li>
23 <LI>Next message: <A HREF="003326.html">[IRCServices Coding] [IRCServices] akick not setting channel ban
24 </A></li>
25 <LI> <B>Messages sorted by:</B>
26 <a href="date.html#3325">[ date ]</a>
27 <a href="thread.html#3325">[ thread ]</a>
28 <a href="subject.html#3325">[ subject ]</a>
29 <a href="author.html#3325">[ author ]</a>
30 </LI>
31 </UL>
32 <HR>
33 <!--beginarticle-->
34 <PRE>Hi,
35
36 First of all, pardon my serious case of thread necro. I decided to rather
37 resurrect this so that some history is at hand. :)
38
39 |<i> By Andrew Church &lt;<A HREF="http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding">achurch at achurch.org</A>&gt;
40 </I>|<i> [ 2005-09-12 05:02 +0200 ]
41 </I>&gt;<i> &gt;I suspect that some of the irc servers in the network drop a ban
42 </I>&gt;<i> &gt;silently, resulting in services having this ban on their list, which
43 </I>&gt;<i> &gt;is desynched from the rest of the network in this case. I've seen
44 </I>&gt;<i> &gt;similar situations with old hybrid servers and other services, but who
45 </I>&gt;<i> &gt;knows..
46 </I>&gt;<i>
47 </I>&gt;<i> That's an interesting possibility. To the original poster: try
48 </I>&gt;<i> applying the following patch to Services, then recompiling and restarting
49 </I>&gt;<i> in debug mode (ircservices -debug). When you see the bug happening, check
50 </I>&gt;<i> the logfile and see if the ban in question is listed. (Also, if you could
51 </I>&gt;<i> privately send me the full debug logfile for further analysis I'd
52 </I>&gt;<i> appreciate it.)
53 </I>
54 I applied your patch (2 years ago), thank you. However, it didn't help
55 locate the problem and I never really got the time to focus enough energy on
56 it again until recently. Been living with this bug since then.
57
58 So it's been a while. I extended your patch a bit by adding logging points
59 into do_cmode() to see when bans get set too. The interesting bits:
60
61 case 'b':
62 if (add) {
63 ARRAY_EXTEND(chan-&gt;bans);
64 chan-&gt;bans[chan-&gt;bans_count-1] = sstrdup(av[0]);
65 log(&quot;addban([%s],[%s],[%d])&quot;, chan-&gt;name,
66 chan-&gt;bans[chan-&gt;bans_count-1], chan-&gt;bans_count-1);
67 } else {
68 int i = find_ban(chan, av[0]);
69 if (i &gt;= 0) {
70 log(&quot;find_ban() true, free([%s])&quot;, chan-&gt;bans[i]);
71 free(chan-&gt;bans[i]);
72 ARRAY_REMOVE(chan-&gt;bans, i);
73 } else {
74
75
76 And when the last server relinked a few times:
77
78 [Nov 23 16:57:33 2008] find_ban([#5fm],[shand0ra*!*@*])
79 [Nov 23 16:57:33 2008] ... NOT found
80 [Nov 23 16:57:33 2008] addban([#5fm],[shand0ra*!*@*],[0])
81 [Nov 23 21:09:56 2008] addban([#5fm],[shand0ra*!*@*],[1])
82 [Nov 23 21:25:20 2008] addban([#5fm],[shand0ra*!*@*],[2])
83
84 And the next find_ban after that:
85
86 [Nov 24 10:55:01 2008] find_ban([#5fm],[killer!*@*])
87 [Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*]
88 [Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*]
89 [Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*]
90 [Nov 24 10:55:01 2008] ... checking [killer!*@*]
91 [Nov 24 10:55:01 2008] ... found[1]!
92 [Nov 24 10:55:01 2008] find_ban() true, free([killer!*@*])
93
94
95 So I've changed do_cmode:
96
97 case 'b':
98 if (add) {
99 int i = find_ban(chan, av[0]);
100 if (i == -1) {
101 ARRAY_EXTEND(chan-&gt;bans);
102 chan-&gt;bans[chan-&gt;bans_count-1] = sstrdup(av[0]);
103 }
104
105
106 Which I've tested with some oper assisted relinking and things look much
107 better now. I believe 5.1's do_cmode will cause the same problems (it looks
108 the same as 5.0's).
109
110 Better late than never they say. :)
111
112
113 Regards,
114 Aragon
115
116
117 &gt;<i>
118 </I>&gt;<i> Index: channels.c
119 </I>&gt;<i> ===================================================================
120 </I>&gt;<i> RCS file: /var/local/cvsroot/ircservices/channels.c,v
121 </I>&gt;<i> retrieving revision 2.43.2.1
122 </I>&gt;<i> diff -u -r2.43.2.1 channels.c
123 </I>&gt;<i> --- channels.c 6 Jan 2005 17:15:11 -0000 2.43.2.1
124 </I>&gt;<i> +++ channels.c 12 Sep 2005 03:01:04 -0000
125 </I>&gt;<i> @@ -192,22 +192,33 @@
126 </I>&gt;<i>
127 </I>&gt;<i> t = strchr(ban, '!');
128 </I>&gt;<i> i = 0;
129 </I>&gt;<i> + if (debug)
130 </I>&gt;<i> + log(&quot;find_ban([%s],[%s])&quot;, chan-&gt;name, ban);
131 </I>&gt;<i> ARRAY_FOREACH (i, chan-&gt;bans) {
132 </I>&gt;<i> + if (debug)
133 </I>&gt;<i> + log(&quot;... checking [%s]&quot;, chan-&gt;bans[i]);
134 </I>&gt;<i> s = strchr(chan-&gt;bans[i], '!');
135 </I>&gt;<i> if (s &amp;&amp; t) {
136 </I>&gt;<i> if (s-(chan-&gt;bans[i]) == t-ban
137 </I>&gt;<i> &amp;&amp; irc_strnicmp(chan-&gt;bans[i], ban, s-(chan-&gt;bans[i])) == 0
138 </I>&gt;<i> &amp;&amp; stricmp(s+1, t+1) == 0
139 </I>&gt;<i> ) {
140 </I>&gt;<i> + if (debug)
141 </I>&gt;<i> + log(&quot;... found!&quot;);
142 </I>&gt;<i> return i;
143 </I>&gt;<i> }
144 </I>&gt;<i> } else if (!s &amp;&amp; !t) {
145 </I>&gt;<i> /* Bans without '!' should be impossible; just
146 </I>&gt;<i> * do a case-insensitive compare */
147 </I>&gt;<i> - if (stricmp(chan-&gt;bans[i], ban) == 0)
148 </I>&gt;<i> + if (stricmp(chan-&gt;bans[i], ban) == 0) {
149 </I>&gt;<i> + if (debug)
150 </I>&gt;<i> + log(&quot;... found!&quot;);
151 </I>&gt;<i> return i;
152 </I>&gt;<i> + }
153 </I>&gt;<i> }
154 </I>&gt;<i> }
155 </I>&gt;<i> + if (debug)
156 </I>&gt;<i> + log(&quot;... NOT found&quot;);
157 </I>&gt;<i> return -1;
158 </I>&gt;<i> }
159 </I>
160 </PRE>
161
162
163 <!--endarticle-->
164 <HR>
165 <P><UL>
166 <!--threads-->
167 <LI>Previous message: <A HREF="003324.html">[IRCServices Coding] Migrating Modules to 5.1...
168 </A></li>
169 <LI>Next message: <A HREF="003326.html">[IRCServices Coding] [IRCServices] akick not setting channel ban
170 </A></li>
171 <LI> <B>Messages sorted by:</B>
172 <a href="date.html#3325">[ date ]</a>
173 <a href="thread.html#3325">[ thread ]</a>
174 <a href="subject.html#3325">[ subject ]</a>
175 <a href="author.html#3325">[ author ]</a>
176 </LI>
177 </UL>
178
179 </body></html>