]> jfr.im git - irc.git/blame - software/!RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2008.txt
RELEASE -> !RELEASE
[irc.git] / software / !RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2008.txt
CommitLineData
3bd189cb
JR
1From razvan.savu at gmail.com Sat Feb 2 05:46:00 2008
2From: razvan.savu at gmail.com (Razvan Savu)
3Date: Sat, 2 Feb 2008 15:46:00 +0200
4Subject: [IRCServices Coding] Panic 11 Segv Fault error
5Message-ID: <c93d8cd40802020546i4390c52bibc9698c6d62de7e4@mail.gmail.com>
6
7Hello. I'm receiving this error sometimes in ircservices.log.
8
9PANIC! 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
12remove callback `save data complete' from module `core'
13
14I'm using inspircd1.1. Also, if i add an access to a channel, after a
15reset (even if i perform an operserv update), the access list for that
16channel is gone. Any ideeas on how to fix this?
17
18From achurch at achurch.org Sat Feb 2 23:03:18 2008
19From: achurch at achurch.org (Andrew Church)
20Date: Sat, 02 Feb 2008 23:03:18 JST
21Subject: [IRCServices Coding] Panic 11 Segv Fault error
22In-Reply-To: <c93d8cd40802020546i4390c52bibc9698c6d62de7e4@mail.gmail.com>
23Message-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
32See 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
38Are your database files being saved correctly? (There should be several
39*.db or *.sdb files in the directory you specified as the Services data
40directory when you installed Services.)
41
42 --Andrew Church
43 achurch at achurch.org
44 http://achurch.org/
45
46From razvan.savu at gmail.com Sat Feb 2 06:39:38 2008
47From: razvan.savu at gmail.com (Razvan Savu)
48Date: Sat, 2 Feb 2008 16:39:38 +0200
49Subject: [IRCServices Coding] Panic 11 Segv Fault error
50In-Reply-To: <47a47895.65642@msgid.achurch.org>
51References: <c93d8cd40802020546i4390c52bibc9698c6d62de7e4@mail.gmail.com>
52 <47a47895.65642@msgid.achurch.org>
53Message-ID: <c93d8cd40802020639m69513edfof6a043c5e83c4d56@mail.gmail.com>
54
55Yes. Here is a complete listing. Sometimes however i get something
56like database updaate failed.
57
58akill.sdb exception.sdb memo-ignore.sdb nick.sdb
59chan-access.sdb exclude.sdb memo.sdb oper.sdb
60chan-akick.sdb helpfiles modules sgline.sdb
61chan.sdb ircservices.conf modules.conf sqline.sdb
62convert-db ircservices.log news.sdb stat-servers.sdb
63example-ircservices.conf ircservices.pid nick-access.sdb szline.sdb
64example-modules.conf languages nickgroup.sdb
65
662008/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
93From rpope904 at comcast.net Fri Feb 15 20:20:30 2008
94From: rpope904 at comcast.net (Russell)
95Date: Fri, 15 Feb 2008 23:20:30 -0500
96Subject: [IRCServices Coding] How would I do this (NickServ)
97Message-ID: <000001c87053$454c1670$cfe44350$@net>
98
99Basically, I have made a website to for users to interact with irc from..
100The site generates them a page with a custom chat applet for their channel,
101but I want to be able to delete inactive users, how can I get ircservices to
102go to a url when a nickname is removed from the database? i.e.
103http://www.somesite.com/admin/remove.php?nick=$nickname
104
105-------------- next part --------------
106An HTML attachment was scrubbed...
107URL: http://lists.ircservices.za.net/pipermail/ircservices-coding/attachments/20080215/00c951f9/attachment.htm
108
109From phil1974 at taylorassociate.com Wed Jun 25 20:07:49 2008
110From: phil1974 at taylorassociate.com (phil1974 at taylorassociate.com)
111Date: Wed, 25 Jun 2008 23:07:49 -0400
112Subject: [IRCServices Coding] Disable getpass
113Message-ID: <016101c8d739$d0ae7120$0300a8c0@Laptop>
114
115Is 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
117Thanks
118-------------- next part --------------
119An HTML attachment was scrubbed...
120URL: http://lists.ircservices.za.net/pipermail/ircservices-coding/attachments/20080625/642fe742/attachment.html
121
122From Craig at frostycoolslug.com Thu Jun 26 08:32:49 2008
123From: Craig at frostycoolslug.com (Craig McLure)
124Date: Thu, 26 Jun 2008 16:32:49 +0100
125Subject: [IRCServices Coding] Disable getpass
126In-Reply-To: <016101c8d739$d0ae7120$0300a8c0@Laptop>
127References: <016101c8d739$d0ae7120$0300a8c0@Laptop>
128Message-ID: <8a79f15a0806260832l658ad102i701a53dfee168108@mail.gmail.com>
129
130in modules/chanserv/main.c, find:
131
132 { "GETPASS", do_getpass, is_services_admin, -1,
133 -1, CHAN_OPER_HELP_GETPASS },
134
135and change is_services_admin to is_services_root and do the same in
136module/nickserv/main.c
137
138Should do it for you, (Someone correct me if i'm wrong, it's been a while ;)).
139
1402008/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
159From administrator at webspace.ms Mon Aug 18 16:59:20 2008
160From: administrator at webspace.ms (WILMES Andreas)
161Date: Tue, 19 Aug 2008 01:59:20 +0200
162Subject: [IRCServices Coding] Migrating Modules to 5.1...
163Message-ID: <48AA0CD8.4070503@webspace.ms>
164
165Hy,
166
167I'm migrating my old modules for ircservices-5.1.11, but I've seen that
168there were many changes in the nickgroupinfo_ struct.
169"char pass[PASSMAX];" were replaced by "Password pass;", so my module
170won't compile anymore:
171
172modules/nickserv/dbsynch.c: In function `copy_data':
173modules/nickserv/dbsynch.c:83: error: incompatible type for argument 1
174of `__builtin_strncpy'
175
176
177Line of this code:
178
179static void copy_data(MYSQL_ROW row, unsigned long *lengths, NickInfo
180*ni, NickGroupInfo *ngi) {
181 char temp[100];
182strncpy(ngi->pass, row[field(MYSQL_FIELD_USERINFO_PASSWORD)], PASSMAX <
183lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] ? PASSMAX :
184lengths[field(MYSQL_FIELD_USERINFO_PASSWORD)] + 1);
185....
186
187When I replace "ngi->pass" by "&ngi->pass" there's only a warning left,
188but by running this function copy_data my services crashes.
189
190Any Ideas?
191Regards.
192
193From achurch at achurch.org Tue Aug 19 18:52:46 2008
194From: achurch at achurch.org (Andrew Church)
195Date: Tue, 19 Aug 2008 18:52:46 JST
196Subject: [IRCServices Coding] Migrating Modules to 5.1...
197In-Reply-To: <48AA0CD8.4070503@webspace.ms>
198Message-ID: <48aa994b.11673@msgid.achurch.org>
199
200Passwords are no longer stored as simple strings, since each password
201can be encrypted with a different method (cipher). To save data from
202a Password structure, you need to save both the contents of
203Password.password (as a binary buffer, not a string) and the string
204pointed to by Password.cipher (which may be NULL). To restore a
205Password structure, fill in the password and cipher fields in a
206temporary variable, then use copy_password() to copy the data to the
207destination 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
244From achurch at achurch.org Wed Aug 20 11:20:26 2008
245From: achurch at achurch.org (Andrew Church)
246Date: Wed, 20 Aug 2008 11:20:26 JST
247Subject: [IRCServices Coding] Migrating Modules to 5.1...
248In-Reply-To: <48AB0288.7060600@webspace.ms>
249Message-ID: <48ab8480.67703@msgid.achurch.org>
250
251To extract from a Password structure (assuming the source password buffer
252is 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
259To copy into a Password structure (assuming the target password buffer is
260declared 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
272I actually think I'll add a set_password() function to simplify this, so
273the 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
279See the "encrypt.h" header file and section 2-9-1 of the technical manual
280for 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
351From aragon at phat.za.net Tue Nov 25 03:52:53 2008
352From: aragon at phat.za.net (Aragon Gouveia)
353Date: Tue, 25 Nov 2008 13:52:53 +0200
354Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban
355Message-ID: <20081125115253.GB2825@phat.za.net>
356
357Hi,
358
359First of all, pardon my serious case of thread necro. I decided to rather
360resurrect 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
377I applied your patch (2 years ago), thank you. However, it didn't help
378locate the problem and I never really got the time to focus enough energy on
379it again until recently. Been living with this bug since then.
380
381So it's been a while. I extended your patch a bit by adding logging points
382into do_cmode() to see when bans get set too. The interesting bits:
383
384case 'b':
385if (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
399And 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
407And 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
418So I've changed do_cmode:
419
420case 'b':
421if (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
429Which I've tested with some oper assisted relinking and things look much
430better now. I believe 5.1's do_cmode will cause the same problems (it looks
431the same as 5.0's).
432
433Better late than never they say. :)
434
435
436Regards,
437Aragon
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
484From aragon at phat.za.net Tue Nov 25 12:59:27 2008
485From: aragon at phat.za.net (Aragon Gouveia)
486Date: Tue, 25 Nov 2008 22:59:27 +0200
487Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban
488In-Reply-To: <20081125115253.GB2825@phat.za.net>
489References: <20081125115253.GB2825@phat.za.net>
490Message-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
509Below is a diff against 5.1.13 that I reworked a little better than above.
510Not sure if the extra logging is desirable, and I'm assuming do_cmode() and
511find_ban() work the same in 5.1. :)
512
513
514Regards,
515Aragon
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
542From achurch at achurch.org Thu Nov 27 20:08:40 2008
543From: achurch at achurch.org (Andrew Church)
544Date: Thu, 27 Nov 2008 20:08:40 JST
545Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban
546In-Reply-To: <20081125115253.GB2825@phat.za.net>
547Message-ID: <492e802e.56730@msgid.achurch.org>
548
549I won't have a chance to look at this for a bit due to work obligations,
550but thanks in advance. (: At first glance, yes, this looks like the Right
551Thing 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
687From achurch at achurch.org Sun Dec 7 19:44:33 2008
688From: achurch at achurch.org (Andrew Church)
689Date: Sun, 07 Dec 2008 19:44:33 JST
690Subject: [IRCServices Coding] [IRCServices] akick not setting channel ban
691In-Reply-To: <20081125205927.GA43971@phat.za.net>
692Message-ID: <493ba9af.75450@msgid.achurch.org>
693
694It does indeed look like the lack of a check can lead to desyncs, causing
695the failure to set a ban you originally reported. I'll make a release
696soon with the fix included.
697
698Thanks 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