diff -uNr ircservices-5.0.18/Changes ircservices-5.0.19/Changes --- ircservices-5.0.18/Changes 2003-04-28 15:04:43 +0900 +++ ircservices-5.0.19/Changes 2003-05-28 14:18:53 +0900 @@ -1,5 +1,30 @@ Version 5.0 ----------- +2003/05/28 .19 Fake hostnames are now handled correctly by the PTlink + protocol module. +2003/05/28 Services now checks in advance whether a protocol module + has been loaded, and aborts with an error message if + not. Suggested by Mark Hetherington +2003/05/28 Updated FAQ C.1 and added FAQ C.1.5 regarding errors which + can occur when saving the databases to disk. +2003/05/28 The ExpireTimeout configuration directive has been + deprecated, as it is no longer used. This directive + will be removed entirely in the next version of Services. +2003/05/28 Added documentation to section 6 of the manual on how to + process messages received from the IRC network. +2003/05/28 The program name used in the /VERSION reply ("ircservices") + is now defined in version.sh for easier changing in + derivative programs. +2003/05/06 Clarified reasoning behind transfer-of-rights requirement + for submission of code or other changes. +2003/04/30 Fixed bug in OperServ JUPE command causing Services to be + disconnected from the network when juping an existing + server. Reported by George Stamatiou +2003/04/30 Added CSRegisteredOnly configuration directive. Suggested + by Stefan Hudson +2003/04/30 Fixed (lack of) interaction between NickServ autojoin and + +i channels causing "cannot join channel" errors on + IDENTIFY. Reported by Christopher Wilson 2003/04/28 .18 Fixed bug causing chunks of output to get lost in the middle of HTTP server responses. Reported by several people. 2003/04/28 Fixed cosmetic bug in error message for colliding nicknames. diff -uNr ircservices-5.0.18/Makefile ircservices-5.0.19/Makefile --- ircservices-5.0.18/Makefile 2003-04-28 20:00:27 +0900 +++ ircservices-5.0.19/Makefile 2003-05-28 15:19:26 +0900 @@ -172,7 +172,10 @@ langstrs.h: lang/langstrs.h cp -p lang/langstrs.h . -lang/langstrs.h: lang/Makefile lang/en_us.l +lang/langstrs.h: lang/Makefile lang/index $(MAKE) -C lang langstrs.h +lang/index: lang/Makefile lang/en_us.l + $(MAKE) -C lang index + ########################################################################### diff -uNr ircservices-5.0.18/TODO ircservices-5.0.19/TODO --- ircservices-5.0.18/TODO 2003-04-06 23:18:39 +0900 +++ ircservices-5.0.19/TODO 2003-05-28 14:18:53 +0900 @@ -1,5 +1,8 @@ Things to probably do: +OS Change KILLCLONES to AKILLNICK or similar + [Mark Hetherington ] +NS Option to prevent certain domains from being used in mail addresses CS Send message sender to KICK callback [Georges Berscheid ] CS Clearer message when CLEAR used with bad "what" parameter diff -uNr ircservices-5.0.18/actions.c ircservices-5.0.19/actions.c --- ircservices-5.0.18/actions.c 2003-04-28 20:00:27 +0900 +++ ircservices-5.0.19/actions.c 2003-05-28 15:19:26 +0900 @@ -262,9 +262,14 @@ Timeout *timeout; /* For timely flushing */ } modedata[MERGE_CHANMODES_MAX]; -static void flush_cmode(struct modedata *md); +static void possibly_remove_mode(struct modedata *md, char mode, + const char *user); +static void add_mode_with_params(struct modedata *md, char mode, int is_add, + int params, const char *parambuf, int len); +static void flush_cmode(struct modedata *md, int clear); static void flush_cmode_callback(Timeout *t); +/*************************************************************************/ void set_cmode(const char *sender, Channel *channel, ...) { @@ -273,7 +278,7 @@ struct modedata *md; int which = -1, add; int i; - char c, *s; + char c; /* If `sender' is NULL, flush out pending modes for the channel (for @@ -281,7 +286,7 @@ if (!sender) { for (i = 0; i < MERGE_CHANMODES_MAX; i++) { if (modedata[i].used && (!channel || modedata[i].channel==channel)) - flush_cmode(&modedata[i]); + flush_cmode(&modedata[i], 1); } return; } @@ -297,7 +302,7 @@ for (i = 0; i < MERGE_CHANMODES_MAX; i++) { if (modedata[i].used != 0 && modedata[i].channel == channel) { if (irc_stricmp(modedata[i].sender, sender) != 0) - flush_cmode(&modedata[i]); + flush_cmode(&modedata[i], 1); which = i; break; } @@ -323,7 +328,7 @@ oldest = i; } } - flush_cmode(&modedata[oldest]); + flush_cmode(&modedata[oldest], 1); which = oldest; } @@ -373,7 +378,7 @@ if (params) { /* Mode with parameters */ char parambuf[BUFSIZE]; /* for putting the parameters in */ - int i, len = 0; + int len = 0; params = (params >> (add*8)) & 0xFF; if (params > MAXMODES) { @@ -381,65 +386,23 @@ fatal("set_cmode(): too many parameters (%d) for mode `%c'\n", params, c); } + /* Merge all the parameters into a single string (with no + * leading whitespace) */ for (i = 0; i < params; i++) { - s = va_arg(args, char *); + const char *s = va_arg(args, const char *); len += snprintf(parambuf+len, sizeof(parambuf)-len, "%s%s", len ? " " : "", s); } if (flag != MODE_INVALID) { - /* If it's a binary mode, see if we've set this mode before */ - for (i = md->nopmodes-1; i >= 0; i--) { - if (md->opmodes[i*2+1] == c) { - /* We've already set this mode once */ - if (is_chanuser) { - /* Only remove the old mode if the nick matches */ - if (irc_stricmp(md->params[i], parambuf) != 0) - continue; - } - /* Remove this setting; the new one will be appended - * afterwards (note that this assumes that setting each - * mode is independent, i.e. that -a+ba 2 1 has the - * same effect as +ba 2 1 by itself when +a is set) */ - md->nopmodes--; - s = md->opmodes + (i*2); - memmove(s, s+2, strlen(s+2)+1); - md->nparams--; - s = md->params[i]-1; - while ((s = strchr(s+1, ' ')) != NULL) - md->nparams--; - if (i < md->nopmodes) { - memmove(md->params+i, md->params+i+1, - sizeof(md->params[0])*(md->nopmodes-i)); - } - memset(md->params+md->nopmodes, 0, sizeof(md->params[0])); - } - } - } /* if (flag != MODE_INVALID) */ - /* Check for overflow of parameter count or length (the - * MAXPARAMSLEN check is >= because of the separating space - * added between parameters) */ - if (md->nparams+params > MAXMODES - || md->paramslen+len >= MAXPARAMSLEN - ) { - /* Doesn't fit, so flush modes out first */ - flush_cmode(md); - strscpy(md->sender, sender, NICKMAX); - md->channel = channel; - md->used = time(NULL); + /* If it's a binary mode, see if we've set this mode before. + * If so (and if the nick is the same for channel user + * modes), remove it; the new one will be appended + * afterwards. Note that this assumes that setting each + * mode is independent, i.e. that -a+ba 2 1 has the same + * effect as +ba 2 1 by itself when +a is set. */ + possibly_remove_mode(md, c, is_chanuser ? parambuf : NULL); } - s = md->opmodes + 2*md->nopmodes; - *s++ = add ? '+' : '-'; - *s++ = c; - strscpy(md->params[md->nopmodes], parambuf, sizeof(md->params[0])); - md->nopmodes++; - md->nparams += params; - if (md->paramslen) - md->paramslen++; - md->paramslen += strlen(parambuf); - /* If the parameters for this mode alone exceed MAXPARAMSLEN, - * we'll now have a string longer than MAXPARAMSLEN in - * md->params; not much we can do about it, though, and it'll - * get flushed next time around anyway. */ + add_mode_with_params(md, c, add, params, parambuf, len); } else { /* Binary mode */ /* Note that `flag' should already be set to this value, since * all channel user modes take parameters and thus will never @@ -466,8 +429,98 @@ } } +/*************************************************************************/ + +/* Remove the most recent occurrence of mode `mode' from the mode list if + * there is one, provided either `user' is NULL or the parameter associated + * with the previous mode is equal (according to irc_stricmp()) to the + * string pointed to by `user'. + */ -static void flush_cmode(struct modedata *md) +static void possibly_remove_mode(struct modedata *md, char mode, + const char *user) +{ + int i; + char *s; + + for (i = md->nopmodes-1; i >= 0; i--) { + if (md->opmodes[i*2+1] == mode) { + /* We've already set this mode once */ + if (user) { + /* Only remove the old mode if the nick matches */ + if (irc_stricmp(md->params[i], user) != 0) + continue; + } + /* Remove the mode */ + md->nopmodes--; + s = md->opmodes + (i*2); + memmove(s, s+2, strlen(s+2)+1); + md->nparams--; + s = md->params[i]-1; + while ((s = strchr(s+1, ' ')) != NULL) + md->nparams--; + if (i < md->nopmodes) { + memmove(md->params+i, md->params+i+1, + sizeof(md->params[0])*(md->nopmodes-i)); + } + memset(md->params+md->nopmodes, 0, sizeof(md->params[0])); + } + } +} + +/*************************************************************************/ + +/* Add a single mode with parameters to the given mode data structure. + * `params' is the number of parameters, `parambuf' is the space-separated + * parameter list, and `len' is strlen(parambuf). + */ + +static void add_mode_with_params(struct modedata *md, char mode, int is_add, + int params, const char *parambuf, int len) +{ + char *s; + + /* Check for overflow of parameter count or length */ + if (md->nparams+params > MAXMODES + || md->paramslen+1+len > MAXPARAMSLEN + ) { + /* Doesn't fit, so flush modes out first */ + flush_cmode(md, 0); + md->used = time(NULL); + } + s = md->opmodes + 2*md->nopmodes; + *s++ = is_add ? '+' : '-'; + *s++ = mode; + if (len > sizeof(md->params[0])-1) { + log("set_cmode(): Parameter string for mode %c%c is too long," + " truncating to %d characters", + is_add ? '+' : '-', mode, sizeof(md->params[0])-1); + len = sizeof(md->params[0])-1; + } else if (len < 0) { + log("add_mode_with_params(): BUG: parameter length < 0 (%d)", len); + len = 0; + } + if (len > 0) + memcpy(md->params[md->nopmodes], parambuf, len); + md->params[md->nopmodes][len] = 0; + md->nopmodes++; + md->nparams += params; + if (md->paramslen) + md->paramslen++; + md->paramslen += len; + /* If the parameters for this mode alone exceed MAXPARAMSLEN, + * we'll now have a string longer than MAXPARAMSLEN in + * md->params; not much we can do about it, though, and it'll + * get flushed next time around anyway. */ +} + +/*************************************************************************/ + +/* Flush out pending mode changes for the given mode data structure. If + * `clear' is nonzero, clear the entry, else leave it alone. + */ + +static void flush_cmode(struct modedata *md, int clear) { char buf[BUFSIZE], *s; char *argv[MAXMODES+2]; @@ -558,9 +611,15 @@ memset(md, 0, sizeof(*md)); } +/*************************************************************************/ + +/* Timeout called to flush mode changes for a channel after + * `MergeChannelModes' seconds of inactivity. + */ + static void flush_cmode_callback(Timeout *t) { - flush_cmode((struct modedata *)t->data); + flush_cmode((struct modedata *)t->data, 1); } /*************************************************************************/ バイナリー・ファイルircservices-5.0.18/coreとircservices-5.0.19/coreは違います diff -uNr ircservices-5.0.18/data/example-ircservices.conf ircservices-5.0.19/data/example-ircservices.conf --- ircservices-5.0.18/data/example-ircservices.conf 2003-04-28 20:00:26 +0900 +++ ircservices-5.0.19/data/example-ircservices.conf 2003-05-28 15:19:26 +0900 @@ -284,12 +284,14 @@ UpdateTimeout 5m -# ExpireTimeout