diff -uNr ircservices-5.0.25/Changes ircservices-5.0.26/Changes --- ircservices-5.0.25/Changes 2003-11-18 21:32:35 +0900 +++ ircservices-5.0.26/Changes 2003-11-26 23:22:42 +0900 @@ -1,5 +1,27 @@ Version 5.0 ----------- +2003/11/26 .26 Some configuration settings (such as FromAddress in mail/main) + which were only checked for validity at startup are now + also checked when rehashing the configuration files. +2003/11/26 Fixed failure to recognize changes in the MSAllowForward + configuration directive (for the memoserv/forward module). +2003/11/26 Improved internal storage format for nickname authentication + codes (the reason for setting the code is now stored + separately from the code itself). As a result, Cygnus + codes are now imported without any changes. +2003/11/26 Fixed infinite-loop bug in Magick database importer. + Reported by +2003/11/25 Fixed potential desynchronization bug with channel MODE -e. +2003/11/25 The registration delay functionality (NSRegDelay and + NSInitialRegDelay) now shows the remaining amount of + time the user needs to wait rather than the full delay + length. +2003/11/25 Added NSInitialRegDelay configuration option. Suggested by + Mark Hetherington +2003/11/25 Documented the workings of hash.h. +2003/11/25 Fixed more memory leaks, and did minor code cleanups. +2003/11/20 Fixed a cosmetic bug in OperServ HELP AKILLCHAN. Reported + by 2003/11/18 .25 Fixed potential crashes when importing or exporting data via the command line. 2003/11/18 Fixed various memory leaks. @@ -7,7 +29,10 @@ version of GCC. Reported by Matthew Hodgson 2003/11/13 Added AKILLCHAN command to operserv/akill module. - Suggested by and others. + Suggested by and others. As a + result, the operserv/akill module now requires a new + configuration directive, AkillChanExpiry, to be set in + modules.conf. 2003/11/13 OperServ will now issue a warning if EnableExclude is used with an IRC server type that does not support autokill exclusions (thus preventing autokills from being sent). diff -uNr ircservices-5.0.25/TODO ircservices-5.0.26/TODO --- ircservices-5.0.25/TODO 2003-10-27 12:58:42 +0900 +++ ircservices-5.0.26/TODO 2003-11-24 21:46:25 +0900 @@ -49,6 +49,10 @@ Things to think about: +CS Specify (in conf file) modes that users are not allowed to change + [Medice ] +CS ChanServ LINK, like NickServ but for channels + [Craig McLure ] NS Require E-mail address regged with nick for SENDPASS [playa ] NS Replace "may not be registered or used" with "is forbidden" in diff -uNr ircservices-5.0.25/actions.c ircservices-5.0.26/actions.c --- ircservices-5.0.25/actions.c 2003-11-18 21:39:58 +0900 +++ ircservices-5.0.26/actions.c 2003-11-26 23:28:18 +0900 @@ -137,11 +137,11 @@ int i, count; char **bans; - if (!chan->bancount) + if (!chan->bans_count) return; /* Save original ban info */ - count = chan->bancount; + count = chan->bans_count; bans = smalloc(sizeof(char *) * count); memcpy(bans, chan->bans, sizeof(char *) * count); diff -uNr ircservices-5.0.25/channels.c ircservices-5.0.26/channels.c --- ircservices-5.0.25/channels.c 2003-11-18 21:39:58 +0900 +++ ircservices-5.0.26/channels.c 2003-11-26 23:28:18 +0900 @@ -15,27 +15,6 @@ #define HASHFUNC(key) (hashlookup[(uint8)((key)[1])]<<5 \ | ((key)[1] ? hashlookup[(uint8)((key)[2])] : 0)) #define HASHSIZE 1024 -static const uint8 hashlookup[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29, 0, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,30, - - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, - 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31, -}; #include "hash.h" void add_channel(Channel *chan); /* to avoid "no prototype" warning */ void del_channel(Channel *chan); /* same */ @@ -109,11 +88,16 @@ mem += strlen(chan->topic)+1; if (chan->key) mem += strlen(chan->key)+1; - mem += sizeof(char *) * chan->bansize; - for (i = 0; i < chan->bancount; i++) { + ARRAY_FOREACH (i, chan->bans) { + mem += sizeof(char *); if (chan->bans[i]) mem += strlen(chan->bans[i])+1; } + ARRAY_FOREACH (i, chan->excepts) { + mem += sizeof(char *); + if (chan->excepts[i]) + mem += strlen(chan->excepts[i])+1; + } LIST_FOREACH (cu, chan->users) mem += sizeof(*cu); } @@ -182,10 +166,12 @@ set_cmode(NULL, c); /* make sure nothing's left buffered */ free(c->topic); free(c->key); - for (i = 0; i < c->bancount; i++) + free(c->link); + free(c->flood); + for (i = 0; i < c->bans_count; i++) free(c->bans[i]); free(c->bans); - for (i = 0; i < c->exceptcount; i++) + for (i = 0; i < c->excepts_count; i++) free(c->excepts[i]); free(c->excepts); del_channel(c); @@ -206,7 +192,7 @@ t = strchr(ban, '!'); i = 0; - for (i = 0; i < chan->bancount; i++) { + ARRAY_FOREACH (i, chan->bans) { s = strchr(chan->bans[i], '!'); if (s && t) { if (s-(chan->bans[i]) == t-ban @@ -361,19 +347,13 @@ case 'b': if (add) { - if (chan->bancount >= chan->bansize) { - chan->bansize += 8; - chan->bans = srealloc(chan->bans, - sizeof(char *) * chan->bansize); - } - chan->bans[chan->bancount++] = sstrdup(av[0]); + ARRAY_EXTEND(chan->bans); + chan->bans[chan->bans_count-1] = sstrdup(av[0]); } else { int i = find_ban(chan, av[0]); if (i >= 0) { - chan->bancount--; - if (i < chan->bancount) - memmove(&chan->bans[i], &chan->bans[i+1], - sizeof(char*) * (chan->bancount-i)); + free(chan->bans[i]); + ARRAY_REMOVE(chan->bans, i); } else { log("channel: MODE %s -b %s: ban not found", chan->name, *av); diff -uNr ircservices-5.0.25/channels.h ircservices-5.0.26/channels.h --- ircservices-5.0.25/channels.h 2003-11-18 21:39:58 +0900 +++ ircservices-5.0.26/channels.h 2003-11-26 23:28:18 +0900 @@ -29,10 +29,10 @@ char *link; /* +L (Unreal) */ char *flood; /* +f (Unreal) */ - int32 bancount, bansize; char **bans; - int32 exceptcount, exceptsize; + int32 bans_count; char **excepts; + int32 excepts_count; struct c_userlist { struct c_userlist *next, *prev; diff -uNr ircservices-5.0.25/conffile.c ircservices-5.0.26/conffile.c --- ircservices-5.0.25/conffile.c 2003-11-18 21:39:58 +0900 +++ ircservices-5.0.26/conffile.c 2003-11-26 23:28:18 +0900 @@ -465,7 +465,7 @@ char tmpbuf[CONFIG_LINEMAX]; /* leave `buf' alone */ if (strlen(buf) >= sizeof(tmpbuf)) { fatal("BUG: strlen(buf) >= sizeof(tmpbuf) in configure()" - " configure() (file %s line %d)", filename, linenum); + " (file %s line %d)", filename, linenum); } strcpy(tmpbuf, buf); /* safe: length checked above */ s = strtok(tmpbuf, " \t\r\n"); diff -uNr ircservices-5.0.25/data/example-modules.conf ircservices-5.0.26/data/example-modules.conf --- ircservices-5.0.25/data/example-modules.conf 2003-11-18 21:39:56 +0900 +++ ircservices-5.0.26/data/example-modules.conf 2003-11-26 23:28:18 +0900 @@ -246,10 +246,9 @@ AutokillExpiry 30d - # AkillChanExpiry