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