srvx.git
16 years agoAvoid crashing when BURST has missing modes.
Michael Poole [Sun, 20 May 2007 15:59:43 +0000 (11:59 -0400)]
Avoid crashing when BURST has missing modes.

src/proto-p10.c (cmd_burst): If the expected number of modes is larger
  than the actual number, only unsplit and advance by the actual number.

16 years agoCheck if there are opers on the target ip in trace gag/gline and block.
ThiefMaster [Fri, 4 May 2007 20:24:09 +0000 (22:24 +0200)]
Check if there are opers on the target ip in trace gag/gline and block.

16 years agoAdded idletime to remote whois.
ThiefMaster [Wed, 2 May 2007 15:52:28 +0000 (17:52 +0200)]
Added idletime to remote whois.

16 years agoMade ounregister command safer by requiring FORCE to unregister active/flagged accounts.
ThiefMaster [Mon, 30 Apr 2007 11:19:36 +0000 (13:19 +0200)]
Made ounregister command safer by requiring FORCE to unregister active/flagged accounts.

16 years ago* Disallow BLOCK on trusted ips
ThiefMaster [Sat, 14 Apr 2007 18:54:02 +0000 (20:54 +0200)]
* Disallow BLOCK on trusted ips
* Add ABUSE TRUSTED criterion for alerts/trace

16 years agoOnly allow opers with access to GLINE to use a custom duration in BLOCK.
ThiefMaster [Sat, 14 Apr 2007 17:06:53 +0000 (19:06 +0200)]
Only allow opers with access to GLINE to use a custom duration in BLOCK.

16 years agoCheck account-based alerts when someone authenticates.
ThiefMaster [Sat, 7 Apr 2007 18:06:24 +0000 (20:06 +0200)]
Check account-based alerts when someone authenticates.

16 years ago* Reject durations containing invalid characters (like "1day" instead of "1d").
ThiefMaster [Fri, 6 Apr 2007 22:06:24 +0000 (00:06 +0200)]
* Reject durations containing invalid characters (like "1day" instead of "1d").
* Add duration to opserv.block.

16 years agoDo not display account notes to non-staff.
ThiefMaster [Fri, 6 Apr 2007 13:05:05 +0000 (15:05 +0200)]
Do not display account notes to non-staff.

16 years agoFix unreg_{notice,privmsg}_func().
Michael Poole [Wed, 23 May 2007 02:39:39 +0000 (22:39 -0400)]
Fix unreg_{notice,privmsg}_func().

proto.h: Remove the useless second parameter.
proto-bahamut.c: Implement the functions.
proto-p10.c: Make them non-buggy.

17 years agoUse appropriate upper bounds for account searches.
Michael Poole [Sun, 1 Apr 2007 00:27:50 +0000 (20:27 -0400)]
Use appropriate upper bounds for account searches.

src/nickserv.c (nickserv_discrim_create): Set max_level and lastseen to
    more appropriate values.

17 years agoFix DNR searching for globs.
Michael Poole [Sat, 31 Mar 2007 17:52:13 +0000 (13:52 -0400)]
Fix DNR searching for globs.

src/chanserv.c (dnr_search_matches): Fix the order of arguments to
    match_ircglob().

17 years agoUse correct free functions for blacklist dicts.
Michael Poole [Sat, 31 Mar 2007 17:26:31 +0000 (13:26 -0400)]
Use correct free functions for blacklist dicts.

src/mod-blacklist.c (blacklist_conf_read): Use dnsbl_zone_free() to free
    zone structures, and free() to free blacklist reasons, rather than
    vice versa.

17 years agoAdd "dnrsearch count" action.
Michael Poole [Sat, 31 Mar 2007 17:24:56 +0000 (13:24 -0400)]
Add "dnrsearch count" action.

src/chanserv.c (dnr_count_func): New function.
  (cmd_dnrsearch): Recognize it.
  (init_chanserv): Register it.

src/chanserv.help (DNRSEARCH ACTION): Document it.

17 years agoFor giveownership to new members, give old owner access 499 instead of 400.
Michael Poole [Sat, 31 Mar 2007 17:20:19 +0000 (13:20 -0400)]
For giveownership to new members, give old owner access 499 instead of 400.

src/chanserv.c (cmd_giveownership): When the new user did not exist, give
  them UL_OWNER-1 (499) access rather than UL_COOWNER, so that when the
  access levels are swapped later, the previous owner ends up with 499.

17 years agoNickServ "notes" command, "oset <command>" restriction, fakehost searching.
Michael Poole [Sat, 31 Mar 2007 17:15:52 +0000 (13:15 -0400)]
NickServ "notes" command, "oset <command>" restriction, fakehost searching.

src/nickserv.c (msgtab): New entries for the "notes" command.
  (cmd_notes): New function to show notes for an account.
  (cmd_oset): Check access for subcommands.
  (struct nickserv_discrim): New "fakehostmask" field.
  (nickserv_discrim_create): Set it.
  (nickserv_discrim_match): Check against it.
  (init_nickserv): Register NOTES and OSET KARMA commands.

src/nickserv.help (SEARCH CRITERIA): Mention FAKEHOST and KARMA options.

17 years agoAdd typecast to avoid a warning from some buggy Gentoo version of gcc.
Michael Poole [Sat, 31 Mar 2007 16:11:28 +0000 (12:11 -0400)]
Add typecast to avoid a warning from some buggy Gentoo version of gcc.

src/mod-blacklist.c (do_expandos): Typecast an expression that is
  supposed to have type size_t (which is unsigned) to unsigned.

17 years agoAvoid crashing in chanserv_is_dnr() when handle == NULL.
Michael Poole [Sat, 31 Mar 2007 16:09:25 +0000 (12:09 -0400)]
Avoid crashing in chanserv_is_dnr() when handle == NULL.

17 years agoAdd missing newline to "Forking into the background" display.
Michael Poole [Sat, 31 Mar 2007 16:09:03 +0000 (12:09 -0400)]
Add missing newline to "Forking into the background" display.

17 years agoReplace ChangeLog appropriately.
Michael Poole [Fri, 30 Mar 2007 01:48:22 +0000 (21:48 -0400)]
Replace ChangeLog appropriately.
Make "version git" work in addition to "version arch".

17 years agoAdd an asynchronous resolver library.
Michael Poole [Mon, 19 Mar 2007 03:05:55 +0000 (23:05 -0400)]
Add an asynchronous resolver library.

src/Makefile.am: Add sar.* to the build.
src/main.c: Call sar_init().
src/sar.*: The srvx asynchronous resolver.
src/mod-blacklist.c: Use it to add DNSBL support.
srvx.conf.eaxmple: Document the DNSBL support and sar options.

17 years agoAdd file-based IP blacklist module.
Michael Poole [Sun, 18 Mar 2007 17:36:31 +0000 (13:36 -0400)]
Add file-based IP blacklist module.

src/mod-blacklist.c: New module.

srvx.conf.example: Document its configuration options.

17 years agoRemove unnecessary #include from proto.h
Michael Poole [Sun, 18 Mar 2007 17:33:43 +0000 (13:33 -0400)]
Remove unnecessary #include from proto.h

src/proto.h: We no longer need to #include <netinet/in.h>, so don't.

17 years agoGet rid of srvx-broadcast announcements. (They do not scale.)
Michael Poole [Sun, 18 Mar 2007 14:42:49 +0000 (10:42 -0400)]
Get rid of srvx-broadcast announcements.  (They do not scale.)

src/global.h (MESSAGE_RECIPIENT_ANNOUNCE): Remove.

src/global.c (KEY_ANNOUNCEMENTS_DEFAULT): Remove.
  (global_conf): Remove announcements_default field.
  (message_create): Do not recognize "announce[ment]" target.
  (messageType): Remove MESSAGE_RECIPIENT_ANNOUNCE condition.
  (message_send): Remove MESSAGE_RECIPIENT_ANNOUNCE condition.
  (cmd_notice): Do not recognize "announce[ment]" target.
  (global_conf_read): Do not look up announcements_default key.

src/global.help (TARGET): Remove ANNOUNCEMENT target.

src/nickserv.h (struct handle_info): Remove announcements field.

src/nickserv.c (KEY_ANNOUNCEMENTS): Remove.
  ("NSMSG_INVALID_ANNOUNCE"): Remove.
  ("NSMSG_SET_ANNOUNCEMENTS"): Remove.
  (register_handle): Do not assign to hi->announcements.
  (set_list): Remove ANNOUNCEMENTS from the default list.
  (opt_announcements): Remove.
  (nickserv_saxdb_write): Remove announcements code.
  (nickserv_db_read_handle): Remove announcements code.
  (init_nickserv): Do not register opt_announcements function.

nickserv.help (SET): Remove ANNOUNCEMENTS option.

17 years agoTweak default access restrictions for "set unreviewed *".
Michael Poole [Sun, 18 Mar 2007 14:37:58 +0000 (10:37 -0400)]
Tweak default access restrictions for "set unreviewed *".

src/chanserv.c (init_chanserv): Default "set unreviewed on" to +helping
  and "set unreviewed off" to +oper.

17 years agoAdd "unreviewed" flag for channels.
Michael Poole [Wed, 14 Mar 2007 02:57:20 +0000 (22:57 -0400)]
Add "unreviewed" flag for channels.

src/chanserv.c (CHANNEL_DEFAULT_FLAGS): Include "unreviewed" flag.
  (CHANNEL_PRESERVED_FLAGS): New macro for flags not reset by !set defaults
  (msgtab): New entry for "CSMSG_SET_UNREVIEWED".
  (chanserv_search_create): Recognize "unreviewed" flag.
  (chan_opt_unreviewed): New function.
  (chan_opt_defaults): Preserve CHANNEL_PRESERVED_FLAGS.
  (cmd_set): Act like cmd_joiner with respect to updating argv.
  (init_chanserv): Register unreviewed option and its subcommands.

src/chanserv.h (CHANNEL_UNREVIEWED): New flag.

src/chanserv.help: Update documentation for SEARCH and SET.

17 years agoAdd trace-style DNR searching capabilities.
Michael Poole [Wed, 14 Mar 2007 02:03:49 +0000 (22:03 -0400)]
Add trace-style DNR searching capabilities.

src/chanserv.c (msgtab): Separate DNR info strings for easier translation.
    Add DNR bad-action and search results strings.
  (dnr_print_func): New function to reduce code duplication.
  (chanserv_show_dnrs): Use dnr_print_func() instead of doing the display
    in this function.
  (send_dnrs): Likewise.
  (cmd_allowregister): Simplify checks for DNR existence and removal.
  (struct dnr_search): New type.
  (dnr_search_matches): New function.
  (dnr_search_create): New function.
  (dnr_search_func): New typedef.
  (dnr_search): New function.
  (dnr_remove_func): New function.
  (cmd_dnrsearch): New function.
  (init_chanserv): Register dnrsearch and its subcommands.

src/chanserv.help: Document DNRSEARCH command.

17 years agoFix a few parsing bugs in search bounds.
Michael Poole [Mon, 12 Mar 2007 03:48:29 +0000 (23:48 -0400)]
Fix a few parsing bugs in search bounds.

src/log.c (log_discrim_create): Do not skip parts of the time period if
    the interval is given with no prefix.
src/opserv.c (opserv_discrim_create): Likewise.
  (opserv_cdiscrim_create): Likewise.

17 years agoTweak DNR expiration code for aesthetics.
Michael Poole [Tue, 27 Feb 2007 02:26:35 +0000 (21:26 -0500)]
Tweak DNR expiration code for aesthetics.

src/chanserv.c (CSMSG_DNR_INFO_SET): Add missing "ago".
  (chanserv_find_dnrs): Add "max" argument.  Revise to remove expired
    DNRs as they are found.
  (chanserv_show_dnrs): Exploit the above.
  (chanserv_is_dnr): Use chanserv_find_dnrs(), removing lots of nearly
    duplicated code.
  (send_dnrs): New function to send unexpired DNRs from one dict.
  (cmd_noregister): Use send_dnrs() to merge duplicated code.
  (write_dnrs_helper): Remove expired DNRs here.

17 years agoAdded expire time for DNRs.
ThiefMaster [Mon, 26 Feb 2007 19:43:23 +0000 (20:43 +0100)]
Added expire time for DNRs.

17 years agoAdd account karma support.
Michael Poole [Mon, 12 Mar 2007 02:30:30 +0000 (22:30 -0400)]
Add account karma support.

src/nickserv.*: Add new karma account option.

17 years agoAdd saxdb_write_sint() to handle signed values.
Michael Poole [Mon, 12 Mar 2007 02:29:54 +0000 (22:29 -0400)]
Add saxdb_write_sint() to handle signed values.

src/saxdb.* (saxdb_write_sint): New function.

17 years agoAdd account notes.
Michael Poole [Sun, 11 Mar 2007 23:23:20 +0000 (19:23 -0400)]
Add account notes.

src/nickserv.h (struct handle_note): New structure.
  (struct handle_info): Add field to point to account's notes.

src/nickserv.c (KEY_NOTE*): New configuration key macros.
  (WALK_NOTES): New macro to make a single pass through notes while
    deleting ones that have expired.
  (msgtab): Add entries to support commands related to account notes.
  (free_handle_info): Release notes on an account.
  (cmd_handleinfo): Show notes, or say there are none.
  (cmd_addnote): New command-handler function.
  (cmd_delnote): New command-handler function.
  (nickserv_saxdb_write): Write notes to the database.
  (nickserv_db_read_handle): Read notes from the database.
  (init_nickserv): Register new functions.

src/nickserv.help (ADDNOTE): Document new command.
  (DELNOTE): Likewise.

17 years agoClose qserver listener when exiting.
Michael Poole [Sun, 11 Mar 2007 22:22:17 +0000 (18:22 -0400)]
Close qserver listener when exiting.

src/mod-qserver.c (qserver_conf_read): Close qserver_listener.

17 years agoRelease his_servername and his_servercomment on termination.
Michael Poole [Sun, 11 Mar 2007 22:14:29 +0000 (18:14 -0400)]
Release his_servername and his_servercomment on termination.

src/proto-p10.c (parse_cleanup): Free two strings allocated in this file.

17 years agoRearrange early init printouts to not try to use log_module().
Michael Poole [Sun, 11 Mar 2007 22:13:54 +0000 (18:13 -0400)]
Rearrange early init printouts to not try to use log_module().

src/main.c (main): Before log_init() is called and we register MAIN_LOG,
  we cannot log using it -- so do not try to.

17 years agoRestore checks for WITH_PROTOCOL_BAHAMUT.
Michael Poole [Sun, 11 Mar 2007 19:53:56 +0000 (15:53 -0400)]
Restore checks for WITH_PROTOCOL_BAHAMUT.

17 years agoFix typo for "accepted" in PCMSG_STATUS_ACCEPTED.
Michael Poole [Sun, 11 Mar 2007 19:42:57 +0000 (15:42 -0400)]
Fix typo for "accepted" in PCMSG_STATUS_ACCEPTED.

src/mod-sockcheck.c (msgtab): Spell "accepted" correctly.

17 years agoAvoid possible one-byte overrun in ioset_line_read().
Michael Poole [Sun, 11 Mar 2007 15:59:07 +0000 (11:59 -0400)]
Avoid possible one-byte overrun in ioset_line_read().

src/ioset.c (ioset_line_read): We can safely overwrite dest[max-1] to
  terminate the buffer.  Also return the available line length, rather
  than the number of bytes written to the buffer.

17 years agoMake prettier git versions.
Michael Poole [Sun, 11 Mar 2007 15:36:31 +0000 (11:36 -0400)]
Make prettier git versions.

src/Makefile.am (checkversion): Use "git describe" to get the git version.

17 years agosrc/mail-sendmail.c: Move #include "mail-common.c" up a few lines.
Michael Poole [Sun, 11 Mar 2007 15:18:25 +0000 (11:18 -0400)]
src/mail-sendmail.c: Move #include "mail-common.c" up a few lines.

17 years agoClean up protocol and mail backend selection.
Michael Poole [Sun, 11 Mar 2007 15:17:57 +0000 (11:17 -0400)]
Clean up protocol and mail backend selection.

configure.in: Allow easier selection of protocol and mail backends.

17 years agoSplit sendmail into common and sendmail-specific portions.
Michael Poole [Thu, 8 Mar 2007 00:52:57 +0000 (19:52 -0500)]
Split sendmail into common and sendmail-specific portions.

This is in preparation for an SMTP alternative to the current code.

17 years agoSet quit_services based on WM_QUIT wParam under Windows.
Michael Poole [Wed, 7 Mar 2007 05:19:27 +0000 (00:19 -0500)]
Set quit_services based on WM_QUIT wParam under Windows.

17 years agoCheck for additional functions during configure.
Michael Poole [Wed, 7 Mar 2007 05:19:10 +0000 (00:19 -0500)]
Check for additional functions during configure.

If the operating system does not provide gai_strerror(), we must.
If the OS does not have a Unix-ish times(), we can use GetProcessTimes().
Update config.h.win32 based on the new configure script.

17 years agoRearrange main*.c and linking for Win32 target.
Michael Poole [Wed, 7 Mar 2007 05:16:10 +0000 (00:16 -0500)]
Rearrange main*.c and linking for Win32 target.

Split main.c into two files (main-common.c and the old main.c).
Add main-win32.c to handle the Win32-specific parts.

17 years agoFinish ioset-win32 (not yet tested).
Michael Poole [Tue, 6 Mar 2007 04:43:42 +0000 (23:43 -0500)]
Finish ioset-win32 (not yet tested).

compat.h: Define BSD socket errors in terms of Windows socket errors.
config.h.win32: Fix typo in PACKAGE_STRING.
ioset-win32.c: Implement most of this file.
ioset.c: Ifdef out the fcntl() calls to make Windows happier.

17 years agoStop tracking files from autotools.
Michael Poole [Sun, 25 Feb 2007 22:57:06 +0000 (17:57 -0500)]
Stop tracking files from autotools.

autogen.sh: Add libtoolize; update arguments for aclocal and automake.
.gitignore: Ignore the files added by libtoolize and automake.
Delete those files from the repository.

17 years agoAdd new ChangeLog, reflecting git commit history
Michael Poole [Wed, 24 Jan 2007 20:27:30 +0000 (15:27 -0500)]
Add new ChangeLog, reflecting git commit history

17 years agoDelete ChangeLog file
Michael Poole [Wed, 24 Jan 2007 20:19:58 +0000 (15:19 -0500)]
Delete ChangeLog file

17 years agoRemove .cvsignore files; replace with .gitignore as needed.
Michael Poole [Wed, 24 Jan 2007 16:05:34 +0000 (11:05 -0500)]
Remove .cvsignore files; replace with .gitignore as needed.
Remove rx/Makefile.in, since there is a Makefile.am there.
Update src/Makefile.am and src/modcmd.c to work with git.

17 years agoDelete binary files that were committed (by git archimport?) and more
Michael Poole [Wed, 24 Jan 2007 02:57:48 +0000 (21:57 -0500)]
Delete binary files that were committed (by git archimport?) and more
Arch droppings.

17 years agoDelete {arch} directory since git does not use it.
Michael Poole [Wed, 24 Jan 2007 02:37:09 +0000 (21:37 -0500)]
Delete {arch} directory since git does not use it.

17 years agoDelete {arch} directory since git does not use it.
Michael Poole [Wed, 24 Jan 2007 02:36:42 +0000 (21:36 -0500)]
Delete {arch} directory since git does not use it.

17 years agoAvoid epoll_ctl(..., EPOLL_CTL_DEL, ...) for closed fds.
Michael Poole [Mon, 8 Jan 2007 04:27:45 +0000 (04:27 +0000)]
Avoid epoll_ctl(..., EPOLL_CTL_DEL, ...) for closed fds.

src/ioset-impl.h (struct io_engine): Add "os_closed" parameter to
    remove() method.

src/ioset.c (ioset_close): Add this to the call.

src/ioset-epoll.c (ioset_epoll_remove): Use it to avoid removing the fd
    from epoll_fd, since that epoll_ctl() call will always fail.

src/ioset-select.c (ioset_select_remove): Ignore the new parameter.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-81

17 years agoSkip reporting mondo db sections in ?stats databases.
Michael Poole [Mon, 8 Jan 2007 04:22:20 +0000 (04:22 +0000)]
Skip reporting mondo db sections in ?stats databases.

src/saxdb.c (cmd_stats_databases): Only show entries for databases that
    have their own file; skip sections of "mondo".
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-80

17 years agoFix SourceForge bug #1629748
Michael Poole [Mon, 8 Jan 2007 04:11:56 +0000 (04:11 +0000)]
Fix SourceForge bug #1629748

src/chanserv.c (cmd_adduser): Include suspended users in check for
    pre-existing channel access for the user being added.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-79

17 years agoAllow last account mask to be deleted with odelmask.
Michael Poole [Sat, 23 Dec 2006 05:50:25 +0000 (05:50 +0000)]
Allow last account mask to be deleted with odelmask.

src/nickserv.c (nickserv_delmask): Add parameter to distinguish between
    normal and override use.
  (cmd_delmask): Pass the new argument.
  (cmd_odelmask): Likewise.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-78

17 years agoProperly handle overrides in !wipeinfo.
Michael Poole [Sat, 23 Dec 2006 05:40:12 +0000 (05:40 +0000)]
Properly handle overrides in !wipeinfo.

src/chanserv.c (cmd_wipeinfo): Allow real_actor to be null.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-77

17 years agoRevert miscommitted file from patch-73.
Michael Poole [Sat, 23 Dec 2006 05:38:37 +0000 (05:38 +0000)]
Revert miscommitted file from patch-73.

src/proto-common.c: Revert accidentally committed patch.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-76

17 years agoAllow extra arguments to privmsg and notice.
Michael Poole [Sat, 23 Dec 2006 05:37:07 +0000 (05:37 +0000)]
Allow extra arguments to privmsg and notice.

src/proto-p10.c (cmd_privmsg): Allow extra arguments between target and
    text.
  (cmd_notice): Likewise.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-75

17 years agoFix typo in "gtrace criteria" help entry.
Michael Poole [Sat, 23 Dec 2006 05:35:29 +0000 (05:35 +0000)]
Fix typo in "gtrace criteria" help entry.

src/opserv.help (gtrace criteria): Fix capitalization of $b tag.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-74

17 years agoFix typo in "gtrace criteria" help entry.
Michael Poole [Sat, 23 Dec 2006 05:33:28 +0000 (05:33 +0000)]
Fix typo in "gtrace criteria" help entry.

src/opserv.help (gtrace criteria): Fix capitalization of $b tag.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-73

17 years agoAllow NickServ to learn hostmasks automatically.
Michael Poole [Sat, 23 Dec 2006 05:31:56 +0000 (05:31 +0000)]
Allow NickServ to learn hostmasks automatically.

src/nickserv.c (nickserv_addmask): Declare early.
  (cmd_oregister): Allow oper to omit fourth parameter, to set no
    hostmask.
  (cmd_auth): On success, add user's hostmask if the account's hostmask
    list is empty.
  (cmd_cookie): Append hostmask to account on successful allowauth.
  (init_nickserv): Update merge command access.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-72

17 years agoUpdate PostgreSQL patch schema.
Michael Poole [Sat, 23 Dec 2006 05:27:23 +0000 (05:27 +0000)]
Update PostgreSQL patch schema.

patches/log-pgsql.txt: Update to include HelpServ tables.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-71

17 years agoFix typo in MODE_APASS generation.
Michael Poole [Sat, 23 Dec 2006 05:11:47 +0000 (05:11 +0000)]
Fix typo in MODE_APASS generation.

src/proto-p10.c (mod_chanmode_announce): Fix typo.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-70

17 years agoDon't re-allocated a language that already exists.
Michael Poole [Fri, 27 Oct 2006 01:59:57 +0000 (01:59 +0000)]
Don't re-allocated a language that already exists.

src/helpfile.c (language_read_list): If the language already exists, do
    not allocate it anew.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-69

17 years agoRemove ioset engine update call that could read after free().
Michael Poole [Fri, 27 Oct 2006 01:25:18 +0000 (01:25 +0000)]
Remove ioset engine update call that could read after free().

src/ioset.c (ioset_connect): If the connect fails immediately, do not try
    to update the fd after closing it.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-68

17 years agoAllow languages/strings.db to override builtin strings.
Michael Poole [Fri, 27 Oct 2006 01:06:02 +0000 (01:06 +0000)]
Allow languages/strings.db to override builtin strings.

src/helpfile.c (language_read): Add space before "parent".
  (language_read_list): Explicitly skip the file named "strings.db".
  (helpfile_read_languages): New function.
  (helpfile_finalize): Register it as a conf-reload function.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-67

17 years agoSupport +I while we're adding modes (part 2) - the missing files.
Michael Poole [Fri, 27 Oct 2006 00:47:30 +0000 (00:47 +0000)]
Support +I while we're adding modes (part 2) - the missing files.

src/opserv.c (cmd_whois): Test no-idle mode.

src/proto-p10.c (irc_user): Check for no-idle mode.
  (mod_usermode): Check for +I flag.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-66

17 years agoSupport +I while we're adding modes..
Michael Poole [Fri, 27 Oct 2006 00:44:35 +0000 (00:44 +0000)]
Support +I while we're adding modes..

src/hash.c (FLAGS_NOIDLE): New macro for +I (hide idle time) mode.
   (IsNoIdle): New macro to test it.

src/opserv.c (cmd_whois): Test no-idle mode.

src/proto-p10.c (irc_user): Check for no-idle mode.
  (mod_usermode): Check for +I flag.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-65

17 years agoMake maintainer-mode use C89 mode.
Michael Poole [Fri, 27 Oct 2006 00:35:00 +0000 (00:35 +0000)]
Make maintainer-mode use C89 mode.

configure.in (CFLAGS): Use -ansi in maintainer mode.
  (AC_C_INLINE): Test after setting -Werror.

src/chanserv.c (cmd_adduser): Fix comment formatting.
  (cmd_clvl): Likewise.
  (cmd_deluser): Likewise.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-64

17 years agoPull ThiefMaster's patch-3..5.
Michael Poole [Fri, 27 Oct 2006 00:21:32 +0000 (00:21 +0000)]
Pull ThiefMaster's patch-3..5.

Patches applied:

 * thiefmaster@gamesurge.net--2006/srvx--devo--1.3--base-0
   tag of srvx@srvx.net--2006/srvx--devo--1.3--patch-58

 * thiefmaster@gamesurge.net--2006/srvx--devo--1.3--patch-3
   Implement complete remote whois.

 * thiefmaster@gamesurge.net--2006/srvx--devo--1.3--patch-4
   Improve override logging and ignore godmode in !trim.

 * thiefmaster@gamesurge.net--2006/srvx--devo--1.3--patch-5
   Announce ounregisters to staff via Global.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-63

17 years agoAllow 900+ users to get full accountinfo.
Michael Poole [Thu, 26 Oct 2006 23:44:10 +0000 (23:44 +0000)]
Allow 900+ users to get full accountinfo.

src/nickserv.c (cmd_handleinfo): Check for opserv access before checking
    for an outranked oper.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-62

17 years agoFix irc_pton() sense for hostscan command.
Michael Poole [Thu, 26 Oct 2006 23:41:14 +0000 (23:41 +0000)]
Fix irc_pton() sense for hostscan command.

src/mod-sockcheck.c (cmd_hostscan): Fix test for irc_pton() return value.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-61

17 years agoVarious I/O cleanups and fixes.
Michael Poole [Sat, 21 Oct 2006 16:06:47 +0000 (16:06 +0000)]
Various I/O cleanups and fixes.

src/ioset.c (ioset_add): Set FD_CLOEXEC flag on all managed sockets.
  (ioset_try_write): Tidy formatting.
  (ioset_close): Add another bit to "os_close".

src/proto-common.c (close_socket): Pass the new bit to ioset_close().
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-60

17 years agoAdd 'tell' command; update copyright message.
Michael Poole [Sat, 21 Oct 2006 16:04:19 +0000 (16:04 +0000)]
Add 'tell' command; update copyright message.

src/modcmd.c (cmd_version): Update copyright years.  Move the multi-line
    credits to a separate message and make it actually send properly.
  (cmd_tell): New command.
  (modcmd_init): Register cmd_tell.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-59

17 years agoFix a (tiny) memory leak in mod-sockcheck.c.
Michael Poole [Sat, 7 Oct 2006 00:03:52 +0000 (00:03 +0000)]
Fix a (tiny) memory leak in mod-sockcheck.c.

src/mod-sockcheck.c (sockcheck_begin_test): Make io_fd assignment
    clearer.
  (sockcheck_read_conf): Free the addrinfo we get.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-58

17 years agoFix sending P10 bursts with many bans.
Michael Poole [Fri, 6 Oct 2006 23:18:58 +0000 (23:18 +0000)]
Fix sending P10 bursts with many bans.

src/proto-p10.c (irc_burst): Only send modes and user list once.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-57

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