diff -uNr ircservices-5.0.33/Changes ircservices-5.0.34/Changes --- ircservices-5.0.33/Changes 2004-06-30 18:29:32 +0900 +++ ircservices-5.0.34/Changes 2004-07-05 23:51:57 +0900 @@ -1,5 +1,9 @@ Version 5.0 ----------- +2004/07/05 .34 configure now properly detects the GCC version in use when + running under Debian Linux. +2004/07/02 Fixed bugs in handling MLOCK +/-j on Bahamut. +2004/07/02 Fixed tiny potential memory leak on failed SET MLOCK. 2004/06/29 .33 Fixed child process handling bug in mail/sendmail module. Reported by Ali Sor 2004/06/29 ChanServ STATUS now displays the SOP/AOP/VOP level when the diff -uNr ircservices-5.0.33/configure ircservices-5.0.34/configure --- ircservices-5.0.33/configure 2004-06-17 14:54:52 +0900 +++ ircservices-5.0.34/configure 2004-07-05 23:47:30 +0900 @@ -802,7 +802,7 @@ log cache supplied \`"$CC'" CC_FLAGS=$CACHED_CC_FLAGS elif run gcc --version ; then - version=`gcc --version 2>&1 | head -1 | sed 's/.*[^0-9.]\([0-9][0-9.]*\).*/\1/'` + version=`gcc --version 2>&1 | head -1 | sed 's/[^0-9]*[^0-9.]\([0-9][0-9.]*\).*/\1/'` vmajor=`echo "x.$version.0" | cut -d. -f2` vminor=`echo "x.$version.0" | cut -d. -f3` if test "x$version" = x || (echo "x$vmajor" | cut -c2- | grep '[^0-9]' >/dev/null 2>&1) || (echo "x$vminor" | cut -c2- | grep '[^0-9]' >/dev/null 2>&1) ; then diff -uNr ircservices-5.0.33/defs.h ircservices-5.0.34/defs.h --- ircservices-5.0.33/defs.h 2004-07-01 21:31:26 +0900 +++ ircservices-5.0.34/defs.h 2004-07-05 23:57:00 +0900 @@ -214,6 +214,9 @@ /* Length of an array: */ #define lenof(a) (sizeof(a) / sizeof(*(a))) +/* Sign of a number: (-1, 0, or 1) */ +#define sgn(a) ((a)<0 ? -1 : ((a)>0)) + /* Telling compilers about printf()-like functions: */ #ifdef __GNUC__ # define FORMAT(type,fmt,start) __attribute__((format(type,fmt,start))) diff -uNr ircservices-5.0.33/docs/6.html ircservices-5.0.34/docs/6.html --- ircservices-5.0.33/docs/6.html 2004-06-29 17:08:58 +0900 +++ ircservices-5.0.34/docs/6.html 2004-07-02 16:42:45 +0900 @@ -1455,7 +1455,7 @@ is set correctly. The new mode lock (currently being constructed) is stored in the ci->mlock_XXX fields. The callback routine should return 1 if it encounters an invalid - parameter for a mode, otherwise. + parameter for a mode, 0 otherwise.

Also called with modechar set to zero when all modes have been processed. In this case, add and diff -uNr ircservices-5.0.33/docs/b.html ircservices-5.0.34/docs/b.html --- ircservices-5.0.33/docs/b.html 2003-05-28 15:31:04 +0900 +++ ircservices-5.0.34/docs/b.html 2004-07-02 17:01:00 +0900 @@ -156,6 +156,9 @@ <mlock_key>...</mlock_key> <mlock_link>...</mlock_link> <mlock_flood>...</mlock_flood> + <mlock_joindelay>...</mlock_joindelay> + <mlock_joinrate1>...</mlock_joinrate1> + <mlock_joinrate2>...</mlock_joinrate2> <memoinfo> <memos count='...'> </memos> @@ -603,6 +606,17 @@

mlock_flood
Contains the channel's locked flood setting, if any. +
mlock_joindelay +
Contains the channel's locked join delay setting, if any. + +
mlock_joinrate1 +
Contains the first part of the channel's locked join rate limit + setting, if any. + +
mlock_joinrate2 +
Contains the second part of the channel's locked join rate limit + setting, if any. +
news
Contains the data for a news item. diff -uNr ircservices-5.0.33/modules/chanserv/set.c ircservices-5.0.34/modules/chanserv/set.c --- ircservices-5.0.33/modules/chanserv/set.c 2004-07-01 21:31:27 +0900 +++ ircservices-5.0.34/modules/chanserv/set.c 2004-07-05 23:57:01 +0900 @@ -365,6 +365,7 @@ int32 flag; int params; int32 oldlock_on, oldlock_off, oldlock_limit, oldlock_joindelay; + int32 oldlock_joinrate1, oldlock_joinrate2; char *oldlock_key, *oldlock_link, *oldlock_flood; oldlock_on = ci->mlock_on; @@ -374,6 +375,8 @@ oldlock_link = ci->mlock_link; oldlock_flood = ci->mlock_flood; oldlock_joindelay = ci->mlock_joindelay; + oldlock_joinrate1 = ci->mlock_joinrate1; + oldlock_joinrate2 = ci->mlock_joinrate2; ci->mlock_on = 0; ci->mlock_off = 0; ci->mlock_limit = 0; @@ -381,6 +384,8 @@ ci->mlock_link = NULL; ci->mlock_flood = NULL; ci->mlock_joindelay = 0; + ci->mlock_joinrate1 = 0; + ci->mlock_joinrate2 = 0; while (ac < MAX_MLOCK_PARAMS && (s = strtok(NULL, " ")) != NULL) av[ac++] = s; @@ -480,6 +485,8 @@ fail: /* Failure; restore the old mode lock. */ free(ci->mlock_key); + free(ci->mlock_link); + free(ci->mlock_flood); ci->mlock_on = oldlock_on; ci->mlock_off = oldlock_off; ci->mlock_limit = oldlock_limit; @@ -487,6 +494,8 @@ ci->mlock_link = oldlock_link; ci->mlock_flood = oldlock_flood; ci->mlock_joindelay = oldlock_joindelay; + ci->mlock_joinrate1 = oldlock_joinrate1; + ci->mlock_joinrate2 = oldlock_joinrate2; } /*************************************************************************/ diff -uNr ircservices-5.0.33/modules/protocol/bahamut.c ircservices-5.0.34/modules/protocol/bahamut.c --- ircservices-5.0.33/modules/protocol/bahamut.c 2004-07-01 21:31:27 +0900 +++ ircservices-5.0.34/modules/protocol/bahamut.c 2004-07-05 23:57:01 +0900 @@ -617,12 +617,15 @@ if (add) { switch (mode_flag_to_char(flag, MODE_CHANNEL)) { case 'j': - if (ci->mlock_joinrate1 <= 0 || ci->mlock_joinrate2 <= 0) { + if (sgn(ci->mlock_joinrate1) != sgn(ci->mlock_joinrate2)) { module_log("warning: removing +j from channel %s mode lock" " (invalid parameter: %d:%d)", ci->name, ci->mlock_joinrate1, ci->mlock_joinrate2); ci->mlock_on &= ~mode_char_to_flag('j', MODE_CHANNEL); ci->mlock_joinrate1 = ci->mlock_joinrate2 = 0; + } else if (ci->mlock_joinrate1 < 0) { + if (c->joinrate1 || c->joinrate2) + set_cmode(s_ChanServ, c, "-j"); } else { if (c->joinrate1 != ci->mlock_joinrate1 || c->joinrate2 != ci->mlock_joinrate2 @@ -674,7 +677,7 @@ switch (mode) { case 'j': - ci->mlock_joindelay = 0; + ci->mlock_joinrate1 = ci->mlock_joinrate2 = -1; break; } /* switch (mode) */ diff -uNr ircservices-5.0.33/version.sh ircservices-5.0.34/version.sh --- ircservices-5.0.33/version.sh 2004-06-30 18:29:43 +0900 +++ ircservices-5.0.34/version.sh 2004-07-05 23:52:23 +0900 @@ -6,7 +6,7 @@ # $PROGRAM is the string returned as the first part of a /VERSION reply, # and must not contain spaces. It is not used anywhere else. PROGRAM=ircservices -VERSION=5.0.33 +VERSION=5.0.34 # Increment Services build number if [ -f version.c ] ; then