diff -uNr ircservices-5.0.55/Changes ircservices-5.0.56/Changes --- ircservices-5.0.55/Changes 2005-09-26 12:50:33 +0900 +++ ircservices-5.0.56/Changes 2005-11-20 08:18:57 +0900 @@ -1,5 +1,19 @@ Version 5.0 ----------- +2005/11/20 .56 Fixed a bug in StatServ that could cause a crash if + StatServ was unloaded with a rehash while Services + was running. +2005/11/07 Changed NickServ and ChanServ SET PASSWORD to prevent the + use of spaces in passwords. +2005/11/07 The NickServ commands DROP, RECOVER, RELEASE, and GHOST now + report a syntax error rather than "password incorrect" + when too many parameters are given. (As a result, + passwords containing spaces can no longer be used with + these commands. Use IDENTIFY followed by SET PASSWORD + to set a new password without spaces.) +2005/10/26 Fixed incorrect end-of-/WHOIS responses for several + pseudoclients. Reported by Robin Burchell + 2005/09/26 .55 Added documentation on CSSetChannelTime configuration option. 2005/08/25 Fixed rare bug allowing users to gain voice status improperly. Reported by Anton Wolkov diff -uNr ircservices-5.0.55/configure ircservices-5.0.56/configure --- ircservices-5.0.55/configure 2005-02-21 22:07:37 +0900 +++ ircservices-5.0.56/configure 2005-09-26 19:45:52 +0900 @@ -724,7 +724,7 @@ exec 3>configure.log -MODE=" " +MODE=" " TEST="" export MODE TEST @@ -732,7 +732,7 @@ # Check whether we have a working "test FILE_A -nt FILE_B". -MODE="check_test_nt " +MODE="check_test_nt " if [ "$TEST_NT" ] ; then log "cache says $TEST_NT" else @@ -764,7 +764,7 @@ # Search for a compiler. -MODE="find_cc " +MODE="find_cc " # Don't use the cached flags unless we use the cached compiler as well CACHED_CC_FLAGS=$CC_FLAGS CC_FLAGS=bonkle @@ -1043,7 +1043,7 @@ # Test compiler options. -MODE="find_ccopts " +MODE="find_ccopts " if [ "$USER_CC_FLAGS" != bonkle ] ; then CC_FLAGS="$USER_CC_FLAGS" echo "Compiler flags supplied: $CC_FLAGS" @@ -1150,7 +1150,7 @@ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8028 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11151 -MODE="check_gccbuiltin" +MODE="check_gcc_builtin " # Check whether this is actually GCC--if it doesn't understand # __builtin_apply, then probably not. @@ -1212,7 +1212,7 @@ # Set linker flags. -MODE="find_lflags " +MODE="find_lflags " if [ "$USER_CC_LFLAGS" != "bonkle" ] ; then CC_LFLAGS=$USER_CC_LFLAGS log user supplied \`"$CC_LFLAGS'" @@ -1227,7 +1227,7 @@ # Find executable suffix. -MODE="find_exe_suffix " +MODE="find_exe_suffix " if [ "$OPT_OS2" ] ; then log "-os2 option given, using \`.exe'" EXE_SUFFIX=.exe @@ -1255,7 +1255,7 @@ # See what libraries we have that we might need. -MODE="find_libs " +MODE="find_libs " echo2 "Let's see what libraries we need..." if [ "$CC_LIBS" != bonkle ] ; then if [ "$CC_LIBS" ] ; then @@ -1334,7 +1334,7 @@ ########################################################################### -MODE="check_shared " +MODE="check_shared " if [ "$USE_STATIC_MODULES" ] ; then echo "Modules will be compiled statically (-use-static-modules option)." STATIC_MODULES=1 @@ -1504,7 +1504,7 @@ fi # Also check for ranlib, and use it if found. -MODE="check_ranlib " +MODE="check_ranlib " echo2 "Checking whether ranlib exists... " if [ "$RANLIB" ] ; then if [ "x$RANLIB" = xranlib ] ; then @@ -1574,7 +1574,7 @@ # See what sizes various types are. -MODE="check_int16 " +MODE="check_int16 " echo2 "Looking for an 8-bit integer type... " if [ "$TYPE_INT8" ] ; then echo "(cached) $TYPE_INT8" @@ -1634,7 +1634,7 @@ fi fi -MODE="check_int16 " +MODE="check_int16 " echo2 "Looking for a 16-bit integer type... " if [ "$TYPE_INT16" ] ; then echo "(cached) $TYPE_INT16" @@ -1683,7 +1683,7 @@ fi fi -MODE="check_int32 " +MODE="check_int32 " echo2 "Looking for a 32-bit integer type... " if [ "$TYPE_INT32" ] ; then echo "(cached) $TYPE_INT32" @@ -1732,7 +1732,7 @@ fi fi -MODE="check_int_size " +MODE="check_int_size " echo2 "Checking the size of int... " if [ "$SIZEOF_INT" ] ; then echo "(cached) `expr $SIZEOF_INT \* 8` bits" @@ -1774,7 +1774,7 @@ fi fi -MODE="check_long_size " +MODE="check_long_size " echo2 "Checking the size of long... " if [ "$SIZEOF_LONG" ] ; then echo "(cached) `expr $SIZEOF_LONG \* 8` bits" @@ -1816,7 +1816,7 @@ fi fi -MODE="check_time_t " +MODE="check_time_t " echo2 "Checking the size of time_t... " if [ "$SIZEOF_TIME_T" -a "$MAX_TIME_T" ] ; then echo "(cached) `expr $SIZEOF_TIME_T \* 8` bits" @@ -1873,7 +1873,7 @@ fi fi -MODE="check_gid_t " +MODE="check_gid_t " echo2 "Checking the size of gid_t... " if [ "$SIZEOF_GID_T" != bonkle ] ; then if [ "$SIZEOF_GID_T" ] ; then @@ -1922,7 +1922,7 @@ fi fi -MODE="check_socklen_t " +MODE="check_socklen_t " echo2 "Checking for socklen_t... " if [ "$HAVE_SOCKLEN_T" ] ; then if [ $HAVE_SOCKLEN_T = 1 ] ; then @@ -1957,7 +1957,7 @@ # Look for include files that might or might not be here. echo "Checking for presence of include files (it's okay if some aren't there):" -MODE="check_strings " +MODE="check_strings " echo2 " strings.h... " if [ "$HAVE_STRINGS_H" ] ; then if [ "$HAVE_STRINGS_H" = 1 ] ; then @@ -1975,7 +1975,7 @@ fi fi -MODE="check_sysselect " +MODE="check_sysselect " echo2 " sys/select.h... " if [ "$HAVE_SYS_SELECT_H" ] ; then if [ "$HAVE_SYS_SELECT_H" = 1 ] ; then @@ -1993,7 +1993,7 @@ fi fi -MODE="check_sysproto " +MODE="check_sysproto " echo2 " sys/sysproto.h... " if [ "$HAVE_SYS_SYSPROTO_H" ] ; then if [ "$HAVE_SYS_SYSPROTO_H" = 1 ] ; then @@ -2015,7 +2015,7 @@ # AIX workaround. -MODE="check_aix_intNN " +MODE="check_aix_intNN " echo2 "Seeing if your system defines int16/int32... " res="`run egrep int16\|int32 /usr/include/sys/systypes.h`" if [ "$res" ] ; then @@ -2034,7 +2034,7 @@ # Look for missing/broken built-in routines, and similar compatibility # stuff. -MODE="check_strerror " +MODE="check_strerror " if [ "$USE_LOCAL_FUNCS" ] ; then log "not checking (-use-local-funcs)" echo "Not checking for presence of strerror (-use-local-funcs specified)." @@ -2090,7 +2090,7 @@ fi # -use-local-funcs -MODE="check_compat " +MODE="check_compat " if [ "$USE_LOCAL_FUNCS" ] ; then echo "Enabling compatibility functions: hstrerror snprintf strtok str[n]icmp strdup str[c]spn strsignal" @@ -2125,14 +2125,14 @@ MISSING= - MODE="check_hstrerror " + MODE="check_hstrerror " TEST="(void) hstrerror(1); return 0;" if test_function "const char *" hstrerror "(int)" ; then : ; else MISSING="$MISSING hstrerror" echo2 "hstrerror " fi - MODE="check_snprintf " + MODE="check_snprintf " TEST=' char buf[16]; int res; buf[0] = 0; @@ -2168,7 +2168,7 @@ # Common failings with strtok() implementations: # - strtok(NULL, ...) crashes after a NULL is returned # - strtok(NULL, " ") returns NULL but strtok(NULL, "") doesn't - MODE="check_strtok " + MODE="check_strtok " TEST=' char buf1[1]; char buf2[] = "1 2 3"; char buf3[] = "4 5 6"; @@ -2204,7 +2204,7 @@ # it's really a case-INsensitive compare. If this system doesn't # have stricmp() but does have strcasecmp(), we use a #define in # defs.h to rename the latter to the former. - MODE="check_stricmp " + MODE="check_stricmp " TEST='extern int strnicmp(const char *, const char *, int); return stricmp("ABC","abc")==0 && strnicmp("ABC","abd",2)==0 ? 0 : 1;' if test_function int stricmp "(const char *, const char *)" ; then HAVE_STRCASECMP=0 # doesn't really matter @@ -2216,7 +2216,7 @@ fi fi - MODE="check_strdup " + MODE="check_strdup " TEST=' char *s, *t; s = "ABC"; t = strdup(s);'" @@ -2226,7 +2226,7 @@ echo2 "strdup " fi - MODE="check_strspn " + MODE="check_strspn " TEST=' extern int strcspn(const char *, const char *); return (strspn("ABCBA","BA")==2 && strspn("123","123")==3 && strcspn("ABCBA","C")==2 && strcspn("123","4")==3) ? 0 : 1;' @@ -2235,7 +2235,7 @@ echo2 "str[c]spn " fi - MODE="check_strsignal " + MODE="check_strsignal " TEST="(void) strsignal(1); return 0;" if test_function "char *" strsignal "(int)" ; then : ; else MISSING="$MISSING strsignal" @@ -2244,14 +2244,14 @@ fi # -use-local-funcs - MODE="check_gettimeofday" + MODE="check_gettimeofday " TEST="char buf[256]; (void) gettimeofday((void *)buf, (void *)buf); return 0;" if test_function "char *" gettimeofday "(void *, void *)" ; then : ; else MISSING="$MISSING gettimeofday" echo2 "gettimeofday " fi - MODE="check_setgrent " + MODE="check_setgrent " if [ "$SIZEOF_GID_T" ] ; then TEST="(void) setgrent(); return 0;" if test_function int setgrent "(void)" ; then : ; else @@ -2263,7 +2263,7 @@ HAVE_SETGRENT=0 fi - MODE="check_setregid " + MODE="check_setregid " if [ "$SIZEOF_GID_T" ] ; then TEST="(void) setregid(-1,-1); return 0;" if test_function int setregid "(int,int)" ; then : ; else @@ -2275,14 +2275,14 @@ HAVE_SETREGID=0 fi - MODE="check_umask " + MODE="check_umask " TEST="(void) umask(1); return 0;" if test_function int umask "(int)" ; then : ; else MISSING="$MISSING umask" echo2 "umask " fi - MODE="check_fork " + MODE="check_fork " TEST="(void) fork(); return 0;" if test_function int fork "(void)" ; then : ; else MISSING="$MISSING fork" @@ -2333,7 +2333,7 @@ ########################################################################### -MODE="check_install " +MODE="check_install " echo2 "Checking how to install files... " if [ "$INSTALL" -a "$OLD_RUNGROUP" = "$RUNGROUP" ] ; then @@ -2380,7 +2380,7 @@ ########################################################################### -MODE="check_install-d " +MODE="check_install-d " if [ "$INSTALL" = '$(TOPDIR)/install-script' ] ; then MKDIR='$(INSTALL) -d' @@ -2411,7 +2411,7 @@ ########################################################################### -MODE="check_copy_recur" +MODE="check_copy_recurse " echo2 "Checking how to copy directories... " if [ "$CP_ALL" ] ; then diff -uNr ircservices-5.0.55/docs/6.html ircservices-5.0.56/docs/6.html --- ircservices-5.0.55/docs/6.html 2005-08-23 14:11:06 +0900 +++ ircservices-5.0.56/docs/6.html 2005-10-21 00:23:23 +0900 @@ -1744,7 +1744,7 @@ LIST_FOREACH, LIST_FOREACH_SAFE, and ARRAY_FOREACH, are preceded by a space. Parentheses following function or macro calls (other than the above) are not - preceded by a space. Examples: + preceded by a space. Example:
if (flag)
    function();
@@ -1754,7 +1754,7 @@ themselves parameters to a function or macro, or when including them would make the line exceed 79 columns in length. Spaces are also placed after (but not before) the semicolons in a for - statement. Spaces are not placed after the opening parenthesis or + statement. Spaces are not placed after the opening parenthesis or before the closing parenthesis of a function/macro call or control statement. Examples:
@@ -1762,14 +1762,13 @@
function(param1, strchr(string,'/'), param3);
for (i = 0; i < count; i++) . . .
-

  • Opening braces of blocks go on the same line as the control - statement (if, for, etc.) associated with the - block; "naked blocks" (those not associated with any control - statement) have the opening brace alone on a line, indented to the - same level as the surrounding code. As an exception, the opening - brace for a function is placed alone on the next line, without - indentation. Closing braces are indented to the same level as the - line containing the opening brace. Examples: +

  • Opening braces of control statement blocks go on the same line as + the control statement (if, for, etc.) associated + with the block; function blocks and "naked blocks" (those not + associated with any control statement or function) have the opening + brace alone on a line, indented to the same level as the + surrounding code. Closing braces are indented to the same level as + the line containing the opening brace. Examples:
    if (flag) {
        /* indented code goes here */ @@ -1780,6 +1779,11 @@
    {
        /* indented code goes here */
        
    . . . +
        /* start of a naked block */ +
        { +
            int foo; +
            
    . . . +
        }
    }

  • If an if statement is longer than one line, it should @@ -1809,7 +1813,7 @@
        . . .
    }

    -
    for (exception = first_maskdata(MD_EXCEPTION); exception; +
    for (exception = first_maskdata(MD_EXCEPTION); exception != NULL;
         exception = next_maskdata(MD_EXCEPTION)
    ) {
        
    . . . @@ -1949,7 +1953,7 @@

  • Preprocessor constants and macros should use all upper-case letters, with an underscore between distinct words in the name. -

  • Local variables and structure names should use all lower-case +

  • Structure names and local variables should use all lower-case letters, with an underscore between distinct words in the name.

  • Structure names for structures with an associated type name diff -uNr ircservices-5.0.55/modules/chanserv/main.c ircservices-5.0.56/modules/chanserv/main.c --- ircservices-5.0.55/modules/chanserv/main.c 2005-09-26 12:55:53 +0900 +++ ircservices-5.0.56/modules/chanserv/main.c 2005-11-20 08:26:57 +0900 @@ -261,7 +261,7 @@ ServiceUser, ServiceHost, desc_ChanServ); send_cmd(ServerName, "312 %s %s %s :%s", source, who, ServerName, ServerDesc); - send_cmd(ServerName, "318 End of /WHOIS response."); + send_cmd(ServerName, "318 %s %s End of /WHOIS response.", source, who); return 1; } diff -uNr ircservices-5.0.55/modules/chanserv/set.c ircservices-5.0.56/modules/chanserv/set.c --- ircservices-5.0.55/modules/chanserv/set.c 2005-09-26 12:55:53 +0900 +++ ircservices-5.0.56/modules/chanserv/set.c 2005-11-20 08:26:57 +0900 @@ -67,8 +67,8 @@ } if (cmd) { - if (stricmp(cmd, "PASSWORD") == 0 || stricmp(cmd, "DESC") == 0 - || stricmp(cmd, "TOPIC") == 0 || stricmp(cmd, "ENTRYMSG") == 0) + if (stricmp(cmd, "DESC") == 0 || stricmp(cmd, "TOPIC") == 0 + || stricmp(cmd, "ENTRYMSG") == 0) param = strtok_remaining(); else param = strtok(NULL, " "); diff -uNr ircservices-5.0.55/modules/memoserv/main.c ircservices-5.0.56/modules/memoserv/main.c --- ircservices-5.0.55/modules/memoserv/main.c 2005-09-26 12:55:54 +0900 +++ ircservices-5.0.56/modules/memoserv/main.c 2005-11-20 08:26:57 +0900 @@ -169,7 +169,7 @@ ServiceUser, ServiceHost, desc_MemoServ); send_cmd(ServerName, "312 %s %s %s :%s", source, who, ServerName, ServerDesc); - send_cmd(ServerName, "318 End of /WHOIS response."); + send_cmd(ServerName, "318 %s %s End of /WHOIS response.", source, who); return 1; } diff -uNr ircservices-5.0.55/modules/misc/devnull.c ircservices-5.0.56/modules/misc/devnull.c --- ircservices-5.0.55/modules/misc/devnull.c 2005-09-26 12:55:54 +0900 +++ ircservices-5.0.56/modules/misc/devnull.c 2005-11-20 08:26:57 +0900 @@ -56,7 +56,7 @@ ServiceUser, ServiceHost, desc_DevNull); send_cmd(ServerName, "312 %s %s %s :%s", source, who, ServerName, ServerDesc); - send_cmd(ServerName, "318 End of /WHOIS response."); + send_cmd(ServerName, "318 %s %s End of /WHOIS response.", source, who); return 1; } else { return 0; diff -uNr ircservices-5.0.55/modules/misc/helpserv.c ircservices-5.0.56/modules/misc/helpserv.c --- ircservices-5.0.55/modules/misc/helpserv.c 2005-09-26 12:55:54 +0900 +++ ircservices-5.0.56/modules/misc/helpserv.c 2005-11-20 08:26:57 +0900 @@ -138,15 +138,16 @@ static int do_whois(const char *source, char *who, char *extra) { - if (irc_stricmp(who, s_HelpServ) == 0) + if (irc_stricmp(who, s_HelpServ) == 0) { send_cmd(ServerName, "311 %s %s %s %s * :%s", source, who, ServiceUser, ServiceHost, desc_HelpServ); - else + send_cmd(ServerName, "312 %s %s %s :%s", source, who, + ServerName, ServerDesc); + send_cmd(ServerName, "318 %s %s End of /WHOIS response.", source, who); + return 1; + } else { return 0; - send_cmd(ServerName, "312 %s %s %s :%s", source, who, - ServerName, ServerDesc); - send_cmd(ServerName, "318 End of /WHOIS response."); - return 1; + } } /*************************************************************************/ diff -uNr ircservices-5.0.55/modules/nickserv/main.c ircservices-5.0.56/modules/nickserv/main.c --- ircservices-5.0.55/modules/nickserv/main.c 2005-09-26 12:55:54 +0900 +++ ircservices-5.0.56/modules/nickserv/main.c 2005-11-20 08:26:57 +0900 @@ -651,7 +651,7 @@ static void do_drop(User *u) { - char *pass = strtok_remaining(); + char *pass = strtok(NULL, " "); NickInfo *ni = u->ni; NickGroupInfo *ngi = (u->ngi==NICKGROUPINFO_INVALID ? NULL : u->ngi); @@ -660,7 +660,7 @@ return; } - if (!pass) { + if (!pass || strtok_remaining()) { syntax_error(s_NickServ, u, "DROP", NICK_DROP_SYNTAX); if (find_module("nickserv/link") || find_module("nickserv/oldlink")) notice_lang(s_NickServ, u, NICK_DROP_WARNING); @@ -1251,11 +1251,11 @@ static void do_recover(User *u) { char *nick = strtok(NULL, " "); - char *pass = strtok_remaining(); + char *pass = strtok(NULL, " "); NickInfo *ni; User *u2; - if (!nick) { + if (!nick || strtok_remaining()) { syntax_error(s_NickServ, u, "RECOVER", NICK_RECOVER_SYNTAX); } else if (!(u2 = get_user(nick))) { notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick); @@ -1285,10 +1285,10 @@ static void do_release(User *u) { char *nick = strtok(NULL, " "); - char *pass = strtok_remaining(); + char *pass = strtok(NULL, " "); NickInfo *ni; - if (!nick) { + if (!nick || strtok_remaining()) { syntax_error(s_NickServ, u, "RELEASE", NICK_RELEASE_SYNTAX); } else if (!(ni = get_nickinfo(nick))) { notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); @@ -1314,11 +1314,11 @@ static void do_ghost(User *u) { char *nick = strtok(NULL, " "); - char *pass = strtok_remaining(); + char *pass = strtok(NULL, " "); NickInfo *ni; User *u2; - if (!nick) { + if (!nick || strtok_remaining()) { syntax_error(s_NickServ, u, "GHOST", NICK_GHOST_SYNTAX); } else if (!(u2 = get_user(nick))) { notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick); diff -uNr ircservices-5.0.55/modules/nickserv/set.c ircservices-5.0.56/modules/nickserv/set.c --- ircservices-5.0.55/modules/nickserv/set.c 2005-09-26 12:55:54 +0900 +++ ircservices-5.0.56/modules/nickserv/set.c 2005-11-20 08:26:58 +0900 @@ -64,7 +64,7 @@ } else { ni = u->ni; } - if (cmd && stricmp(cmd, "PASSWORD") != 0 && stricmp(cmd, "INFO") != 0) { + if (cmd && stricmp(cmd, "INFO") != 0) { param = strtok(param, " "); extra = strtok(NULL, " "); } diff -uNr ircservices-5.0.55/modules/statserv/main.c ircservices-5.0.56/modules/statserv/main.c --- ircservices-5.0.55/modules/statserv/main.c 2005-09-26 12:55:55 +0900 +++ ircservices-5.0.56/modules/statserv/main.c 2005-11-20 08:26:58 +0900 @@ -656,7 +656,7 @@ if (module_nickserv) do_unload_module(module_nickserv); - remove_callback(NULL, "save data", sync_statserv_db); + remove_callback(NULL, "save data", do_save_data); remove_callback(NULL, "user MODE", stats_do_umode); remove_callback(NULL, "user delete", stats_do_quit); remove_callback(NULL, "user create", stats_do_newuser); diff -uNr ircservices-5.0.55/version.sh ircservices-5.0.56/version.sh --- ircservices-5.0.55/version.sh 2005-08-25 15:00:53 +0900 +++ ircservices-5.0.56/version.sh 2005-11-20 08:20:30 +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.55 +VERSION=5.0.56 # Increment Services build number if [ -f version.c ] ; then