srvx.git
17 years agoRemove "wants_reads" field from struct io_fd.
Michael Poole [Fri, 6 Oct 2006 23:16:58 +0000 (23:16 +0000)]
Remove "wants_reads" field from struct io_fd.

Everybody wants read information, so give it to them!

src/ioset-epoll.c (ioset_epoll_events): Make EPOLLIN unconditional.

src/ioset-impl.h (fd_wants_reads): Delete.

src/ioset-select.c (ioset_select_loop): Unconditionally set read bit for fd.

src/ioset.c (ioset_add): Add fd to engine after marking it non-blocking.
  (ioset_buffered_reads): Remove check for fd->wants_reads.

src/ioset.h (struct io_fd): Delete "wants_reads" field.

src/mod-qserver.c (qserver_readable): Add missing newline.
  (qserver_accept): Delete assignment to fd->wants_reads.

src/mod-sockcheck.c (sockcheck_connected): Delete assignment to
    fd->wants_reads.

src/proto-common.c (create_socket_client): Delete assignment to
    fd->wants_reads.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-56

17 years agoFix detection of gettimeofday().
Michael Poole [Fri, 6 Oct 2006 23:12:20 +0000 (23:12 +0000)]
Fix detection of gettimeofday().

configure.in: Since we have a fallback for gettimeofday, move it in with
    the functions for which we do.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-55

17 years agoMake timeq_init() automatic.
Michael Poole [Wed, 4 Oct 2006 01:41:05 +0000 (01:41 +0000)]
Make timeq_init() automatic.

src/main.c (main): Remove call to timeq_init().

src/timeq.h (timeq_init): Remove declaration.

src/timeq.c (timeq_cleanup): Assign NULL to timeq to handle late timeq_del() calls.
  (timeq_init): Make static.
  (timeq_next): If timeq is NULL, return a large positive number.
  (timeq_add): If timeq is NULL, initialize it.
  (timeq_del): If timeq is NULL, do nothing.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-54

17 years agoAllow log_module() to NULL log types.
Michael Poole [Wed, 4 Oct 2006 01:37:40 +0000 (01:37 +0000)]
Allow log_module() to NULL log types.

src/log.c (log_module): To make cleanup easier, allow NULL log types.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-53

17 years agoFix some startup-related glitches.
Michael Poole [Wed, 4 Oct 2006 01:32:57 +0000 (01:32 +0000)]
Fix some startup-related glitches.

src/ioset.h (ioset_update): Declare new function.

src/ioset.c (ioset_init): If we have an engine, return early.
  (ioset_add): If no engine, try to initialize.
  (ioset_update): New function.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-52

17 years agoUpdate time for ioset backend.
Michael Poole [Wed, 4 Oct 2006 01:23:10 +0000 (01:23 +0000)]
Update time for ioset backend.

src/ioset-epoll.c (ioset_epoll_loop): Set now after epoll_wait() returns.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-51

17 years agoI18n'ize the staff descriptors in !access.
Michael Poole [Tue, 3 Oct 2006 23:18:25 +0000 (23:18 +0000)]
I18n'ize the staff descriptors in !access.

src/chanserv.c (msgtab): Add new entries for staff descriptors.
  (cmd_access): Use them.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-50

17 years agoioset event handling fixups
Michael Poole [Sat, 23 Sep 2006 01:14:35 +0000 (01:14 +0000)]
ioset event handling fixups

src/ioset.c (ioset_connect): Properly handle the situation if the connect
    handler closes the fd.
  (ioset_accept): Rename "old_active_fd" to "old_active" for consistency.
  (ioset_buffered_read): Make sure we bail if the fd is closed.
  (ioset_events): Handle 'readable' on a connecting fd as an error.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-49

17 years agoDummy handling fixes.
Michael Poole [Sat, 23 Sep 2006 01:03:08 +0000 (01:03 +0000)]
Dummy handling fixes.

src/proto-p10.c (irc_notice): Fix the conditions for sending message to
    IRC.
  (irc_privmsg): Likewise.
  (parse_cleanup): Zero num_*_funcs when freeing the corresponding
    arrays, so that DelUser() doesn't read after free.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-48

17 years agoFix hostmask generation for hostnames without dots.
Michael Poole [Sat, 23 Sep 2006 00:58:27 +0000 (00:58 +0000)]
Fix hostmask generation for hostnames without dots.

src/proto-common.c (generate_hostmask): Keep no-dot hostnames as the
    mask -- mod-qserver can generate hostnames like "localhost".
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-47

17 years agoDefault qserver clients to being opers.
Michael Poole [Sat, 23 Sep 2006 00:55:02 +0000 (00:55 +0000)]
Default qserver clients to being opers.

src/mod-qserver.c (qserver_accept): Default dummy client to having
    usermode +o, so they can use privileged services.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-46

17 years agoFurther giveownership confirmation fixes.
Michael Poole [Sat, 23 Sep 2006 00:52:48 +0000 (00:52 +0000)]
Further giveownership confirmation fixes.

src/chanserv.c (CSMSG_CONFIRM_GIVEOWNERSHIP): Prepend * to account name.
  (cmd_giveownership): Check invoker access to determine need for confirmation.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-45

17 years agoFix comment about +O vs +o.
Michael Poole [Fri, 22 Sep 2006 03:33:25 +0000 (03:33 +0000)]
Fix comment about +O vs +o.

src/hash.h (FLAGS_OPER): The user mode is actually +o, not +O.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-44

17 years agoFix license notice for mod-qserver.c
Michael Poole [Fri, 22 Sep 2006 03:28:08 +0000 (03:28 +0000)]
Fix license notice for mod-qserver.c

src/mod-qserver.c: Since this was for public distribution, use the
    standard GPL header notice.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-43

17 years agoAdd win32 specific files to tarballs.
Michael Poole [Fri, 22 Sep 2006 03:05:54 +0000 (03:05 +0000)]
Add win32 specific files to tarballs.

Makefile.am (EXTRA_DIST): Include Makefile.win32.

src/Makefile.am (EXTRA_srvx_SOURCES): Include config.h.win32 and ioset-win32.c.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-42

17 years agoFirst pass at native Win32 support (does not compile).
Michael Poole [Fri, 22 Sep 2006 03:02:07 +0000 (03:02 +0000)]
First pass at native Win32 support (does not compile).

src/compat.h: Handle Windows Sockets 2 headers.

src/mod-memoserv.c (KEY_READ): #undef'ine to avoid its registry access
    meaning on Windows.

Makefile.win32: New Makefile for native or cross builds targeting Win32.

src/config.h.win32: Pregenerated config.h for Win32.

src/ioset-win32.c: First attempt at a Win32 ioset backend.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-41

17 years agoAdd direct query server module.
Michael Poole [Fri, 22 Sep 2006 02:51:50 +0000 (02:51 +0000)]
Add direct query server module.

srvx.conf.example: Document qserver configuration.

src/Makefile.am (EXTRA_srvx_SOURCES): Add mod-qserver.c.

src/mod-qserver.c: New file.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-40

17 years agoAdd epoll_* ioset backend.
Michael Poole [Fri, 22 Sep 2006 02:45:20 +0000 (02:45 +0000)]
Add epoll_* ioset backend.

configure.in: Check for epoll_create(); demote select() from being required.

src/Makefile.am (EXTRA_srvx_SOURCES): Add ioset-epoll.c.

src/ioset-epoll.c: New file.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-39

17 years agoAllow multiple ioset backends.
Michael Poole [Fri, 22 Sep 2006 02:38:21 +0000 (02:38 +0000)]
Allow multiple ioset backends.

configure.in: Add framework to check for ioset backends.

src/Makefile.am (noinst_DATA): Reorganize for easier patching.
  (checkversion): Avoid spurious error message if $(GNU_ARCH) is missing.
  (EXTRA_srvx_SOURCES): Reorganize for easier patching; add ioset-select.c.
  (srvx_SOURCES): Add ioset-impl.h.

src/ioset.c (ioset.h): #include "ioset-impl.h" instead.
  (clock_skew): Make non-static for backends.
  (engine): New variable.
  (active_fd): New variable (kind of kludgy).
  (io_engine_*): New variables, only one exists so far.
  (ioset_init): New function.
  (ioset_cleanup): Call engine's cleanup function.
  (ioset_add): Call engine's add function.
  (ioset_listen): New function.
  (ioset_connect): Call engine's update functions at appropriate points.
  (ioset_try_write): Call engine's update function on success.
  (ioset_close): Change signature; check against active_fd; call engine's
    remove function.
  (ioset_accept): New function.
  (ioset_buffered_read): Update fd->state instead of fd->eof and call
    engine's update function as appropriate.  Use active_fd.
  (ioset_line_read): Check fd->state instead of fd->eof.
  (debug_fdsets): Move to ioset-select.c.
  (ioset_events): New function.
  (ioset_run): Move most of the logic into ioset-select loop function;
    call it.  Rename "select_timeout" to "timeout" to match.
  (ioset_write): Call engine->update function.
  (ioset_printf): New function.

src/ioset.h (common.h): #include this header to get PRINTF_LIKE macro.
  (struct io_fd): Replace 'connected' and 'eof' fields with 'state' field.
  (ioset_init): Declare new function.
  (ioset_listen): Declare new function.
  (ioset_printf): Declare new function.
  (ioset_close): Update signature.

src/main.c (main): Call ioset_init().

src/mod-sockcheck.c (sockcheck_free_client): Can unconditionally call
    ioset_close() now.
  (expand_var): Always use C99 type names.
  (sockcheck_begin_test): Can unconditionally call ioset_close() now.
  (sockcheck_read_conf): Only warn about unknown host if the user set
    one; it is silly to arn about unknown host `(null)'.

src/proto-common.c (socket_destroyed): Check fd->state rather than
    fd->eof.
  (close_socket): Update signature for ioset_close().
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-38

17 years agoAdd "dummy client" support.
Michael Poole [Fri, 22 Sep 2006 02:15:55 +0000 (02:15 +0000)]
Add "dummy client" support.

src/hash.h (FLAGS_DUMMY): New flag for non-propagated clients.
  (IsDummy): Check it.

src/helpfile.c (send_message): Allow sending to dummy clients.
  (send_message_type): Likewise.

src/proto-bahamut.c (irc_user): Bail if user is NULL or has a dummy nickname.
  (deliver_to_dummy): New function.
  (irc_privmsg): Try to deliver via dummy method before sending to IRC.
  (irc_notice): Likewise.
  (irc_notice_user): Likewise.
  (AddUser): If the first user mode character is '*', mark as a dummy.
  (DelUser): Unregister callback functions when destroying local clients.

src/proto-p10.c (irc_user): Bail if user is NULL or has a dummy nickname.
  (deliver_to_dummy): New function.
  (irc_notice): Try to deliver via dummy method before sending to IRC.
  (irc_notice_user): Likewise.
  (irc_privmsg): Likewise.
  (AddUser): If the first user mode character is '*', mark as a dummy.
  (DelUser): Unregister callback functions when destroying local clients.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-37

17 years agoDelete obsolete and non-propagated user modes.
Michael Poole [Fri, 22 Sep 2006 01:56:07 +0000 (01:56 +0000)]
Delete obsolete and non-propagated user modes.

src/hash.h (FLAGS_LOCOP): Delete.
  (FLAGS_SERVNOTICE): Delete.
  (FLAGS_HELPER): Delete.
  (IsServNotice): Delete.
  (IsHelperIrcu): Delete.

src/opserv.c (cmd_whois): Remove IsServNotice() or IsHelperIrcu().

src/proto-bahamut.c (mod_usermode): Do not handle +O/+s/+h, we never see them.

src/proto-p10.c (irc_user): Do not emit +s or +h, we never set them..
  (mod_usermode): Do not handle +O/+s/+h, we never see them.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-36

17 years agoMerge AddService(), AddClone() into AddLocalUser()
Michael Poole [Fri, 22 Sep 2006 01:48:00 +0000 (01:48 +0000)]
Merge AddService(), AddClone() into AddLocalUser()

src/chanserv.c (init_chanserv): Convert AddService() call to AddLocalUser().

src/global.c (init_global): Likewise.

src/mod-helpserv.c (register_helpserv): Likewise.

src/modcmd.c (cmd_service_add): Likewise.
  (modcmd_load_bots): Likewise.

src/nickserv.c (regex.h): Fall back to rxposix.h from local rx package.
  (init_nickserv): Convert AddService() call to AddLocalUser().

src/opserv.c (opserv_add_reserve): Convert AddClone() call to AddLocalUser().
  (cmd_clone): Likewise.
  (add_reserved): Likewise.
  (init_opserv): Convert AddService() call to AddLocalUser().

src/proto-bahamut.c (AddService): Convert into AddLocalUser().
  (AddClone): Delete.

src/proto-p10.c (AddService): Convert into AddLocalUser().
  (AddClone): Delete.

src/proto.h (AddService): Convert into AddLocalUser().
  (AddClone): Delete.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-35

17 years agoMake IRC message handler 'text' const.
Michael Poole [Fri, 22 Sep 2006 01:35:03 +0000 (01:35 +0000)]
Make IRC message handler 'text' const.

src/chanserv.c (chanserv_ctcp_check): Make 'text' parameter const.

src/mod-helpserv.c (helpserv_usermsg): Likewise.
  (helpserv_botmsg): Likewise.

src/modcmd.c (svccmd_invoke): Likewise.
  (modcmd_privmsg): Likewise.
  (modcmd_chanmsg): Likewise.

src/modcmd.h (SVCMSG_HOOK): Likewise.

src/proto.h (chanmsg_func_t): Likewise.
  (privmsg_func_t): Likewise.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-34

17 years agoAdd autogen.sh to distribution tarball.
Michael Poole [Fri, 22 Sep 2006 01:23:43 +0000 (01:23 +0000)]
Add autogen.sh to distribution tarball.

Makefile.am: Add autogen.sh to the "extra" distributed files.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-33

17 years agoSupport and use G-line lastmod timestamp.
Michael Poole [Mon, 11 Sep 2006 01:03:14 +0000 (01:03 +0000)]
Support and use G-line lastmod timestamp.

src/gline.c (KEY_LASTMOD): New key string.
  (gline_add): Use new parameter to set lastmod.
  (gline_add_record): Look for KEY_LASTMOD values.
  (gline_write_entry): Set KEY_LASTMOD if lastmod is set.
  (gline_discrim_create): Allow specification of lastmod criteria.
  (gline_discrim_match): Check lastmod if appropriate.

src/gline.h (struct gline): Add lastmod field.
  (struct gline_discrim): Add lastmod fields.
  (gline_add): New parameter.

src/mod-sockcheck.c (sockcheck_issue_gline): Set lastmod.

src/opserv.c (OSMSG_NO_GLINE): New format string.
  (opserv_block): Set lastmod.
  (cmd_gline): Set lastmod.
  (cmd_stats_glines): Allow searching for a particular G-line (just like
    gtrace).
  (opserv_new_user_check): Set lastmod.
  (gtrace_print_func): Use intervals rather than fixed dates and show
    lastmod.

src/opserv.help (GTRACE CRITERIA): Mention lastmod criteria.

src/proto-p10.c (irc_gline): Send lastmod if it is set.
  (cmd_num_gline): Parse out lastmod if it is set.
  (cmd_gline): Parse out lastmod if it is set.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-32

17 years agoNetwork event handler fixup when ChanServ is disabled.
Michael Poole [Sat, 9 Sep 2006 21:37:28 +0000 (21:37 +0000)]
Network event handler fixup when ChanServ is disabled.

src/chanserv.c (init_chanserv): Do not register network event handlers if
    ChanServ is disabled.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-31

17 years agoMake srvx compile on cygwin again.
Michael Poole [Sun, 3 Sep 2006 15:24:48 +0000 (15:24 +0000)]
Make srvx compile on cygwin again.

configure.in (AC_CHECK_HEADERS): Look for <arpa/inet.h>.
  (AC_CHECK_FUNCS): Look for inet_aton().

src/compat.c: Try to include <arpa/inet.h> so we get inet_addr().
  (getaddrinfo): If inet_aton() is not provided, use inet_addr() instead.

src/compat.h (AI_NUMERICHOST): Define this too.

src/tools.c (irc_pton): Use the pedantically correct type for ip4.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-30

17 years agoDelChannelUser call and semantic fixups
Michael Poole [Sun, 3 Sep 2006 15:21:10 +0000 (15:21 +0000)]
DelChannelUser call and semantic fixups

src/hash.c (DelChannel): Fix type of 'reason' arg to DelChannelUser().
  (DelChannelUser): Only send part message if user is local.

src/proto-bahamut.c (DelUser): Unswap arguments to DelChannelUser().
  (cmd_part): Move to proto-common.c.

src/proto-common.c (part_desc): New structure type.
  (part_helper): Use it to capture user and reason.
  (cmd_part): New common function.

src/proto-p10.c (cmd_part): Move to proto-common.c.
  (DelUser): Unswap arguments to DelChannelUser().
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-29

17 years agoDo not try to moderate join-flood channels with no OpServ.
Michael Poole [Sun, 3 Sep 2006 15:17:05 +0000 (15:17 +0000)]
Do not try to moderate join-flood channels with no OpServ.

src/opserv.c (opserv_join_check): As feigling points out, it is bad for a
    service that does not exist to join a channel and hack modes.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-28

17 years agoFix ounregnick access check.
Michael Poole [Sun, 3 Sep 2006 15:13:31 +0000 (15:13 +0000)]
Fix ounregnick access check.

src/nickserv.c (cmd_ounregnick): Use the standard rank-checking function.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-27

17 years agoFix giveownership to how it should be
Michael Poole [Sun, 3 Sep 2006 15:11:29 +0000 (15:11 +0000)]
Fix giveownership to how it should be

src/chanserv.c (cmd_giveownership): Only require confirmation code if the
  user has real (normal) access and is not forcing the giveownership.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-26

17 years agoFix giveownership to how it should be
Michael Poole [Sun, 3 Sep 2006 15:10:58 +0000 (15:10 +0000)]
Fix giveownership to how it should be

src/chanserv.c (cmd_giveownership): Only require confirmation code if the
  user has real (normal) access and is not forcing the giveownership.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-25

17 years agoMark channels as visited when high-level users leave.
Michael Poole [Sat, 19 Aug 2006 13:31:08 +0000 (13:31 +0000)]
Mark channels as visited when high-level users leave.

src/chanserv.c (handle_part): At ThiefMaster's suggestion, update a
  channel's visited time when a high-level user leaves (parts, gets
  kicked, or quits).
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-24

17 years agoRequire confirmation cookie for giveownership.
Michael Poole [Mon, 7 Aug 2006 03:11:10 +0000 (03:11 +0000)]
Require confirmation cookie for giveownership.

src/chanserv.c (CSMSG_CONFIRM_GIVEOWNERSHIP): New translation string.
  (cmd_giveownership): Fail for non-force unconfirmed giveownerships.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-23

17 years agoAdd CSMSG_INVALID_CFLAG string.
Michael Poole [Sat, 29 Jul 2006 01:36:39 +0000 (01:36 +0000)]
Add CSMSG_INVALID_CFLAG string.

src/chanserv.c (msgtab): Add entry for "CSMSG_INVALID_CFLAG".
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-22

17 years agoFix ?csearch max timestamp default value.
Michael Poole [Sat, 29 Jul 2006 01:34:17 +0000 (01:34 +0000)]
Fix ?csearch max timestamp default value.

src/opserv.c (opserv_cdiscrim_create): Fix default value for max_ts.
    (With an expression only a coder could love.  Improvements wanted.)
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-21

17 years agoUpdate arch-inventory files for in-tree builds.
Michael Poole [Tue, 18 Jul 2006 03:13:31 +0000 (03:13 +0000)]
Update arch-inventory files for in-tree builds.

.arch-inventory: Add "libtool" as a preserved file.

src/.arch-inventory: Add ".libs" as a preserved directory.  Put a \
    before the . in .cvsignore to avoid capturing too much.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-20

17 years agoMake !bans searching more flexible
Michael Poole [Tue, 18 Jul 2006 02:48:32 +0000 (02:48 +0000)]
Make !bans searching more flexible

src/chanserv.c (cmd_bans): Allow specifying a complete hostmask or a
    nickname when searching bans.

src/chanserv.help (BANS): Document the searching functions.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-19

17 years agoSimplify cdiscrim_match() max tests.
Michael Poole [Tue, 18 Jul 2006 01:49:56 +0000 (01:49 +0000)]
Simplify cdiscrim_match() max tests.

src/opserv.c (opserv_cdiscrim_create): Explicitly initialize max_users
    and max_ts.
  (cdiscrim_match): Simplify the bounds tests for timestamp and users.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-18

17 years agoFix reclaim KILL behavior.
Michael Poole [Tue, 18 Jul 2006 01:46:10 +0000 (01:46 +0000)]
Fix reclaim KILL behavior.

src/nickserv.c (nickserv_reclaim): Use DelUser() instead of irc_kill(),
    so that srvx's databases are appropriately updated.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-17

17 years agoFix typo in English error message text.
Michael Poole [Tue, 18 Jul 2006 01:12:16 +0000 (01:12 +0000)]
Fix typo in English error message text.

src/chanserv.c (CSMSG_TOPICMASK_CONFLICT2): Add missing "is".  Reported
  by Harm, by way of Byte.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-16

17 years agoUpdate version tag for 1.3.1 release. v1.3.1
Michael Poole [Sun, 14 May 2006 02:54:24 +0000 (02:54 +0000)]
Update version tag for 1.3.1 release.

configure.in: Update version tag for 1.3.1 release.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-15

18 years agoMake some ChanServ ban checks see through hidden hosts.
Michael Poole [Tue, 2 May 2006 02:46:39 +0000 (02:46 +0000)]
Make some ChanServ ban checks see through hidden hosts.

src/chanserv.c (handle_join): Make this function see through hidden
    hosts when matching users against bans.  Add comment before the
    non-burst section; remove a redundant burst check there.
  (handle_auth): See through hidden hosts when checking against active
    bans.  Inactive ban check keeps MATCH_VISIBLE since bans on the true
    hostname should have already been applied.
  (handle_nick_change): Same as handle_auth.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-14

18 years agoFix visible matching for fake and +x-hidden hosts.
Michael Poole [Sat, 29 Apr 2006 03:11:35 +0000 (03:11 +0000)]
Fix visible matching for fake and +x-hidden hosts.

src/tools.c (user_matches_glob): Use correct test to determine whether
    the user's host is hidden.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-13

18 years agoFix a +o mode parsing error.
Michael Poole [Fri, 7 Apr 2006 00:56:38 +0000 (00:56 +0000)]
Fix a +o mode parsing error.

src/proto-p10.c (mod_chanmode_parse): Check that the input argument after
    +o is a valid one.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-12

18 years agoFix some IPv6 address compatibility issues.
Michael Poole [Thu, 6 Apr 2006 02:19:47 +0000 (02:19 +0000)]
Fix some IPv6 address compatibility issues.

src/proto-p10.c (irc_p10_pton): Mark valid IPv4 addresses as v4-mapped.
  (irc_p10_ntop): Emit invalid IPs as AAAAAA (but it could be _ for +6
    flagged hubs).
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-11

18 years agoFix a possible warning without debugging.
Michael Poole [Wed, 5 Apr 2006 02:07:30 +0000 (02:07 +0000)]
Fix a possible warning without debugging.

src/alloc-slab.c (slab_unalloc): If assert() is #define'd to be empty,
    then size is unused.  Include a (void)size to quash a warning.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-10

18 years agoFix hostmask error from last year's patch-28.
Michael Poole [Wed, 5 Apr 2006 02:02:21 +0000 (02:02 +0000)]
Fix hostmask error from last year's patch-28.

src/proto-common.c (generate_hostmask): When generating a strict hostmask
    not by IP, we should keep the original hostname.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-9

18 years agoFix compilation error with slab allocator and no debugging.
Michael Poole [Wed, 5 Apr 2006 01:59:54 +0000 (01:59 +0000)]
Fix compilation error with slab allocator and no debugging.

src/alloc-slab.c (verify): Undefine as a macro before defining as a
    function.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-8

18 years agoFix backtracking bug after an escaped character.
Michael Poole [Wed, 5 Apr 2006 00:24:50 +0000 (00:24 +0000)]
Fix backtracking bug after an escaped character.

src/tools.c (match_ircglob): Fix backtracking behavior when an escaped
    character did not match.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-7

18 years agoAdvise the kernel that we will scan DB files sequentially.
Michael Poole [Wed, 5 Apr 2006 00:11:31 +0000 (00:11 +0000)]
Advise the kernel that we will scan DB files sequentially.

src/recdb.c (parse_database): Advise the kernel that we will scan the
    recdb file sequentially, just in case it cannot notice the access
    pattern on its own.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-6

18 years agoCorrectly implement AsLL pong.
Michael Poole [Wed, 5 Apr 2006 00:09:48 +0000 (00:09 +0000)]
Correctly implement AsLL pong.

src/proto-p10.c (irc_pong_asll): New function.
  (cmd_ping): Use it.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-5

18 years agoAdd missing underscore in translation key string.
Michael Poole [Wed, 5 Apr 2006 00:08:04 +0000 (00:08 +0000)]
Add missing underscore in translation key string.

src/mod-helpserv.c (helpserv_usermsg): Add a missing underscore between
    REQUEST and NOT.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-4

18 years agoUpdate configure.in; support both baz and tla; avoid using dirent.
Michael Poole [Wed, 5 Apr 2006 00:05:59 +0000 (00:05 +0000)]
Update configure.in; support both baz and tla; avoid using dirent.

configure.in: Remove AC_PROG_RANLIB since we never use ranlib.  Add
    AC_PROG_LIBTOOL since we do use libtool.  Set GNU_ARCH and
    HAS_GNU_ARCH based on whether the system has baz or tla.  Do not
    check for dirent.d_type.

src/Makefile.am: Make the "checkversion" target conditional on
    HAS_GNU_ARCH, and use the detected $(GNU_ARCH).

src/helpfile.c (language_read): Report error text when unable to open a
    language directory.
  (language_read_list): Always stat the language entry to determine
    whether it is a directory; Cygwin has no dirent.d_type and ReiserFS
    has a broken one.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-3

18 years agoUpdate ChangeLog (again?!), ltmain.sh and rx/Makefile.in
Michael Poole [Wed, 5 Apr 2006 00:00:57 +0000 (00:00 +0000)]
Update ChangeLog (again?!), ltmain.sh and rx/Makefile.in

ChangeLog: Update again (it didn't take, for some strange reason).

ltmain.sh: Update to current version.

rx/Makefile.in: Regenerate to match.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-2

18 years agoRotate ChangeLog for the new year's archive.
Michael Poole [Tue, 4 Apr 2006 23:58:31 +0000 (23:58 +0000)]
Rotate ChangeLog for the new year's archive.

ChangeLog: Update for the new year's archive.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-1

18 years agoUpdate rx/Makefile.in for current automake.
Michael Poole [Fri, 23 Dec 2005 03:14:44 +0000 (03:14 +0000)]
Update rx/Makefile.in for current automake.

rx/Makefile.in: Update to use the same version of automake as the
    project's other Makefile.in files.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-36

18 years agoDefault to not trimming users on vacation.
Michael Poole [Fri, 23 Dec 2005 03:11:09 +0000 (03:11 +0000)]
Default to not trimming users on vacation.

chanserv.c (cmd_trim_users): New argument to indicate whether users on
    vacation should be included.
  (cmd_trim): Parse an extra option to control that argument.

chanserv.help: Document this change.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-35

18 years agoUpdate config.guess and config.sub
Michael Poole [Fri, 23 Dec 2005 03:06:55 +0000 (03:06 +0000)]
Update config.guess and config.sub

config.guess: Update to support newer targets.
config.sub: Likewise.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-34

18 years agoFixes for LP64 models; announce IPv6 support.
Michael Poole [Thu, 17 Nov 2005 20:43:26 +0000 (20:43 +0000)]
Fixes for LP64 models; announce IPv6 support.

src/alloc-slab.c (SMALL_CUTOFF): Adjust to a multiple of 8.

src/alloc-srvx.c (srvx_malloc): Fix format string for LP64.

src/md5.h (UINT4): Fix typedef for LP64.

src/opserv.c (cmd_warn): Fix whitespace.

src/proto-p10.c (irc_server): Announce IPv6 support.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-33

18 years agoAvoid leaking information through ChanServ's ban matching.
Michael Poole [Tue, 1 Nov 2005 00:37:44 +0000 (00:37 +0000)]
Avoid leaking information through ChanServ's ban matching.

src/common.h (user_matches_glob): Convert last argument to be flags.

src/tools.c (user_matches_glob): Reorder tests to properly implement
    the MATCH_VISIBLE flag.

src/chanserv.c: Update callers of user_matches_glob() to set
    the MATCH_VISIBLE flag (in addition to MATCH_USENICK).

src/opserv.c: Update callers of user_matches_glob() to pass the
    MATCH_USENICK flag.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-32

18 years agoHandle default oplevels.
Michael Poole [Tue, 1 Nov 2005 00:23:14 +0000 (00:23 +0000)]
Handle default oplevels.

src/chanserv.c (cmd_mode): Calculate base oplevel as 1 plus one point
    for each access level below owner.
  (chan_opt_modes): Add new argument for mod_chanmode_parse().
  (chanserv_conf_read): Likewise.
  (chanserv_channel_read): Likewise.

src/hash.c (AddChannel): Likewise.
  (AddChannelUser): Set oplevel by default.

src/hash.h (MAXOPLEVEL): New define value.
  (modeNode): Shrink modes and oplevel fields.

src/opserv.c (cmd_chaninfo): Fix indentation; show oplevel after
    nickname rather than before it.

src/proto.h (mod_chanmode_parse): Declare new parameter.

src/proto-bahamut.c (mod_chanmode_parse): Add new parameter (and
    ignore it).

src/proto-common.c (mod_chanmode): Find the default oplevels for
    parsing the mode change.

src/proto-p10.c (create_desc): Remove oplevel field.
  (join_helper): Do not try to set oplevel for new modeNode.
  (parse_foreach): Do not bother parsing oplevels in JOIN, since they
    are no longer used.
  (mod_chanmode_parse): Add new parameter and use it to determine the
    oplevel to set when a valid oplevel one is not specified.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-31

18 years agoDefault ?block (etc) to G-line by IP; fix a buffer issue.
Michael Poole [Thu, 13 Oct 2005 02:20:55 +0000 (02:20 +0000)]
Default ?block (etc) to G-line by IP; fix a buffer issue.

src/opserv.c (opserv_block): Rewrite to block by IP rather than
    hostname.
  (opserv_new_user_check): Avoid overrunning the target buffer.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-30

18 years agoInitial oplevel support.
Michael Poole [Sat, 8 Oct 2005 14:56:31 +0000 (14:56 +0000)]
Initial oplevel support.

src/proto-p10.c: Fix a few bugs and compile errors in oplevel code.

Patches applied:

 * sp@gamesurge.net--2005/srvx--sp--1.3--patch-1
   Oplevel support

 * sp@gamesurge.net--2005/srvx--sp--1.3--patch-2
   Oplevel support (part 2)
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-29

18 years agoAdd IPv6 support.
Michael Poole [Sat, 8 Oct 2005 14:33:12 +0000 (14:33 +0000)]
Add IPv6 support.

configure.in: Check for struct sockaddr.sa_len and struct addrinfo.
    Also check for freeaddrinfo, getaddrinfo and getnameinfo.

src/common.h: Define irc_in_addr and macros to operate on it.  Declare
    irc_ntop(), irc_ntop_mask(), irc_pton(), irc_check_mask() and
    irc_ntoa().  Remove declaration for parse_ipmask() and undefine
    INADDR_NONE, INADDR_LOOPBACK and MATCH_IPMASK().

src/compat.h (struct addrinfo): Define if it and some flags if not
    defined by the system.
  (getaddrinfo): Declare if necessary.
  (getnameinfo): Likewise.
  (freeaddrinfo): Likewise.

src/compat.c (memcpy): Do not try to fall back onto bcopy.
  (getaddrinfo): Define if it is not defined by the system.
  (freeaddrinfo): Likewise.

src/gline.c (gline_alternate_target): Gut in preparation of a
    necessary rewrite.  Blah.

src/hash.h (struct userNode): Change type of ip field.

src/ioset.c (ioset_connect): Update to support non-IPv4 protocols.

src/main.c (uplink_insert): Update to support non-IPv4 protocols.

src/mod-snoop.c (snoop_new_user): Use irc_ntoa() instead of inet_ntoa().

src/mod-sockcheck.c (sockcheck_cache_info): Update address field type
    and length of hostname field.
  (sockcheck_conf): Update type of local_addr.
  (sockcheck_issue_gline): Update to use irc_ntop().
  (expand_var): Get client IPv4 address from its new place.
  (sockcheck_decide): Do not print the IP twice.
  (sockcheck_begin_test): Remove unnecessary typecast.
  (sockcheck_start_client): Do not print the IP twice.
  (sockcheck_queue_address): Use irc_in_addr_t and irc_ntoa() to form
    the target hostname.
  (cmd_hostscan): Update manipulation functions to use new macros and
    functions for irc_in_addr_t.
  (cmd_clearhost): Likewise.
  (sockcheck_new_user): Likewise.
  (sockcheck_read_conf): Use getaddrinfo() instead of IPv4-only
    functions.

src/nickserv.c (cmd_register): Use newer validity checks for IP.

src/opserv.c (IDENT_DATA): Use irc_ntoa() instead of inet_ntoa().
  (struct opservDiscrim): Update ip_mask and ip_mask_bits type.
  (cmd_whois): Use irc_ntoa() instead of inet_ntoa().
  (opserv_new_user_check): Use irc_ntop() instead of inet_ntoa() and
    update to newer validity check macros.
  (opserv_user_cleanup): Use irc_ntop() instead of inet_ntoa().
  (cmd_addtrust): Update to irc_in_addr_t and its functions.
  (foreach_matching_user): Use irc_pton() instead of the mess that
    existed before.
  (opserv_discrim_create): Use irc_pton() instead of parse_ipmask().
  (discrim_match): Use irc_check_mask() instead of MATCH_IPMASK(), and
    remove ip_mask_str check.
  (opserv_discrim_search): Decide whether an IP match is fully
    qualified based on ip_mask_bits instead of ip_mask_str.
  (trace_domains_func): Add IPv6 support.
  (opserv_staff_alert): Update to new IP validity check macro.

src/proto.h (struct uplinkNode): Fix type of bind_addr field.

src/proto-bahamut.c (AddUser): Use irc_in_addr_t.
  (AddService): Default to an all-zero IP instead of loopback.
  (AddClone): Likewise.
  (irc_user): Use new layout for IPv4 in irc_in_addr_t.
  (cmd_nick): Likewise.

src/proto-common.c (create_socket_client): Remove unnecessary
    typecast.
  (generate_hostmask): Update to use irc_in_addr_t and support
    functions instead of IPv4-specific things.

src/proto-p10.c (irc_p10_pton): New function.
  (irc_p10_ntop): New function.
  (irc_user): Use irc_p10_ntop().
  (AddClone): Use irc_p10_pton().

src/tools.c (ctype): New array holding values of characters as hex.
  (irc_ntop): New function.
  (irc_ntop_mask): New function.
  (irc_pton_ip4): New helper function.
  (irc_pton): New function.
  (irc_ntoa): New function.
  (irc_check_mask): New function.
  (user_matches_glob): Use irc_ntoa() instead of inet_ntoa().
  (parse_ipmask): Delete this function.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-28

18 years agoFix compiler warnings on AMD64 Linux.
Michael Poole [Fri, 7 Oct 2005 02:51:12 +0000 (02:51 +0000)]
Fix compiler warnings on AMD64 Linux.

src/gline.c (gline_alternate_target): Typecast format field precision
    argument.

src/helpfile.c (helpfile_eval_identifier): Likewise.
  (helpfile_eval_atomicexpr): Likewise.
  (helpfile_eval_expr): Likewise.
  (helpfile_eval_condition): Likewise.

src/log.c (log_audit): Change typecast used to make types compatible.

src/main.c (set_item_rlimit): Use long instead of int as contained value.

src/sendmail.c (send_flowed_text): Typecast format field precision
    argument.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-27

18 years agoImprove channel merging and restrict channel age display.
Michael Poole [Sun, 14 Aug 2005 01:34:04 +0000 (01:34 +0000)]
Improve channel merging and restrict channel age display.

src/chanserv.c (merge_data): Merge registered and owner-transfer
    timestamps, may_opchan flag, and max visitor count.
  (cmd_info): Only show channel age if the user is privileged.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-26

18 years agoProperly check alerts based on numchannels criteria
Michael Poole [Tue, 19 Jul 2005 18:31:26 +0000 (18:31 +0000)]
Properly check alerts based on numchannels criteria

src/opserv.c (opserv_add_user_alert): Channel alerts also include ones
  with non-zero min_channels.  Allow an alert to be both channel-based
  and nick-based.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-25

18 years agoFix gcc-4.0 compile warnings and errors.
Michael Poole [Tue, 19 Jul 2005 18:18:48 +0000 (18:18 +0000)]
Fix gcc-4.0 compile warnings and errors.

configure.in: Make sure socklen_t is defined.

src/chanserv.c (bad_channel_ban): Make victimCount unsigned.

src/ioset.c (ioset_run): Fifth argument to getsockopt() should be
  socklen_t.

src/ioset.h (clock_skew): Undeclare; it is defined as static.

src/nickserv.c (is_secure_password): Create appropriately typed local
  variable for third argument of dict_find().

src/opserv.c (opserv_bad_channel): Likewise.

src/proto-p10.c (call_oper_funcs): Declare at file scope rather than
  locally to mod_usermode() function.

src/proto.h (dead_users): Undeclare; it is defined as static.

src/saxdb.c (saxdb_write_int): Fix type of string buffer.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-24

18 years agoFix match_ircglob() and globtest
Zoot [Mon, 4 Jul 2005 00:37:07 +0000 (00:37 +0000)]
Fix match_ircglob() and globtest

 * Fix a reversed test in match_ircglob() and make globtest compiles again.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-23

18 years agoIntegrate Global "from" option; reorganize code
Zoot [Wed, 1 Jun 2005 19:05:39 +0000 (19:05 +0000)]
Integrate Global "from" option; reorganize code

 * src/global.c: Integrate SF.net patch #1211520 (from bruder2k) with a small
   bug fix; this patch adds a "from" option to Global notices and messages.

 * src/global.c, src/global.h: Make struct globalMessage private; cache text
   form of message's post date/time to avoid repeated strftime() calls.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-22

18 years agoMake match_ircglob() work more like the ircd.
Michael Poole [Mon, 30 May 2005 15:14:56 +0000 (15:14 +0000)]
Make match_ircglob() work more like the ircd.

src/tools.c (match_ircglob): Limit glob backtracking in the same way
that ircds generally do.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-21

19 years agoFix en_GB language name, fix NickServ mergedb command.
Michael Poole [Sun, 1 May 2005 17:16:58 +0000 (17:16 +0000)]
Fix en_GB language name, fix NickServ mergedb command.

FAQ: Clarify FAQ #8.

src/nickserv.c: Avoid losing channel information when replacing an
account using the mergedb command.

languages/en_UK: Rename to en_GB.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-20

19 years agoClarify NickServ REGISTER help messages; fix ?raw and ?dump errors.
Michael Poole [Tue, 15 Mar 2005 23:12:58 +0000 (23:12 +0000)]
Clarify NickServ REGISTER help messages; fix ?raw and ?dump errors.

src/nickserv.help (REGISTER): Rephrase the message about using the
same password to hopefully make it clearer.

src/opserv.c (cmd_dump, cmd_raw): Use local buffers to hold the
original message, so that parse_line() will not unsplit the line into
the "original" buffer and strip out the sentinel :.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-19

19 years agoFix registered channel desync; fix HelpServ crash for old cfg files
Michael Poole [Thu, 17 Feb 2005 21:42:43 +0000 (21:42 +0000)]
Fix registered channel desync; fix HelpServ crash for old cfg files

src/hash.c (AddChannelUser): Do not give ops to the first user to join
a persistent channel.

src/helpserv.c (helpserv_conf_read): Use a default description for bots.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-18

19 years agoMention 'slab' in --with-malloc docs. Merge fakehosts when merging accounts.
Michael Poole [Fri, 11 Feb 2005 03:10:49 +0000 (03:10 +0000)]
Mention 'slab' in --with-malloc docs.  Merge fakehosts when merging accounts.

configure.in (--with-malloc): Mention the awesome 'slab' allocator option.

src/nickserv.c (cmd_merge): Copy fakehost to target account if appropriate.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-17

19 years agoFix memory corruption when removing certain bans from a channel.
Michael Poole [Tue, 8 Feb 2005 04:42:43 +0000 (04:42 +0000)]
Fix memory corruption when removing certain bans from a channel.

src/proto-common.c (mod_chanmode_apply): Make sure we get a pointer to
the ban we want to deallocate BEFORE we remove it from the banlist.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-16

19 years agoRearrange slab allocation header; minor slab fixes.
Michael Poole [Sat, 5 Feb 2005 13:03:21 +0000 (13:03 +0000)]
Rearrange slab allocation header; minor slab fixes.

src/alloc-slab.c (ALLOC_MAGIC, FREE_MAGIC): Replace with single-byte values.
(struct alloc_header): Move file_id and line into second 32-bit word
of header.
(slab_alloc): Remove commented-out debug statements.
(slab_unalloc): Remove memset() of freed block and commented-out debug
statements.
(slab_free): memset() freed blocks here instead.  Try to fix
*_alloc_size counting errors (use the originally requested length
rather than rounded-up length)
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-15

19 years agoEven more slab allocator updates.
Michael Poole [Sat, 5 Feb 2005 03:52:51 +0000 (03:52 +0000)]
Even more slab allocator updates.

src/slab-alloc.c (SLAB_DEBUG): Default to on.
(SMALL_CUTOFF): Fix default value (must be a multiple of 4).
(slab_unalloc): Fix slab counting.  When SLAB_RESERVE, allocate the
set of pages in a burst, rather than supplementing them as we unmap.
(slab_realloc): Fix a rather embarassing (and LARGE) memory leak.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-14

19 years agomore debugging updates
Michael Poole [Fri, 4 Feb 2005 16:36:40 +0000 (16:36 +0000)]
more debugging updates

src/alloc-slab.c: Switch free slab list from a stack to queue, and
make sure there are SLAB_RESERVE in the queue before an old slab is
dereferenced.  This causes a fault when dereferencing stale pointers
to the last SLAB_RESERVE full slabs.

src/log.c: Make struct logEntry *last static, to make sure gcc does
not optimize it away.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-13

19 years agoMore slab allocator updates.
Michael Poole [Mon, 31 Jan 2005 22:28:59 +0000 (22:28 +0000)]
More slab allocator updates.

src/alloc-slab.c: Disable extra debugging by default.  Add more
statistics counters.  Change element type of little_slabs[].  Keep a
global list of unused (full) slab pages, rather than per-slab.
Various other cleanups and fixes.

src/chanserv.h: Can only be off-channel with off_channel > 1.

src/main.c: Update years in copyright notice.

src/opserv.c: Remove OSMSG_STATS_MEMORY.  Make cmd_stats_memory()
allocator-specific.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-12

19 years agoAdd "?stats memory" and optional alloc_header to slab.
Michael Poole [Mon, 31 Jan 2005 11:08:15 +0000 (11:08 +0000)]
Add "?stats memory" and optional alloc_header to slab.

src/alloc-slab.c: Add alloc_header (but no redzone) debug support,
enabled by default.  Update alloc_count and alloc_size.

src/opserv.c: Provide "stats memory" command for slab allocator.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-11

19 years agoAdd slab allocator; reduce delta with srvx-gs.
Michael Poole [Mon, 31 Jan 2005 05:14:52 +0000 (05:14 +0000)]
Add slab allocator; reduce delta with srvx-gs.

configure.in: Check for getpagesize().  Support --with-malloc=slab.

src/Makefile.am: Add alloc-slab.c as an extra source file.

src/alloc-srvx.c: Clean up srvx_free() slightly.  Check for previously
allocated blocks.

srvx.conf.example, src/chanserv.c, src/main.c, src/modcmd.c,
src/proto-p10.c: Apply patches to bring closer to srvx-gs branch.

src/log.c: Assert and _exit() on fatal log messages.

src/opserv.c: Clarify logic for modes to set on join floods.

src/proto-common.c: Accept off-channel commands in registered channels.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-10

19 years agooffchannel fixes; more memory verification
Michael Poole [Wed, 26 Jan 2005 21:16:54 +0000 (21:16 +0000)]
offchannel fixes; more memory verification

src/chanserv.c (cmd_register): Do not join channels if the default
options include being offchannel.

src/common.h: Verify list allocations when appending or removing.

src/hash.c (GetUserMode): Verify channel and user list allocations.

src/log.c (log_entry_search): Keep pointer to last visited log entry.

src/proto-p10.c (mod_chanmode_parse): Fail if trying to change +z when
passed MCP_REGISTERED.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-9

19 years agotypo fix in alloc-srvx.c; avoid dereferencing free()'d bans
Michael Poole [Mon, 24 Jan 2005 17:12:38 +0000 (17:12 +0000)]
typo fix in alloc-srvx.c; avoid dereferencing free()'d bans

src/alloc-srvx.c (srvx_realloc): Fix argument list to srvx_free().

src/chanserv.c (find_matching_bans): Make temporary copies of bans to
be removed.  Double-check remove count at end of loop.
(unban_user, cmd_open): Free the string copies.
(cmd_unbanall): Make temporary copies of removed bans and free them.
(handle_mode): Likewise.

src/opserv.c (cmd_clearbans): Likewise.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-8

19 years agoMore allocation debugging support.
Michael Poole [Mon, 24 Jan 2005 16:45:44 +0000 (16:45 +0000)]
More allocation debugging support.

src/alloc-srvx.c (srvx_realloc): Reorganize.
(verify): New function.

src/common.h (verify): Define and/or declare suitably.

src/dict-splay.c (dict_splay): Verify node at each iteration.
(dict_insert, dict_remove2, dict_find, dict_delete,
dict_sanity_check): Verify entire dict.
(dict_sanity_check_node): Verify node as valid allocation.

src/hash.c (DelChannel): Verify channel before deletion.
(GetUserMode): Verify channel, user, and each modeNode.

src/mod-sockcheck.c (sockcheck_free_client): Verify client.
(sockcheck_timeout_client, sockcheck_advance, sockcheck_readable,
sockcheck_connected, sockcheck_begin_test): Likewise.
(sockcheck_queue_address): Verify cached sockcheck entries.

src/proto-p10.c (DelUser): Verify user before deletion.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-7

19 years agoMore debug allocator fixes and enhancements
Michael Poole [Fri, 21 Jan 2005 15:10:49 +0000 (15:10 +0000)]
More debug allocator fixes and enhancements

src/alloc-srvx.c (*_MAGIC): ASk recognized the CCSDS ASM sequence.
(srvx_free): Overwrite with 0xDE bytes to distinguish from
uninitialized values.  As SailorFrag suggested, only overwrite the
user region.

src/dict-splay.c (dict_insert): Check whether free functions need to
be worked around here as well.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-6

19 years agoAdd redzone and statistics reporting to debug allocator.
Michael Poole [Fri, 21 Jan 2005 00:48:35 +0000 (00:48 +0000)]
Add redzone and statistics reporting to debug allocator.

src/alloc-srvx.c (redzone): New variable to detect buffer overwrites.
(alloc_count, alloc_size): New variables to track allocation stats.
(srvx_malloc, srvx_realloc, srvx_free): Use the above.

src/opserv.c (OSMSG_STATS_MEMORY): New translation string.
(cmd_stats_memory): New (conditional) command function.
(init_opserv): Conditionally provide cmd_stats_memory.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-5

19 years agoAdd built-in debug malloc wrapper.
Michael Poole [Thu, 20 Jan 2005 23:41:17 +0000 (23:41 +0000)]
Add built-in debug malloc wrapper.

TODO: Remove the completed TODO item.

configure.in: Add --with-malloc=srvx support.

src/Makefile.am: Add alloc-srvx.c to extra sources.

src/common.h: Reindent debug malloc directives; add directives for
WITH_MALLOC_SRVX.

src/dict-splay.c: Kludge around free() as macro vs function.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-4

19 years agovarious bugfixes and IPv6 preparation work
Michael Poole [Thu, 20 Jan 2005 22:51:54 +0000 (22:51 +0000)]
various bugfixes and IPv6 preparation work

src/modcmd.c (modcmd_privmsg): Fix CTCP PING response type.

src/opserv.help: Add column headers for command lists.

src/tools.c (is_gline, split_ircmask): Accept colons in hostnames.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-3

19 years agoAdd MODE_REGISTERED as +z for P10.
Michael Poole [Wed, 5 Jan 2005 01:03:05 +0000 (01:03 +0000)]
Add MODE_REGISTERED as +z for P10.

Add MODE_REGISTERED as +z for P10.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-2

19 years agoRotate ChangeLog for new repository; clarify documentation files
Michael Poole [Tue, 4 Jan 2005 19:35:57 +0000 (19:35 +0000)]
Rotate ChangeLog for new repository; clarify documentation files

Rotate ChangeLog to show changes for srvx@srvx.net--2005-srvx repo.

Fix various file permissions to 664 instead of 620.

Update FAQ and TODO.  Add UPGRADE file to arch and to distribution.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-1

19 years agoFix ban reader
Zoot [Tue, 23 Nov 2004 04:09:30 +0000 (04:09 +0000)]
Fix ban reader

 * src/chanserv.c: Drop invalid bans with no reason during database reads
   and require bans to have a reason set in add_channel_ban().
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-84

19 years agoFix nick length check in is_valid_nick().
Michael Poole [Wed, 10 Nov 2004 01:25:53 +0000 (01:25 +0000)]
Fix nick length check in is_valid_nick().

The for() loop in is_valid_nick() leaves 'nick' as an empty string,
which is obviosly shorter than the nick length limit.  Fix that.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-83

19 years agoFix glob matching against IPs
Michael Poole [Sat, 16 Oct 2004 21:14:11 +0000 (21:14 +0000)]
Fix glob matching against IPs

Do not require the first character in an IP glob to be a digit.  If an
IP-looking glob does not match, fall through to the other host matching
rules, in case the IP-looking glob really matches their hostname.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-82

19 years agoConsolidate use_registered_mode into off_channel and expand overall functionality
adam [Wed, 15 Sep 2004 04:14:14 +0000 (04:14 +0000)]
Consolidate use_registered_mode into off_channel and expand overall functionality

* srvx.conf's off_channel setting now allows us to turn on all of the features of out-of-channel services without activating the
channel setting to have chanserv part

git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-81

19 years agoChanServ bugfixes for +z and addbans in suspended channels
Michael Poole [Mon, 13 Sep 2004 13:11:38 +0000 (13:11 +0000)]
ChanServ bugfixes for +z and addbans in suspended channels

If ChanServ should use MODE_REGISTERED, update that when moving channels.

Do not check for bans against an auth'ing user in suspended channels.

Change the example entries for off_channel and use_registered_mode to
make the enabled/on values more obvious.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-80

19 years agoImplement item #1011114, #997053
Michael Poole [Wed, 8 Sep 2004 23:36:51 +0000 (23:36 +0000)]
Implement item #1011114, #997053

* Adjust the default max_greetlen to 200 (since greetings are now
  unconditionally capped at one line of output).

* Allow DNRs to be shown for accounts that currently do not exist.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-79

19 years agoFix bugs; better handle oplevels from ircu2.10.12
Michael Poole [Mon, 6 Sep 2004 13:35:59 +0000 (13:35 +0000)]
Fix bugs; better handle oplevels from ircu2.10.12

* Fix order of port and IP in sample socks4 proxy test.

* Fix a bug in dict_remove2() that corrupted the tree order if a
cleanup function tried to delete another node.

* Fix a buffer overflow in cmd_joiner.

* Get rid of free_nick_info() since it is really just free().

* If our P10 uplink sends an oplevel in a burst, treat it as a chanop.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-78

19 years agoMore title host checking
Zoot [Thu, 12 Aug 2004 16:06:55 +0000 (16:06 +0000)]
More title host checking

 * src/nickserv.c: Make oset title verify that the final combined fakehost
   will not be truncated before storing the title. Also, supply a missing
   format string argument.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-77