]>
Commit | Line | Data |
---|---|---|
3bd189cb JR |
1 | From razvan.savu at gmail.com Sat Feb 2 05:46:00 2008 |
2 | From: razvan.savu at gmail.com (Razvan Savu) | |
3 | Date: Sat, 2 Feb 2008 15:46:00 +0200 | |
4 | Subject: [IRCServices Coding] Panic 11 Segv Fault error | |
5 | Message-ID: <c93d8cd40802020546i4390c52bibc9698c6d62de7e4@mail.gmail.com> | |
6 | ||
7 | Hello. I'm receiving this error sometimes in ircservices.log. | |
8 | ||
9 | PANIC! signal 11 (no buffer) | |
10 | [Feb 02 15:30:09 2008] Services terminating: Segmentation fault | |
11 | [Feb 02 15:30:09 2008] modules: Module `operserv/main' forgot to | |
12 | remove callback `save data complete' from module `core' | |
13 | ||
14 | I'm using inspircd1.1. Also, if i add an access to a channel, after a | |
15 | reset (even if i perform an operserv update), the access list for that | |
16 | channel is gone. Any ideeas on how to fix this? | |
17 | ||
18 | From achurch at achurch.org Sat Feb 2 23:03:18 2008 | |
19 | From: achurch at achurch.org (Andrew Church) | |
20 | Date: Sat, 02 Feb 2008 23:03:18 JST | |
21 | Subject: [IRCServices Coding] Panic 11 Segv Fault error | |
22 | In-Reply-To: <c93d8cd40802020546i4390c52bibc9698c6d62de7e4@mail.gmail.com> | |
23 | Message-ID: <47a47895.65642@msgid.achurch.org> | |
24 | ||
25 | >Hello. I'm receiving this error sometimes in ircservices.log. | |
26 | > | |
27 | >PANIC! signal 11 (no buffer) | |
28 | >[Feb 02 15:30:09 2008] Services terminating: Segmentation fault | |
29 | >[Feb 02 15:30:09 2008] modules: Module `operserv/main' forgot to | |
30 | >remove callback `save data complete' from module `core' | |
31 | ||
32 | See FAQ Z.3. | |
33 | ||
34 | >I'm using inspircd1.1. Also, if i add an access to a channel, after a | |
35 | >reset (even if i perform an operserv update), the access list for that | |
36 | >channel is gone. Any ideeas on how to fix this? | |
37 | ||
38 | Are your database files being saved correctly? (There should be several | |
39 | *.db or *.sdb files in the directory you specified as the Services data | |
40 | directory when you installed Services.) | |
41 | ||
42 | --Andrew Church | |
43 | achurch at achurch.org | |
44 | http://achurch.org/ | |
45 | ||
46 | From razvan.savu at gmail.com Sat Feb 2 06:39:38 2008 | |
47 | From: razvan.savu at gmail.com (Razvan Savu) | |
48 | Date: Sat, 2 Feb 2008 16:39:38 +0200 | |
49 | Subject: [IRCServices Coding] Panic 11 Segv Fault error | |
50 | In-Reply-To: <47a47895.65642@msgid.achurch.org> | |
51 | References: <c93d8cd40802020546i4390c52bibc9698c6d62de7e4@mail.gmail.com> | |
52 | <47a47895.65642@msgid.achurch.org> | |
53 | Message-ID: <c93d8cd40802020639m69513edfof6a043c5e83c4d56@mail.gmail.com> | |
54 | ||
55 | Yes. Here is a complete listing. Sometimes however i get something | |
56 | like database updaate failed. | |
57 | ||
58 | akill.sdb exception.sdb memo-ignore.sdb nick.sdb | |
59 | chan-access.sdb exclude.sdb memo.sdb oper.sdb | |
60 | chan-akick.sdb helpfiles modules sgline.sdb | |
61 | chan.sdb ircservices.conf modules.conf sqline.sdb | |
62 | convert-db ircservices.log news.sdb stat-servers.sdb | |
63 | example-ircservices.conf ircservices.pid nick-access.sdb szline.sdb | |
64 | example-modules.conf languages nickgroup.sdb | |
65 | ||
66 | 2008/2/2 Andrew Church <achurch at achurch.org>: | |
67 | > >Hello. I'm receiving this error sometimes in ircservices.log. | |
68 | > > | |
69 | > >PANIC! signal 11 (no buffer) | |
70 | > >[Feb 02 15:30:09 2008] Services terminating: Segmentation fault | |
71 | > >[Feb 02 15:30:09 2008] modules: Module `operserv/main' forgot to | |
72 | > >remove callback `save data complete' from module `core' | |
73 | > | |
74 | > See FAQ Z.3. | |
75 | > | |
76 | > >I'm using inspircd1.1. Also, if i add an access to a channel, after a | |
77 | > >reset (even if i perform an operserv update), the access list for that | |
78 | > >channel is gone. Any ideeas on how to fix this? | |
79 | > | |
80 | > Are your database files being saved correctly? (There should be several | |
81 | > *.db or *.sdb files in the directory you specified as the Services data | |
82 | > directory when you installed Services.) | |
83 | > | |
84 | > --Andrew Church | |
85 | > achurch at achurch.org | |
86 | > http://achurch.org/ | |
87 | > | |
88 | > ------------------------------------------------------------------ | |
89 | > To unsubscribe or change your subscription options, visit: | |
90 | > http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
91 | > | |
92 | ||
93 | From rpope904 at comcast.net Fri Feb 15 20:20:30 2008 | |
94 | From: rpope904 at comcast.net (Russell) | |
95 | Date: Fri, 15 Feb 2008 23:20:30 -0500 | |
96 | Subject: [IRCServices Coding] How would I do this (NickServ) | |
97 | Message-ID: <000001c87053$454c1670$cfe44350$@net> | |
98 | ||
99 | Basically, I have made a website to for users to interact with irc from.. | |
100 | The site generates them a page with a custom chat applet for their channel, | |
101 | but I want to be able to delete inactive users, how can I get ircservices to | |
102 | go to a url when a nickname is removed from the database? i.e. | |
103 | http://www.somesite.com/admin/remove.php?nick=$nickname | |
104 | ||
105 | -------------- next part -------------- | |
106 | An HTML attachment was scrubbed... | |
107 | URL: http://lists.ircservices.za.net/pipermail/ircservices-coding/attachments/20080215/00c951f9/attachment.htm | |
108 | ||
109 | From phil1974 at taylorassociate.com Wed Jun 25 20:07:49 2008 | |
110 | From: phil1974 at taylorassociate.com (phil1974 at taylorassociate.com) | |
111 | Date: Wed, 25 Jun 2008 23:07:49 -0400 | |
112 | Subject: [IRCServices Coding] Disable getpass | |
113 | Message-ID: <016101c8d739$d0ae7120$0300a8c0@Laptop> | |
114 | ||
115 | Is there any way to change the getpass so only the service root can use that command? I do not know how to read c code. | |
116 | ||
117 | Thanks | |
118 | -------------- next part -------------- | |
119 | An HTML attachment was scrubbed... | |
120 | URL: http://lists.ircservices.za.net/pipermail/ircservices-coding/attachments/20080625/642fe742/attachment.html | |
121 | ||
122 | From Craig at frostycoolslug.com Thu Jun 26 08:32:49 2008 | |
123 | From: Craig at frostycoolslug.com (Craig McLure) | |
124 | Date: Thu, 26 Jun 2008 16:32:49 +0100 | |
125 | Subject: [IRCServices Coding] Disable getpass | |
126 | In-Reply-To: <016101c8d739$d0ae7120$0300a8c0@Laptop> | |
127 | References: <016101c8d739$d0ae7120$0300a8c0@Laptop> | |
128 | Message-ID: <8a79f15a0806260832l658ad102i701a53dfee168108@mail.gmail.com> | |
129 | ||
130 | in modules/chanserv/main.c, find: | |
131 | ||
132 | { "GETPASS", do_getpass, is_services_admin, -1, | |
133 | -1, CHAN_OPER_HELP_GETPASS }, | |
134 | ||
135 | and change is_services_admin to is_services_root and do the same in | |
136 | module/nickserv/main.c | |
137 | ||
138 | Should do it for you, (Someone correct me if i'm wrong, it's been a while ;)). | |
139 | ||
140 | 2008/6/26 <phil1974 at taylorassociate.com>: | |
141 | > Is there any way to change the getpass so only the service root can use that | |
142 | > command? I do not know how to read c code. | |
143 | > | |
144 | > Thanks | |
145 | > ------------------------------------------------------------------ | |
146 | > To unsubscribe or change your subscription options, visit: | |
147 | > http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
148 | > | |
149 | ||
150 | ||
151 | ||
152 | -- | |
153 | /********************************************** | |
154 | * Craig "FrostyCoolSlug" McLure | |
155 | * ChatSpike - http://www.chatspike.net | |
156 | * InspIRCd - http://www.inspircd.org | |
157 | **********************************************/ | |
158 | ||
159 | From administrator at webspace.ms Mon Aug 18 16:59:20 2008 | |
160 | From: administrator at webspace.ms (WILMES Andreas) | |
161 | Date: Tue, 19 Aug 2008 01:59:20 +0200 | |
162 | Subject: [IRCServices Coding] Migrating Modules to 5.1... | |
163 | Message-ID: <48AA0CD8.4070503@webspace.ms> | |
164 | ||
165 | Hy, | |
166 | ||
167 | I'm migrating my old modules for ircservices-5.1.11, but I've seen that | |
168 | there were many changes in the nickgroupinfo_ struct. | |
169 | "char pass[PASSMAX];" were replaced by "Password pass;", so my module | |
170 | won't compile anymore: | |
171 | ||
172 | modules/nickserv/dbsynch.c: In function `copy_data': | |
173 | modules/nickserv/dbsynch.c:83: error: incompatible type for argument 1 | |
174 | of `__builtin_strncpy' | |
175 | ||
176 | ||
177 | Line of this code: | |
178 | ||
179 | static void copy_data(MYSQL_ROW row, unsigned long *lengths, NickInfo | |
180 | *ni, NickGroupInfo *ngi) { | |
181 | char temp[100]; | |
182 | strncpy(ngi->pass, row[field(MYSQL_FIELD_USERINFO_PASSWORD)], PASSMAX < | |
183 | lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] ? PASSMAX : | |
184 | lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] + 1); | |
185 | .... | |
186 | ||
187 | When I replace "ngi->pass" by "&ngi->pass" there's only a warning left, | |
188 | but by running this function copy_data my services crashes. | |
189 | ||
190 | Any Ideas? | |
191 | Regards. | |
192 | ||
193 | From achurch at achurch.org Tue Aug 19 18:52:46 2008 | |
194 | From: achurch at achurch.org (Andrew Church) | |
195 | Date: Tue, 19 Aug 2008 18:52:46 JST | |
196 | Subject: [IRCServices Coding] Migrating Modules to 5.1... | |
197 | In-Reply-To: <48AA0CD8.4070503@webspace.ms> | |
198 | Message-ID: <48aa994b.11673@msgid.achurch.org> | |
199 | ||
200 | Passwords are no longer stored as simple strings, since each password | |
201 | can be encrypted with a different method (cipher). To save data from | |
202 | a Password structure, you need to save both the contents of | |
203 | Password.password (as a binary buffer, not a string) and the string | |
204 | pointed to by Password.cipher (which may be NULL). To restore a | |
205 | Password structure, fill in the password and cipher fields in a | |
206 | temporary variable, then use copy_password() to copy the data to the | |
207 | destination Password structure. | |
208 | ||
209 | --Andrew Church | |
210 | achurch at achurch.org | |
211 | http://achurch.org/ | |
212 | ||
213 | >Hy, | |
214 | > | |
215 | >I'm migrating my old modules for ircservices-5.1.11, but I've seen that | |
216 | >there were many changes in the nickgroupinfo_ struct. | |
217 | >"char pass[PASSMAX];" were replaced by "Password pass;", so my module | |
218 | >won't compile anymore: | |
219 | > | |
220 | >modules/nickserv/dbsynch.c: In function `copy_data': | |
221 | >modules/nickserv/dbsynch.c:83: error: incompatible type for argument 1 | |
222 | >of `__builtin_strncpy' | |
223 | > | |
224 | > | |
225 | >Line of this code: | |
226 | > | |
227 | >static void copy_data(MYSQL_ROW row, unsigned long *lengths, NickInfo | |
228 | >*ni, NickGroupInfo *ngi) { | |
229 | > char temp[100]; | |
230 | >strncpy(ngi->pass, row[field(MYSQL_FIELD_USERINFO_PASSWORD)], PASSMAX < | |
231 | >lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] ? PASSMAX : | |
232 | >lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] + 1); | |
233 | >.... | |
234 | > | |
235 | >When I replace "ngi->pass" by "&ngi->pass" there's only a warning left, | |
236 | >but by running this function copy_data my services crashes. | |
237 | > | |
238 | >Any Ideas? | |
239 | >Regards. | |
240 | >------------------------------------------------------------------ | |
241 | >To unsubscribe or change your subscription options, visit: | |
242 | >http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
243 | ||
244 | From achurch at achurch.org Wed Aug 20 11:20:26 2008 | |
245 | From: achurch at achurch.org (Andrew Church) | |
246 | Date: Wed, 20 Aug 2008 11:20:26 JST | |
247 | Subject: [IRCServices Coding] Migrating Modules to 5.1... | |
248 | In-Reply-To: <48AB0288.7060600@webspace.ms> | |
249 | Message-ID: <48ab8480.67703@msgid.achurch.org> | |
250 | ||
251 | To extract from a Password structure (assuming the source password buffer | |
252 | is declared as "Password source_password"): | |
253 | ||
254 | char password_buffer[PASSMAX]; | |
255 | char *cipher; | |
256 | memcpy(password_buffer, source_password.password, PASSMAX); | |
257 | cipher = strdup(source_password.cipher); | |
258 | ||
259 | To copy into a Password structure (assuming the target password buffer is | |
260 | declared as "Password target_password" and the data to be copied is in | |
261 | "password_buffer" and "cipher" variables as above): | |
262 | ||
263 | Password temp_password; | |
264 | init_password(&temp_password); | |
265 | memcpy(temp_password.password, password_buffer, PASSMAX); | |
266 | temp_password.cipher = cipher; | |
267 | copy_password(&target_password, &temp_password); | |
268 | // Don't leave a copy of the password in memory | |
269 | memset(&temp_password, 0, sizeof(temp_password)); | |
270 | memset(password_buffer, 0, PASSMAX); | |
271 | ||
272 | I actually think I'll add a set_password() function to simplify this, so | |
273 | the above would then become simply: | |
274 | ||
275 | set_password(&target_password, password_buffer, cipher); | |
276 | // Don't leave a copy of the password in memory | |
277 | memset(password_buffer, 0, PASSMAX); | |
278 | ||
279 | See the "encrypt.h" header file and section 2-9-1 of the technical manual | |
280 | for further details. | |
281 | ||
282 | --Andrew Church | |
283 | achurch at achurch.org | |
284 | http://achurch.org/ | |
285 | ||
286 | >Hy, | |
287 | > | |
288 | >Would that be the right way?: | |
289 | > | |
290 | >copy_password(&ngi->pass, &passbuf); | |
291 | >strncpy(&passbuf, row[field(MYSQL_FIELD_USERINFO_PASSWORD) ... | |
292 | > | |
293 | >Are there sample codes to use copy_password in the right way? | |
294 | > | |
295 | >Regards. | |
296 | > | |
297 | > | |
298 | >Andrew Church schrieb: | |
299 | >> Passwords are no longer stored as simple strings, since each password | |
300 | >> can be encrypted with a different method (cipher). To save data from | |
301 | >> a Password structure, you need to save both the contents of | |
302 | >> Password.password (as a binary buffer, not a string) and the string | |
303 | >> pointed to by Password.cipher (which may be NULL). To restore a | |
304 | >> Password structure, fill in the password and cipher fields in a | |
305 | >> temporary variable, then use copy_password() to copy the data to the | |
306 | >> destination Password structure. | |
307 | >> | |
308 | >> --Andrew Church | |
309 | >> achurch at achurch.org | |
310 | >> http://achurch.org/ | |
311 | >> | |
312 | >> | |
313 | >>> Hy, | |
314 | >>> | |
315 | >>> I'm migrating my old modules for ircservices-5.1.11, but I've seen that | |
316 | >>> there were many changes in the nickgroupinfo_ struct. | |
317 | >>> "char pass[PASSMAX];" were replaced by "Password pass;", so my module | |
318 | >>> won't compile anymore: | |
319 | >>> | |
320 | >>> modules/nickserv/dbsynch.c: In function `copy_data': | |
321 | >>> modules/nickserv/dbsynch.c:83: error: incompatible type for argument 1 | |
322 | >>> of `__builtin_strncpy' | |
323 | >>> | |
324 | >>> | |
325 | >>> Line of this code: | |
326 | >>> | |
327 | >>> static void copy_data(MYSQL_ROW row, unsigned long *lengths, NickInfo | |
328 | >>> *ni, NickGroupInfo *ngi) { | |
329 | >>> char temp[100]; | |
330 | >>> strncpy(ngi->pass, row[field(MYSQL_FIELD_USERINFO_PASSWORD)], PASSMAX < | |
331 | >>> lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] ? PASSMAX : | |
332 | >>> lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] + 1); | |
333 | >>> .... | |
334 | >>> | |
335 | >>> When I replace "ngi->pass" by "&ngi->pass" there's only a warning left, | |
336 | >>> but by running this function copy_data my services crashes. | |
337 | >>> | |
338 | >>> Any Ideas? | |
339 | >>> Regards. | |
340 | >>> ------------------------------------------------------------------ | |
341 | >>> To unsubscribe or change your subscription options, visit: | |
342 | >>> http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
343 | >>> | |
344 | >>> ------------------------------------------------------------------------ | |
345 | >>> | |
346 | >>> ------------------------------------------------------------------ | |
347 | >>> To unsubscribe or change your subscription options, visit: | |
348 | >>> http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
349 | > | |
350 | ||
351 | From aragon at phat.za.net Tue Nov 25 03:52:53 2008 | |
352 | From: aragon at phat.za.net (Aragon Gouveia) | |
353 | Date: Tue, 25 Nov 2008 13:52:53 +0200 | |
354 | Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban | |
355 | Message-ID: <20081125115253.GB2825@phat.za.net> | |
356 | ||
357 | Hi, | |
358 | ||
359 | First of all, pardon my serious case of thread necro. I decided to rather | |
360 | resurrect this so that some history is at hand. :) | |
361 | ||
362 | | By Andrew Church <achurch at achurch.org> | |
363 | | [ 2005-09-12 05:02 +0200 ] | |
364 | > >I suspect that some of the irc servers in the network drop a ban | |
365 | > >silently, resulting in services having this ban on their list, which | |
366 | > >is desynched from the rest of the network in this case. I've seen | |
367 | > >similar situations with old hybrid servers and other services, but who | |
368 | > >knows.. | |
369 | > | |
370 | > That's an interesting possibility. To the original poster: try | |
371 | > applying the following patch to Services, then recompiling and restarting | |
372 | > in debug mode (ircservices -debug). When you see the bug happening, check | |
373 | > the logfile and see if the ban in question is listed. (Also, if you could | |
374 | > privately send me the full debug logfile for further analysis I'd | |
375 | > appreciate it.) | |
376 | ||
377 | I applied your patch (2 years ago), thank you. However, it didn't help | |
378 | locate the problem and I never really got the time to focus enough energy on | |
379 | it again until recently. Been living with this bug since then. | |
380 | ||
381 | So it's been a while. I extended your patch a bit by adding logging points | |
382 | into do_cmode() to see when bans get set too. The interesting bits: | |
383 | ||
384 | case 'b': | |
385 | if (add) { | |
386 | ARRAY_EXTEND(chan->bans); | |
387 | chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
388 | log("addban([%s],[%s],[%d])", chan->name, | |
389 | chan->bans[chan->bans_count-1], chan->bans_count-1); | |
390 | } else { | |
391 | int i = find_ban(chan, av[0]); | |
392 | if (i >= 0) { | |
393 | log("find_ban() true, free([%s])", chan->bans[i]); | |
394 | free(chan->bans[i]); | |
395 | ARRAY_REMOVE(chan->bans, i); | |
396 | } else { | |
397 | ||
398 | ||
399 | And when the last server relinked a few times: | |
400 | ||
401 | [Nov 23 16:57:33 2008] find_ban([#5fm],[shand0ra*!*@*]) | |
402 | [Nov 23 16:57:33 2008] ... NOT found | |
403 | [Nov 23 16:57:33 2008] addban([#5fm],[shand0ra*!*@*],[0]) | |
404 | [Nov 23 21:09:56 2008] addban([#5fm],[shand0ra*!*@*],[1]) | |
405 | [Nov 23 21:25:20 2008] addban([#5fm],[shand0ra*!*@*],[2]) | |
406 | ||
407 | And the next find_ban after that: | |
408 | ||
409 | [Nov 24 10:55:01 2008] find_ban([#5fm],[killer!*@*]) | |
410 | [Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*] | |
411 | [Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*] | |
412 | [Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*] | |
413 | [Nov 24 10:55:01 2008] ... checking [killer!*@*] | |
414 | [Nov 24 10:55:01 2008] ... found[1]! | |
415 | [Nov 24 10:55:01 2008] find_ban() true, free([killer!*@*]) | |
416 | ||
417 | ||
418 | So I've changed do_cmode: | |
419 | ||
420 | case 'b': | |
421 | if (add) { | |
422 | int i = find_ban(chan, av[0]); | |
423 | if (i == -1) { | |
424 | ARRAY_EXTEND(chan->bans); | |
425 | chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
426 | } | |
427 | ||
428 | ||
429 | Which I've tested with some oper assisted relinking and things look much | |
430 | better now. I believe 5.1's do_cmode will cause the same problems (it looks | |
431 | the same as 5.0's). | |
432 | ||
433 | Better late than never they say. :) | |
434 | ||
435 | ||
436 | Regards, | |
437 | Aragon | |
438 | ||
439 | ||
440 | > | |
441 | > Index: channels.c | |
442 | > =================================================================== | |
443 | > RCS file: /var/local/cvsroot/ircservices/channels.c,v | |
444 | > retrieving revision 2.43.2.1 | |
445 | > diff -u -r2.43.2.1 channels.c | |
446 | > --- channels.c 6 Jan 2005 17:15:11 -0000 2.43.2.1 | |
447 | > +++ channels.c 12 Sep 2005 03:01:04 -0000 | |
448 | > @@ -192,22 +192,33 @@ | |
449 | > | |
450 | > t = strchr(ban, '!'); | |
451 | > i = 0; | |
452 | > + if (debug) | |
453 | > + log("find_ban([%s],[%s])", chan->name, ban); | |
454 | > ARRAY_FOREACH (i, chan->bans) { | |
455 | > + if (debug) | |
456 | > + log("... checking [%s]", chan->bans[i]); | |
457 | > s = strchr(chan->bans[i], '!'); | |
458 | > if (s && t) { | |
459 | > if (s-(chan->bans[i]) == t-ban | |
460 | > && irc_strnicmp(chan->bans[i], ban, s-(chan->bans[i])) == 0 | |
461 | > && stricmp(s+1, t+1) == 0 | |
462 | > ) { | |
463 | > + if (debug) | |
464 | > + log("... found!"); | |
465 | > return i; | |
466 | > } | |
467 | > } else if (!s && !t) { | |
468 | > /* Bans without '!' should be impossible; just | |
469 | > * do a case-insensitive compare */ | |
470 | > - if (stricmp(chan->bans[i], ban) == 0) | |
471 | > + if (stricmp(chan->bans[i], ban) == 0) { | |
472 | > + if (debug) | |
473 | > + log("... found!"); | |
474 | > return i; | |
475 | > + } | |
476 | > } | |
477 | > } | |
478 | > + if (debug) | |
479 | > + log("... NOT found"); | |
480 | > return -1; | |
481 | > } | |
482 | ||
483 | ||
484 | From aragon at phat.za.net Tue Nov 25 12:59:27 2008 | |
485 | From: aragon at phat.za.net (Aragon Gouveia) | |
486 | Date: Tue, 25 Nov 2008 22:59:27 +0200 | |
487 | Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban | |
488 | In-Reply-To: <20081125115253.GB2825@phat.za.net> | |
489 | References: <20081125115253.GB2825@phat.za.net> | |
490 | Message-ID: <20081125205927.GA43971@phat.za.net> | |
491 | ||
492 | | By Aragon Gouveia <aragon at phat.za.net> | |
493 | | [ 2008-11-25 14:10 +0200 ] | |
494 | > So I've changed do_cmode: | |
495 | > | |
496 | > case 'b': | |
497 | > if (add) { | |
498 | > int i = find_ban(chan, av[0]); | |
499 | > if (i == -1) { | |
500 | > ARRAY_EXTEND(chan->bans); | |
501 | > chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
502 | > } | |
503 | > | |
504 | > | |
505 | > Which I've tested with some oper assisted relinking and things look much | |
506 | > better now. I believe 5.1's do_cmode will cause the same problems (it looks | |
507 | > the same as 5.0's). | |
508 | ||
509 | Below is a diff against 5.1.13 that I reworked a little better than above. | |
510 | Not sure if the extra logging is desirable, and I'm assuming do_cmode() and | |
511 | find_ban() work the same in 5.1. :) | |
512 | ||
513 | ||
514 | Regards, | |
515 | Aragon | |
516 | ||
517 | ||
518 | ||
519 | --- channels.c.orig Tue Nov 25 22:48:24 2008 | |
520 | +++ channels.c Tue Nov 25 22:53:56 2008 | |
521 | @@ -360,11 +360,16 @@ | |
522 | break; | |
523 | ||
524 | case 'b': | |
525 | + int i = find_ban(chan, av[0]); | |
526 | if (add) { | |
527 | - ARRAY_EXTEND(chan->bans); | |
528 | - chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
529 | + if (i == -1) { | |
530 | + ARRAY_EXTEND(chan->bans); | |
531 | + chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
532 | + } else { | |
533 | + log("channel: MODE %s +b %s: ban already exists", | |
534 | + chan->name, *av); | |
535 | + } | |
536 | } else { | |
537 | - int i = find_ban(chan, av[0]); | |
538 | if (i >= 0) { | |
539 | free(chan->bans[i]); | |
540 | ARRAY_REMOVE(chan->bans, i); | |
541 | ||
542 | From achurch at achurch.org Thu Nov 27 20:08:40 2008 | |
543 | From: achurch at achurch.org (Andrew Church) | |
544 | Date: Thu, 27 Nov 2008 20:08:40 JST | |
545 | Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban | |
546 | In-Reply-To: <20081125115253.GB2825@phat.za.net> | |
547 | Message-ID: <492e802e.56730@msgid.achurch.org> | |
548 | ||
549 | I won't have a chance to look at this for a bit due to work obligations, | |
550 | but thanks in advance. (: At first glance, yes, this looks like the Right | |
551 | Thing To Do. | |
552 | ||
553 | --Andrew Church | |
554 | achurch at achurch.org | |
555 | http://achurch.org/ | |
556 | ||
557 | >Hi, | |
558 | > | |
559 | >First of all, pardon my serious case of thread necro. I decided to rather | |
560 | >resurrect this so that some history is at hand. :) | |
561 | > | |
562 | >| By Andrew Church <achurch at achurch.org> | |
563 | >| [ 2005-09-12 05:02 +0200 ] | |
564 | >> >I suspect that some of the irc servers in the network drop a ban | |
565 | >> >silently, resulting in services having this ban on their list, which | |
566 | >> >is desynched from the rest of the network in this case. I've seen | |
567 | >> >similar situations with old hybrid servers and other services, but who | |
568 | >> >knows.. | |
569 | >> | |
570 | >> That's an interesting possibility. To the original poster: try | |
571 | >> applying the following patch to Services, then recompiling and restarting | |
572 | >> in debug mode (ircservices -debug). When you see the bug happening, check | |
573 | >> the logfile and see if the ban in question is listed. (Also, if you could | |
574 | >> privately send me the full debug logfile for further analysis I'd | |
575 | >> appreciate it.) | |
576 | > | |
577 | >I applied your patch (2 years ago), thank you. However, it didn't help | |
578 | >locate the problem and I never really got the time to focus enough energy on | |
579 | >it again until recently. Been living with this bug since then. | |
580 | > | |
581 | >So it's been a while. I extended your patch a bit by adding logging points | |
582 | >into do_cmode() to see when bans get set too. The interesting bits: | |
583 | > | |
584 | >case 'b': | |
585 | >if (add) { | |
586 | > ARRAY_EXTEND(chan->bans); | |
587 | > chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
588 | > log("addban([%s],[%s],[%d])", chan->name, | |
589 | > chan->bans[chan->bans_count-1], chan->bans_count-1); | |
590 | >} else { | |
591 | > int i = find_ban(chan, av[0]); | |
592 | > if (i >= 0) { | |
593 | > log("find_ban() true, free([%s])", chan->bans[i]); | |
594 | > free(chan->bans[i]); | |
595 | > ARRAY_REMOVE(chan->bans, i); | |
596 | > } else { | |
597 | > | |
598 | > | |
599 | >And when the last server relinked a few times: | |
600 | > | |
601 | >[Nov 23 16:57:33 2008] find_ban([#5fm],[shand0ra*!*@*]) | |
602 | >[Nov 23 16:57:33 2008] ... NOT found | |
603 | >[Nov 23 16:57:33 2008] addban([#5fm],[shand0ra*!*@*],[0]) | |
604 | >[Nov 23 21:09:56 2008] addban([#5fm],[shand0ra*!*@*],[1]) | |
605 | >[Nov 23 21:25:20 2008] addban([#5fm],[shand0ra*!*@*],[2]) | |
606 | > | |
607 | >And the next find_ban after that: | |
608 | > | |
609 | >[Nov 24 10:55:01 2008] find_ban([#5fm],[killer!*@*]) | |
610 | >[Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*] | |
611 | >[Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*] | |
612 | >[Nov 24 10:55:01 2008] ... checking [shand0ra*!*@*] | |
613 | >[Nov 24 10:55:01 2008] ... checking [killer!*@*] | |
614 | >[Nov 24 10:55:01 2008] ... found[1]! | |
615 | >[Nov 24 10:55:01 2008] find_ban() true, free([killer!*@*]) | |
616 | > | |
617 | > | |
618 | >So I've changed do_cmode: | |
619 | > | |
620 | >case 'b': | |
621 | >if (add) { | |
622 | > int i = find_ban(chan, av[0]); | |
623 | > if (i == -1) { | |
624 | > ARRAY_EXTEND(chan->bans); | |
625 | > chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
626 | > } | |
627 | > | |
628 | > | |
629 | >Which I've tested with some oper assisted relinking and things look much | |
630 | >better now. I believe 5.1's do_cmode will cause the same problems (it looks | |
631 | >the same as 5.0's). | |
632 | > | |
633 | >Better late than never they say. :) | |
634 | > | |
635 | > | |
636 | >Regards, | |
637 | >Aragon | |
638 | > | |
639 | > | |
640 | >> | |
641 | >> Index: channels.c | |
642 | >> =================================================================== | |
643 | >> RCS file: /var/local/cvsroot/ircservices/channels.c,v | |
644 | >> retrieving revision 2.43.2.1 | |
645 | >> diff -u -r2.43.2.1 channels.c | |
646 | >> --- channels.c 6 Jan 2005 17:15:11 -0000 2.43.2.1 | |
647 | >> +++ channels.c 12 Sep 2005 03:01:04 -0000 | |
648 | >> @@ -192,22 +192,33 @@ | |
649 | >> | |
650 | >> t = strchr(ban, '!'); | |
651 | >> i = 0; | |
652 | >> + if (debug) | |
653 | >> + log("find_ban([%s],[%s])", chan->name, ban); | |
654 | >> ARRAY_FOREACH (i, chan->bans) { | |
655 | >> + if (debug) | |
656 | >> + log("... checking [%s]", chan->bans[i]); | |
657 | >> s = strchr(chan->bans[i], '!'); | |
658 | >> if (s && t) { | |
659 | >> if (s-(chan->bans[i]) == t-ban | |
660 | >> && irc_strnicmp(chan->bans[i], ban, s-(chan->bans[i])) == 0 | |
661 | >> && stricmp(s+1, t+1) == 0 | |
662 | >> ) { | |
663 | >> + if (debug) | |
664 | >> + log("... found!"); | |
665 | >> return i; | |
666 | >> } | |
667 | >> } else if (!s && !t) { | |
668 | >> /* Bans without '!' should be impossible; just | |
669 | >> * do a case-insensitive compare */ | |
670 | >> - if (stricmp(chan->bans[i], ban) == 0) | |
671 | >> + if (stricmp(chan->bans[i], ban) == 0) { | |
672 | >> + if (debug) | |
673 | >> + log("... found!"); | |
674 | >> return i; | |
675 | >> + } | |
676 | >> } | |
677 | >> } | |
678 | >> + if (debug) | |
679 | >> + log("... NOT found"); | |
680 | >> return -1; | |
681 | >> } | |
682 | > | |
683 | >------------------------------------------------------------------ | |
684 | >To unsubscribe or change your subscription options, visit: | |
685 | >http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
686 | ||
687 | From achurch at achurch.org Sun Dec 7 19:44:33 2008 | |
688 | From: achurch at achurch.org (Andrew Church) | |
689 | Date: Sun, 07 Dec 2008 19:44:33 JST | |
690 | Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban | |
691 | In-Reply-To: <20081125205927.GA43971@phat.za.net> | |
692 | Message-ID: <493ba9af.75450@msgid.achurch.org> | |
693 | ||
694 | It does indeed look like the lack of a check can lead to desyncs, causing | |
695 | the failure to set a ban you originally reported. I'll make a release | |
696 | soon with the fix included. | |
697 | ||
698 | Thanks for figuring this out! | |
699 | ||
700 | --Andrew Church | |
701 | achurch at achurch.org | |
702 | http://achurch.org/ | |
703 | ||
704 | >| By Aragon Gouveia <aragon at phat.za.net> | |
705 | >| [ 2008-11-25 14:10 +0200 ] | |
706 | >> So I've changed do_cmode: | |
707 | >> | |
708 | >> case 'b': | |
709 | >> if (add) { | |
710 | >> int i = find_ban(chan, av[0]); | |
711 | >> if (i == -1) { | |
712 | >> ARRAY_EXTEND(chan->bans); | |
713 | >> chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
714 | >> } | |
715 | >> | |
716 | >> | |
717 | >> Which I've tested with some oper assisted relinking and things look much | |
718 | >> better now. I believe 5.1's do_cmode will cause the same problems (it looks | |
719 | >> the same as 5.0's). | |
720 | > | |
721 | >Below is a diff against 5.1.13 that I reworked a little better than above. | |
722 | >Not sure if the extra logging is desirable, and I'm assuming do_cmode() and | |
723 | >find_ban() work the same in 5.1. :) | |
724 | > | |
725 | > | |
726 | >Regards, | |
727 | >Aragon | |
728 | > | |
729 | > | |
730 | > | |
731 | >--- channels.c.orig Tue Nov 25 22:48:24 2008 | |
732 | >+++ channels.c Tue Nov 25 22:53:56 2008 | |
733 | >@@ -360,11 +360,16 @@ | |
734 | > break; | |
735 | > | |
736 | > case 'b': | |
737 | >+ int i = find_ban(chan, av[0]); | |
738 | > if (add) { | |
739 | >- ARRAY_EXTEND(chan->bans); | |
740 | >- chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
741 | >+ if (i == -1) { | |
742 | >+ ARRAY_EXTEND(chan->bans); | |
743 | >+ chan->bans[chan->bans_count-1] = sstrdup(av[0]); | |
744 | >+ } else { | |
745 | >+ log("channel: MODE %s +b %s: ban already exists", | |
746 | >+ chan->name, *av); | |
747 | >+ } | |
748 | > } else { | |
749 | >- int i = find_ban(chan, av[0]); | |
750 | > if (i >= 0) { | |
751 | > free(chan->bans[i]); | |
752 | > ARRAY_REMOVE(chan->bans, i); | |
753 | >------------------------------------------------------------------ | |
754 | >To unsubscribe or change your subscription options, visit: | |
755 | >http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding | |
756 |