Michael Poole [Mon, 15 Feb 2010 20:28:59 +0000 (15:28 -0500)]
Bug fix round-up for SF#
2885593, SF#
2924219 and SF#
2946094.
Thanks to ZeRoFiGhter for finding and analyzing these.
src/chanserv.c (cmd_move): Scan all users' presence in the new channel.
(merge_users): Use the newer "seen" time when merging. Scan source
users' presence in the new channel.
(cmd_mdel_user): "actor" already considers whether the user is helping,
so use that information.
(handle_join): Allow queuing dynlimit updates during burst.
src/mod-helpserv.c (handle_join): Fix request list indexing.
src/proto-p10.c (irc_kill): Don't insert self in the kill path; our
uplink does that (at least for ircu2.10.12.x).
Michael Poole [Fri, 8 Jan 2010 03:01:26 +0000 (22:01 -0500)]
Fix the time we set of SO_REUSEADDR for listening sockets.
src/ioset.c (ioset_listen): Linux -- reasonably -- requires that
SO_REUSEADDR be set on a socket before binding it to an in-use socket.
So do that.
Michael Poole [Thu, 7 Jan 2010 02:33:21 +0000 (21:33 -0500)]
Send oplevels correctly during a burst.
src/hash.c (AddChannelUser): Initialize oplevel to the maximum, not -1.
src/proto-p10.c (parse_oplevel): Move up for easier inlining.
(modeNode_sort): New function.
(irc_burst): Use it to sort the membership list for channels so the
members' oplevels can be sent correctly.
(cmd_burst): Simplify the handling of oplevels.
(mod_chanmode_parse): Only change the member's oplevel when opping or
deopping -- otherwise +v would set it to MAXOPLEVEL!
Michael Poole [Thu, 7 Jan 2010 02:28:45 +0000 (21:28 -0500)]
Fix the build with gcc 4.4 and newer versions of libtool.
configure.in: Update AC_PREREQ to autoconf 2.64. Use LT_INIT instead
of AC_PROG_LIBTOOL. Remove the deprecated AC_TYPE_SIGNAL (which we
didn't use anyway). Fix the indentation of the explanatory text for
--without-kevent and --with-win32.
src/sar.c: Convert "struct sockaddr_storage" to "void *" to comply
with C99's strict(er) aliasing rules. Allocate off the stack or
heap, as appropriate. Add new function sar_free_nameserver() to
clean up the heap-allocated data.
Michael Poole [Wed, 23 Sep 2009 15:26:33 +0000 (11:26 -0400)]
Fix input and output bugs in P10 IPv6 addresses with zero elements.
src/proto-p10.c (irc_p10_pton): Avoid writing past the end of ip->in6.
(irc_p10_ntop): Avoid writing past the end of output.
Michael Poole [Mon, 21 Sep 2009 02:05:56 +0000 (22:05 -0400)]
Fix typo when parsing channel mode changes for +A, from SF bug #
2787760.
src/proto-p10.c (mod_chanmode_parse): Use new_apass rather than new_upass
when parsing mode +A changes.
Michael Poole [Mon, 21 Sep 2009 01:58:09 +0000 (21:58 -0400)]
Remove the duplicated message ID reported in SF bug #
2686643.
src/chanserv.c (CSMSG_USER_PROTECTED): Rename the second one of these to
CSMSG_USER_PROTECTED_2.
(handle_kick): Use that version.
Michael Poole [Mon, 21 Sep 2009 01:54:33 +0000 (21:54 -0400)]
Fix the account stamp parsing error reported in SF bug #
2672922.
src/proto-p10.c (mod_usermode): Update "word" to skip past account stamps.
Michael Poole [Mon, 21 Sep 2009 01:49:13 +0000 (21:49 -0400)]
Fix the problems reported in SF bug #
2668866.
src/mod-memoserv.c (KEY_ACCOUNTS, KEY_MESSAGES, KEY_FLAGS): Define new
database key names.
(MSMSG_CANNOT_SEND_SELF): Define new translation string.
(MSMSG_NEW_MESSAGE): Add format field for the message ID.
(memoserv_can_send): Do not allow sending to oneself. Require that the
common channel be one that the target has joined at some point.
(cmd_send): Use the new field in MSMSG_NEW_MESSAGE.
(cmd_read): Initialize the time_t that is shown.
(memoserv_saxdb_read_messages): Renamed from memoserv_saxdb_read().
(memoserv_saxdb_read_accounts): New function.
(memoserv_saxdb_read): Check for the "accounts" subkey. If it exists,
read the account data from that key.
(memoserv_saxdb_write): Write account flags in a new section. Use hex
rather than base64 for the memo IDs.
Michael Poole [Mon, 21 Sep 2009 00:45:08 +0000 (20:45 -0400)]
Fix database failure reporting before the config file is first read.
src/recdb.c (explain_failure): When MAIN_LOG is NULL, report to stderr.
Michael Poole [Thu, 17 Sep 2009 21:02:57 +0000 (17:02 -0400)]
Fix clearing "helping" flag from users when parting other channels.
src/chanserv.c (handle_part): Allow the current user to be considered for
channels other than the channel being /part'ed.
Michael Poole [Thu, 17 Sep 2009 20:45:49 +0000 (16:45 -0400)]
Add a new irc_user_modes() helper function and irc_user_mode_chars[] array.
src/proto.h (irc_user_modes): Declare.
(irc_user_mode_chars): Likewise.
src/proto-common.c (irc_user_modes): Define.
src/proto-bahamut.c (irc_user_mode_chars): Define.
(irc_user): Use irc_user_mode_chars() instead of open-coding it.
src/proto-p10.c (irc_user_mode_chars): Define.
(irc_user): Use irc_user_mode_chars() instead of open-coding it.
src/opserv.c (cmd_whois): Use irc_user_mode_chars() here too.
src/modcmd.c (modcmd_saxdb_write): Write bot modes to the database.
(modcmd_load_bots): Read them out and use them.
Michael Poole [Thu, 17 Sep 2009 20:41:32 +0000 (16:41 -0400)]
src/saxdb.c (saxdb_start_record): Do not include a space just before EOL.
src/opserv.help (INVITE): Document this command.
Michael Poole [Thu, 17 Sep 2009 21:04:56 +0000 (17:04 -0400)]
Replace the thoroughly outdated NEWS file with the UPGRADE contents.
Michael Poole [Tue, 11 Aug 2009 03:56:03 +0000 (23:56 -0400)]
Make the kqueue ioset back-end less whiny.
src/ioset-kevent.c (ioset_kevent_add): Never try to use EV_DELETE, because
that can make kevent() return -1/ENOENT.
(ioset_kevent_update): We need to try to EV_DELETE here instead.
(ioset_kevent_loop): Do not bail if kevent() just returns -1/EINTR.
Michael Poole [Tue, 11 Aug 2009 03:53:19 +0000 (23:53 -0400)]
Fix mod-blacklist (really, all of SAR) not working on BSDs.
Fixes SF bug #
2817939, reported by sky5.
src/sar.c (ipv4_pton): Set the sockaddr length field when it exists.
(ipv6_pton): Likewise.
Michael Poole [Tue, 11 Aug 2009 03:51:28 +0000 (23:51 -0400)]
Mark the current code as rc3, and distribute mod-blacklist.c.
configure.in (AC_INIT): Bump release number to rc3.
(HAVE_SOCKADDR_SA_LEN): Define to a non-empty value (specifically, 1).
(HAVE_STRUCT_ADDRINFO): Likewise.
src/Makefile.am (EXTRA_srvx_SOURCES): Include mod-blacklist.c.
Michael Poole [Fri, 6 Mar 2009 13:04:13 +0000 (08:04 -0500)]
Report the number of memos, not recipients, in /msg MemoServ status.
Another bug spotted by ZeRoFiGhter.
src/mod-memoserv.c (memoCount): New variable.
(delete_memo): Decrement it.
(add_memo): Increment it.
(cmd_status): Report it.
Michael Poole [Fri, 6 Mar 2009 12:40:01 +0000 (07:40 -0500)]
Avoid crashing when a user is killed by an on-auth callback.
src/nickserv.c (set_user_handle_info): Handle no users on the account when
updating the linked list of authed users. Do not run the last bit of
code when an auth_func kills the user, either.
Michael Poole [Fri, 6 Mar 2009 12:28:57 +0000 (07:28 -0500)]
Update users' "present" and "seen" fields when unsuspending a channel.
Bug reported by ZeRoFiGhter.
src/chanserv.c (chanserv_expire_suspension): Add some comments. Add a loop
to update presence information for anyone in the channel at the time
the channel is unsuspended.
Michael Poole [Fri, 6 Mar 2009 12:17:20 +0000 (07:17 -0500)]
Fix warnings about shadowed variables, and use -Wshadow in maintainer mode.
Inspired by a bug in modmcd.c's check_alias_args() spotted by the eagle
eyes of gix.
(I will omit list the function-by-function change log -- most of it is very
mechanical, and involves renaming paramaters and local variables that used
to shadow standard Unix functions.)
Michael Poole [Fri, 6 Mar 2009 11:37:07 +0000 (06:37 -0500)]
Allow "edittrust" to accept 0 as a maximum count, and document it.
Inconsistency between "addtrust" and "edittrust" reported by ZeRoFiGhter.
src/opserv.c (cmd_edittrust): Only check that argv[2] is fully parsed as
a number; do not require it to be non-zero.
src/opserv.help: Add entry for "edittrust" and reference it appropriately.
Michael Poole [Fri, 6 Mar 2009 11:31:00 +0000 (06:31 -0500)]
Use "account" rather than "handle" in help text.
Inconsistency reported by ZeRoFiGhter - thanks!
src/mod-helpserv.help (SET NOTIFICATION): Use "account" rather than "handle".
Michael Poole [Thu, 5 Mar 2009 05:12:50 +0000 (00:12 -0500)]
Nuke autogen.sh. "autoreconf -Wall" is recommended instead.
ThiefMaster [Mon, 29 Sep 2008 10:21:56 +0000 (12:21 +0200)]
Forward messages sent to helpserv after pickup to the helper.
ThiefMaster [Fri, 27 Jun 2008 20:07:56 +0000 (22:07 +0200)]
Display the number of total unhandled + total requests in helpserv whine about unhandled requests waiting.
ThiefMaster [Fri, 27 Jun 2008 20:04:52 +0000 (22:04 +0200)]
Add outrank check to chanserv.myaccess
ThiefMaster [Fri, 4 Jul 2008 05:59:58 +0000 (07:59 +0200)]
Remove double reply in checkemail if nick/account is invalid.
Michael Poole [Thu, 5 Mar 2009 04:28:58 +0000 (23:28 -0500)]
Check account-based alerts for all users, not just staff.
src/opserv.c (opserv_staff_alert): Remove calls to alert_check_user.
(opserv_auth_alert): New function to replace that check.
(init_opserv): Register opserv_auth_alert().
Michael Poole [Thu, 5 Mar 2009 04:16:51 +0000 (23:16 -0500)]
Fix handling of multiple users on a +h account in the support channel(s).
Do not remove +g from a +h account when one of several users on the
account leave a support channel, which gix reported in SF#
2649505.
src/chanserv.c (handle_part): Keep the +g flag if any user on the same
account is in any support channel.
src/nickserv.c (nickserv_apply_flags): Likewise here, for flag changes.
Michael Poole [Thu, 5 Mar 2009 03:57:20 +0000 (22:57 -0500)]
Do not allow keys (of any sort) to start with ':', fixing SF#
2579872.
src/proto-p10.c (keyncpy): New function, like strlcpy() but for keys.
(mod_chanmode_parse): Use it instead of safestrncpy().
Michael Poole [Thu, 5 Mar 2009 03:44:43 +0000 (22:44 -0500)]
Remove help file reference to no-longer-existent command.
src/chanserv.help (EVENTS): Do not reference "last" command.
Michael Poole [Thu, 5 Mar 2009 03:42:39 +0000 (22:42 -0500)]
Remove double free in opserv_add_bad_word(), fixing SF#
2579877.
src/opserv.c (opserv_add_bad_word): Remove extra free(orig_bad).
Michael Poole [Sat, 3 Jan 2009 20:37:28 +0000 (15:37 -0500)]
Add a comment on why topic change handlers return int.
src/hash.c (SetChannelTopic): Add the comment.
Michael Poole [Sat, 3 Jan 2009 20:35:45 +0000 (15:35 -0500)]
Convert new_user_func_t to return void.
This way, a function only has to worry about killing a user or not, rather
than doing that and then returning a corresponding value.
src/hash.h (new_user_func_t): Return void instead of int.
src/global.c (global_process_user): Likewise.
src/mod-blacklist.c (blacklist_check_user): Likewise.
src/mod-snoop.c (snoop_new_user): Likewise.
src/mod-sockcheck.c (sockcheck_new_user): Likewise.
src/nickserv.c (check_user_nick): Likewise.
(handle_new_user): Delete.
(init_nickserv): Register check_user_nick() directly.
src/opserv.c (opserv_new_user_check): Likewise.
src/proto-bahamut.c (AddUser): Do not check new_user_func return values.
src/proto-p10.c (AddUser): Likewise.
Michael Poole [Sat, 3 Jan 2009 20:12:04 +0000 (15:12 -0500)]
Automatically stop most user-oriented hooks if the user becomes dead.
src/hash.c (NickChange): Stop iterating if the user is killed by any hook.
(AddChannelUser): Likewise.
src/nickserv.c (set_user_handle_info): Likewise.
src/proto-common.c (of_list, of_size, of_used, reg_oper_func,
call_oper_funcs): Move from the proto-*.c files. Make call_oper_funcs
stop iterating if the user is killed by any hook.
src/proto-bahahmut.c (AddUser): Likewise.
(of_list, of_size, of_used, reg_oper_func, call_oper_funcs): Move to
proto-common.c
src/proto-p10.c: Likewise to proto-bahamut.c.
Michael Poole [Sat, 3 Jan 2009 19:56:39 +0000 (14:56 -0500)]
Fix compilation with gcc 4.3 and glibc 2.8.90.
src/mod-helpserv.c (create_request): Use explicit format strings for
sprintf() when no format argument is passed.
src/modcmd.c: Store the result of strtoul() into a variable.
src/nickserv.c: Pay attention to the return value of fgets().
Michael Poole [Wed, 30 Jul 2008 23:50:27 +0000 (19:50 -0400)]
Update "now" in kevent ioset back-end.
src/ioset-kevent.c (ioset_kevent_loop): Update now after kevent() returns.
Michael Poole [Wed, 30 Jul 2008 23:49:47 +0000 (19:49 -0400)]
Bail out of !opchan if someone has made ChanServ part from the channel.
src/chanserv.c (CSMSG_OUT_OF_CHANNEL): New error string.
(cmd_opchan): Use it if ChanServ wasn't in the channel for some reason.
Michael Poole [Wed, 23 Jul 2008 01:57:51 +0000 (21:57 -0400)]
Fix other copyright years.
src/alloc-slab.c: Include 2007 in list of copyright years.
src/modcmd.c: Include 2008.
src/nickserv.c: Add 2007 and 2008.
src/proto-p10.c: Likewise.
src/saxdb.c: Likewise.
Michael Poole [Wed, 23 Jul 2008 01:57:00 +0000 (21:57 -0400)]
src/chanserv.c: Fix copyright years and !uset autoinvite behavior.
Michael Poole [Wed, 23 Jul 2008 01:39:09 +0000 (21:39 -0400)]
Include mod-qserver and mod-snoop help files in distribution.
src/Makefile.am (noinst_DATA): Add mod-qserver.help and mod-snoop.help
(EXTRA_srvx_SOURCES): Alphabetize mod-*.c.
Michael Poole [Wed, 23 Jul 2008 01:38:24 +0000 (21:38 -0400)]
Document smtp mail back end even for autoconf builds.
configure.in: List "smtp" as a mail mechanism.
srvx.conf.example: Show the configuration options associated with it.
Michael Poole [Fri, 11 Jul 2008 12:09:29 +0000 (08:09 -0400)]
Simplify README and update it to mention the FAQ file.
Michael Poole [Fri, 11 Jul 2008 12:05:25 +0000 (08:05 -0400)]
Correctly handle a writable->unwritable transition on a socket in kevent.
src/ioset-kevent.c (ioset_kevent_add): If the socket is not writable, we
should EV_DELETE the write notification rather than leaving it.
Michael Poole [Fri, 11 Jul 2008 11:17:53 +0000 (07:17 -0400)]
Update UPGRADE file for srvx-1.4.
Michael Poole [Fri, 11 Jul 2008 02:04:41 +0000 (22:04 -0400)]
Allow NickServ to ignore accounts if the user's account create ts is wrong.
src/nickserv.c (KEY_HANDLE_TS_MODE): Define.
(enum handle_ts_mode): Define.
(nickserv_conf): Add handle_ts_mode field.
(nickserv_conf_read): Set it.
(handle_account): Use it.
srvx.conf.example: Document it.
Michael Poole [Wed, 9 Jul 2008 03:01:19 +0000 (23:01 -0400)]
Support sending and receiving account timestamps (but ignore them for now).
src/hash.h (account_func_t): Add timestamp and serial ID fields.
(call_account_func): Likewise.
(StampUser): Likewise.
src/hash.c (call_account_func): Pass them through to account_func.
(StampUser): Pass them through to irc_account.
src/nickserv.h (handle_info::id): Make this field unconditional.
src/nickserv.c (register_handle): Make the ID assignment unconditional.
(free_handle_info): Make the ID handling here unconditional.
(set_user_handle_info): Pass all the ID fields to StampUser().
(cmd_handleinfo): Move NSMSG_HANDLEINFO_ID to be staff only.
(nickserv_saxdb_write): Make the ID assertion and write unconditional.
(nickserv_db_read_handle): Remove redundant "int".
(handle_account): Use account name preferentially, fall back to ID.
src/proto.h (irc_account): Add timestamp and serial number parameters.
src/proto-bahamut.c (AddUser): Make stamp parameter unsigned long. Pass
it appropriately to call_account_func().
(irc_account): Add timestamp and serial number parameters; use serial
number in place of a base64-decoded stamp.
src/proto-p10.c (irc_account): Send timestamp and serial number for user.
(cmd_account): Parse them when they are present.
(mod_usermode): Likewise.
Michael Poole [Tue, 8 Jul 2008 02:16:16 +0000 (22:16 -0400)]
Properly handle collisions during burst with persistent local clients.
src/proto-p10.c (AddUser): Reorganize if/then/else chain to update a
persistent client's timestamp if there is a collision during burst,
but not to re-introduce the user immediately.
Michael Poole [Tue, 8 Jul 2008 01:56:35 +0000 (21:56 -0400)]
Avoid crash when logging a HelpServ request with no request log file.
src/mod-helpserv.c (helpserv_log_request): Check reqlog_f before using it.
Michael Poole [Mon, 7 Jul 2008 12:11:46 +0000 (08:11 -0400)]
Update version tag for 1.4.0-rc2.
Michael Poole [Sat, 5 Jul 2008 12:14:04 +0000 (08:14 -0400)]
Fix SourceForge bug #
1529487.
src/chanserv.c (CSMSG_LOW_CHANNEL_ACCESS): Be more specific.
(user_opt_autoinvite): Tell the user if his access is too low for the
option to have an effect.
Michael Poole [Sat, 5 Jul 2008 11:51:06 +0000 (07:51 -0400)]
Fix SourceForge bug #864524: Say if too few arguments passed to alias.
src/modcmd.c (svccmd_expand_alias): If the lower bound is past the end of
the argument list, return -1.
(svccmd_invoke_argv): Detect that and report it as needing more params.
Michael Poole [Sat, 5 Jul 2008 11:29:58 +0000 (07:29 -0400)]
src/modcmd.c: Allow certain commands to run if chanserv does not exist.
Michael Poole [Sun, 15 Jun 2008 13:24:02 +0000 (09:24 -0400)]
Avoid crashing in opserv_join_check() without an OpServ.
src/opserv.c (opserv_join_check): Only act on bad channels if we have an
OpServ bot.
Michael Poole [Sun, 15 Jun 2008 13:23:22 +0000 (09:23 -0400)]
Use correct error string for getaddrinfo() and getnameinfo() failures.
src/ioset.c (ioset_connect): Include the error string when getaddrinfo()
fails.
src/mail-smtp.c (smtp_fill_name): Use gai_strerror() rather than strerror().
Michael Poole [Sun, 15 Jun 2008 13:22:11 +0000 (09:22 -0400)]
Delete declaration of undefined timeval_comparator() function.
Michael Poole [Sun, 15 Jun 2008 13:21:53 +0000 (09:21 -0400)]
Add ircstrlower() function.
Michael Poole [Wed, 30 Apr 2008 02:31:36 +0000 (22:31 -0400)]
src/Makefile.am: Fix typo in name of ioset-kevent.c.
Michael Poole [Wed, 30 Apr 2008 02:13:08 +0000 (22:13 -0400)]
Fully fix build on Cygwin.
src/common.h (localtime_r): Do not declare in this file.
src/compat.h (localtime_r): Fix conditional definition of localtime_r().
(EAI_*): Define getaddrinfo()/getnameinfo() error codes if needed.
src/compat.c (getaddrinfo): Return errors by macro.
(getnameinfo): Implement a simple version of this function.
Michael Poole [Wed, 30 Apr 2008 02:05:38 +0000 (22:05 -0400)]
Makefile.win32: Include git-version.o and ioset-select.o in build.
src/config.h.win32: #define HAVE_LOCALTIME 1 to get localtime_r().
Michael Poole [Thu, 24 Apr 2008 11:33:35 +0000 (07:33 -0400)]
src/proto-p10.c: Allow his_server{name,comment} to be updated on rehash.
Michael Poole [Thu, 24 Apr 2008 11:29:24 +0000 (07:29 -0400)]
Update Win32 builds to mostly work under Cygwin.
Makefile.win32: Add -mno-cygwin to LDFLAGS so native Cygwin builds work.
configure.in: Look for stdint.h, localtime() and --with-win32.
src/compat.c: Remove "extern" modifiers on function definitions. Only
implement localtime_r() if we have localtime() too.
src/compat.h: Include stdint.h if we have it; define LINE_MAX if needed.
Also define NI_NUMERICHOST for the benefits of getnameinfo().
src/config.h.win32: Resynchronize with config.h.in; set WITH_IOSET_SELECT
and WITH_PROTOCOL_P10.
Michael Poole [Sun, 30 Mar 2008 04:00:48 +0000 (00:00 -0400)]
Implement our own output buffering inside saxdb.
src/saxdb.c (SAXDB_BUFFER_SIZE): Default to 32 KB if not already defined.
(struct saxdb_context): Add "obuf" member.
(saxdb_flush): Define new helper function.
(saxdb_put_char): Convert to function.
(saxdb_put_nchars): Update to use "obuf" and saxdb_flush().
(saxdb_put_string): Update to use saxdb_put_nchars().
(saxdb_put_qstring): Likewise.
(saxdb_open_context): Allocate space for ctx->obuf.
(saxdb_close_context): Flush the buffer and free ctx->obuf.
Michael Poole [Sun, 30 Mar 2008 02:43:42 +0000 (22:43 -0400)]
Add close_file arg to saxdb_close_context(); allocate all saxdb contexts from heap.
src/saxdb.h (saxdb_close_context): Add "close_file" argument.
src/saxdb.c (saxdb_write_db): Use saxdb_{open,close}_context() rather than
putting it on the stack.
(write_database): Likewise.
(saxdb_close_context): Implement the close_file argument.
src/modcmd.c (cmd_dump_messages): Use the close_file argument.
src/mod-helpserv.c (helpserv_log_request): Likewise.
Michael Poole [Sun, 30 Mar 2008 02:24:45 +0000 (22:24 -0400)]
Make saxdb_context definition private.
src/saxdb.h (struct saxdb_context): Declare, do not define.
(saxdb_jmp_buf): Declare new function.
src/saxdb.c (struct saxdb_context): Define.
(saxdb_write_db): Use saxdb_jmp_buf() instead of ctx.jbuf.
(write_database): Likewise.
(saxdb_jmp_buf): Define.
src/modcmd.c (cmd_dump_messages): Use saxdb_jmp_buf().
src/mod-helpserv.c (helpserv_log_request): Likewise.
Michael Poole [Sun, 30 Mar 2008 02:10:28 +0000 (22:10 -0400)]
src/log.c: Avoid recursive logging.
(Allocator failures can lead to some nasty recursive logging attempts.)
Michael Poole [Tue, 25 Mar 2008 03:22:05 +0000 (23:22 -0400)]
src/proto-p10.c (AddUser): Avoid sending a duplicate irc_user() during bursts.
Michael Poole [Tue, 25 Mar 2008 02:56:18 +0000 (22:56 -0400)]
Implement kqueue()/kevent() ioset backend.
configure.in: Check for <sys/event.h>, kqueue() and kevent(). If kevent()
is present, default to enabling ioset-kevent.
src/Makefile.am: Include ioset-kevent.c as extra source.
src/ioset-kevent.c: New file.
src/ioset.c: Update name for this event backend.
Michael Poole [Mon, 24 Mar 2008 02:34:11 +0000 (22:34 -0400)]
src/mail-sendmail.c: Apparently SIGCHLD needs to be SIG_DFL, not SIG_IGN.
Michael Poole [Mon, 24 Mar 2008 02:33:53 +0000 (22:33 -0400)]
Update gitignore files with in-tree build droppings.
.gitignore: Add additional generated files.
src/.gitignore: Add slab-read binary.
Michael Poole [Sun, 23 Mar 2008 16:04:47 +0000 (12:04 -0400)]
src/ioset-select.c (debug_fdsets): Default to an empty operation.
Michael Poole [Sun, 23 Mar 2008 15:51:21 +0000 (11:51 -0400)]
src/ioset-select.c (ioset_select_remove): Null out fds[] entry on remove.
Michael Poole [Sun, 23 Mar 2008 15:50:47 +0000 (11:50 -0400)]
Check for and use appropriate type of variadic macro arguments.
src/common.h: Define GCC_VARMACROS and C99_VARMACROS where appropriate.
src/chanserv.c (DEFINE_COMMAND):
src/global.c (global_notice): Likewise.
src/helpfile.h (send_channel_message): Likewise.
(send_channel_notice): Likewise.
(send_channel_wallops): Likewise.
src/mod-blacklist.c (blacklist_debug): Likewise.
src/mod-helpserv.c (helpserv_msguser): Likewise.
(helpserv_user_reply): Likewise.
(helpserv_notice): Likewise.
(helpserv_notify): Likewise.
(helpserv_page): Likewise.
(helpserv_get_page_type): New helper function to reduce size of the
expanded code for helpserv_page().
src/mod-snoop.c (SNOOP): Expand appropriately for varmacros type.
src/modcmd.h (reply): Likewise.
src/opserv.c (opserv_debug): Likewise.
(opserv_alert): Likewise.
(opserv_custom_alert): Likewise.
Michael Poole [Sun, 23 Mar 2008 15:25:23 +0000 (11:25 -0400)]
src/mail-sendmail.c (mail_send): Ignore SIGCHLD in the fork()'ed processes.
Michael Poole [Sun, 23 Mar 2008 15:24:55 +0000 (11:24 -0400)]
src/ioset-select.c: Populate and use an fdset for FDs with exceptions.
Michael Poole [Sun, 23 Mar 2008 15:24:05 +0000 (11:24 -0400)]
Clean up some -pedantic warnings about passing non-void-pointers with %p.
src/dict-splay.c (dict_sanity_check_node): Cast struct pointers to void*
when passing them to snprintf().
src/helpfile.c (vsend_message): Likewise for log_module().
src/mod-sockcheck.c (sockcheck_free_client): Likewise.
(sockcheck_print_client): Likewise.
(sockcheck_elaborate_state): Likewise.
(sockcheck_advance): Likewise.
(sockcheck_begin_test): Likewise.
(sockcheck_start_client): Likewise.
src/proto-p10.c (AddUser): Likewise.
src/sar.c (sar_fd_readable): Likewise.
(sar_getaddr_append): Likewise.
Michael Poole [Sun, 23 Mar 2008 15:16:01 +0000 (11:16 -0400)]
Move SIGCHLD definition to compat.h so that other files can use it.
src/compat.h: If SIGCHLD is not defined, define it here.
src/main.c: ... rather than here.
Michael Poole [Thu, 20 Mar 2008 03:46:29 +0000 (23:46 -0400)]
Remove extraneous semicolons from end of macro uses.
src/chanserv.c: Do this for dnrList.
src/log.c: Do it for logList.
src/mail-smtp.c: Do it for mail_queue.
src/mod-helpserv.c: Do it for helpserv_botlist, helpserv_reqlist and
helpserv_userlist, and their sized allocators.
src/mod-memoserv.c: Do it for memoList.
src/modcmd.c: Do it for svccmd_list and module_list.
src/modcmd.h: Remove the extra semicolon at the end of SVCMSG_HOOK()'s definition.
src/nickserv.c: Do it for handle_info_list.
src/saxdb.c: Do it for int_list.
Michael Poole [Thu, 20 Mar 2008 03:43:01 +0000 (23:43 -0400)]
src/chanserv.c: Do not mix variable declarations and code.
Michael Poole [Thu, 20 Mar 2008 03:42:20 +0000 (23:42 -0400)]
src/hash.c: Move irc_join() before callback handling for uniformity with other servers.
Michael Poole [Sun, 9 Mar 2008 00:52:08 +0000 (19:52 -0500)]
src/nickserv.help: Fix grammar in DELCOOKIE and ODELCOOKIE.
ThiefMaster [Fri, 7 Mar 2008 01:53:47 +0000 (02:53 +0100)]
Pass is_notice status to chanmsg funcs.
ThiefMaster [Tue, 12 Feb 2008 14:26:06 +0000 (15:26 +0100)]
Allow *account to be used in !say and !emote.
Michael Poole [Sun, 9 Mar 2008 00:36:58 +0000 (19:36 -0500)]
Log accountinfos on others' accounts as staff commands.
ThiefMaster [Thu, 10 Jan 2008 12:36:51 +0000 (13:36 +0100)]
Add checkemail and odelcookie commands to nickserv.
Michael Poole [Sat, 5 Jan 2008 17:22:03 +0000 (12:22 -0500)]
Convert time-related variables to consistently use "unsigned long".
configure.in: Remove no-longer-used check for FMT_TIME_T.
src/*.c: Convert time_t and time adjustment values to unsigned long.
src/*.h: Likewise.
src/config.h.win32: Remove definition of FMT_TIME_T.
Michael Poole [Tue, 18 Dec 2007 03:38:56 +0000 (22:38 -0500)]
Prefer "bind_address" for local addresses over "address".
src/mod-qserver.c (qserver_conf_read): Check for "bind_address" option
before "address" option.
src/mod-sockcheck.c (sockcheck_read_conf): Likewise.
srvx.conf.example: Update config examples to match.
Michael Poole [Sat, 15 Dec 2007 18:19:51 +0000 (13:19 -0500)]
Make triggers work properly again for privsmsgs to channels.
Michael Poole [Fri, 14 Dec 2007 04:47:10 +0000 (23:47 -0500)]
Greatly enhance the slab allocator.
configure.in: Look for mprotect() function.
src/Makefile.am: Add slab-read program.
src/slab-read.c: New helper program.
src/alloc-slab.c (SLAB_DEBUG_HEADER): New bitmask macro.
(SLAB_DEBUG_LOG): Likewise. Implement its functions.
(SLAB_DEBUG_PERMS): Likewise. Implement its functions.
(SLAB_DEBUG): Update default.
(slab_alloc): Call slab_unprotect() when pulling free_slab_head. Call
slab_log_alloc() on any slab allocation.
(slab_unalloc): Call slab_log_free() on slab unallocation. Call
slab_unprotect() and slab_protect() when manipulating free slabs.
(slab_malloc): Call slab_log_alloc() on large object allocation.
(slab_free): Call slab_log_unmap() on large object free.
Michael Poole [Fri, 14 Dec 2007 03:56:03 +0000 (22:56 -0500)]
Fix some memory leaks in the slab allocator (funny, isn't it?).
alloc-slab.c (SLAB_DEBUG): Allow environment to override definition.
(SLAB_RESERVE): Likewise.
(MAX_SLAB_FREE): New preprocessor macro, used to cap free_slab_count.
(slab_unalloc): Reindent SLAB_RESERVE logic. Unconditionally link the
free slab to the list of free slabs. Add code to check MAX_SLAB_FREE.
Michael Poole [Fri, 14 Dec 2007 03:32:13 +0000 (22:32 -0500)]
Avoid appending a user to curr_opers or curr_helpers more than once.
hash.h (userList_contains): Declare new function.
hash.c (userList_contains): Implement it.
nickserv.c (set_user_handle_info): Use it to check against curr_helpers.
proto-p10.c (mod_usermode): Use it for curr_opers.
Michael Poole [Fri, 14 Dec 2007 03:01:04 +0000 (22:01 -0500)]
Fix some memory leaks.
recdb.c (parse_database): Close recdb.f on all exit paths.
sar.c (sar_cleanup): Free the string lists allocated inside config struct.
saxdb.c (saxdb_read_db): Free the previous mondo_db (if any) at first read.
Michael Poole [Fri, 14 Dec 2007 02:43:20 +0000 (21:43 -0500)]
Update configure.in to show 1.4.0 rather than 1.4.
Michael Poole [Fri, 14 Dec 2007 02:42:52 +0000 (21:42 -0500)]
Update config.h.win32 for more recent versions of mingw32.
Michael Poole [Fri, 14 Dec 2007 02:42:30 +0000 (21:42 -0500)]
Store git version string to a C file, not a header.
.gitignore: Update git-ignore.* file name.
Makefile.am: Update rebuild rules and srvx_SOURCES to match.
common.h: Declare git_version[].
main-common.c: Include git_version in version banner. Update copyright years.
modcmd.c: Use git_version instead of GIT_VERSION.
Michael Poole [Thu, 13 Dec 2007 04:16:08 +0000 (23:16 -0500)]
Get rid of trailing whitespace in coverage scripts.
Michael Poole [Thu, 13 Dec 2007 04:08:41 +0000 (23:08 -0500)]
Do not generate a flood of complaints on rehashing the asynchronous resolver.
src/sar.c (sar_services_init): Delete and re-allocate the services dicts here.
(sar_init): .. rather than here.
Michael Poole [Thu, 13 Dec 2007 04:07:52 +0000 (23:07 -0500)]
Fix DNR expiration and expiration-based DNR searches.
src/chanserv.c (expire_dnrs): Use the usual trick for iterating over a dict
while we might want to delete elements from it.
(dnr_search_matches): Simplify the min_expires test. If max_expires is
set, fail if the DNR never expires or it expires later.
(dnr_search_create): Initialize max_expires to 0, not INT_MAX.
Michael Poole [Thu, 13 Dec 2007 03:51:12 +0000 (22:51 -0500)]
Update .gitignore files with entries normally generated by in-tree builds.