]> jfr.im git - irc/srvx.git/log
irc/srvx.git
15 months agoAvoid buffer overflow with 64-bit long. master
Michael Poole [Thu, 23 Feb 2023 02:50:48 +0000 (21:50 -0500)] 
Avoid buffer overflow with 64-bit long.

15 months agoFix Darwin / clang harder
Michael Poole [Thu, 23 Feb 2023 02:46:30 +0000 (21:46 -0500)] 
Fix Darwin / clang harder

Clang apparently doesn't like "static inline", so just remove "inline".

15 months agoFix compilation under Darwin
Michael Poole [Thu, 23 Feb 2023 02:39:56 +0000 (21:39 -0500)] 
Fix compilation under Darwin

AC_C_INLINE with -Werror caused the configure check to fail and #define
inline away. This caused <ctype.h> to define various functions like
isspace() in multiple translation units, leading to link errors because those
symbols were defined in multiple files.

3 years agoFix more Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:37:50 +0000 (17:37 -0400)] 
Fix more Coverity warnings

3 years agostring_buffer_append_substring: Allocate space for NUL terminator
Michael Poole [Sun, 28 Jun 2020 21:15:35 +0000 (17:15 -0400)] 
string_buffer_append_substring: Allocate space for NUL terminator

3 years agoslab-read: Close the log file after we finish reading it
Michael Poole [Sun, 28 Jun 2020 21:15:19 +0000 (17:15 -0400)] 
slab-read: Close the log file after we finish reading it

3 years agosar: Plug some memory leaks
Michael Poole [Sun, 28 Jun 2020 21:14:55 +0000 (17:14 -0400)] 
sar: Plug some memory leaks

3 years agoparse_record_int: Do not leak memory on ABORT() calls
Michael Poole [Sun, 28 Jun 2020 21:14:44 +0000 (17:14 -0400)] 
parse_record_int: Do not leak memory on ABORT() calls

3 years agoproto-p10: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:14:24 +0000 (17:14 -0400)] 
proto-p10: Fix Coverity warnings

irc_p10_ntop: Check ii < 8 before reading ip->in6[ii].
irc_numeric: Add missing va_end(arg_list).
cmd_burst: Check that the numnick is at least 4 digits long.
cmd_num_gline: Remove redundant check for (argc > 5).

3 years agoproto-common: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:13:19 +0000 (17:13 -0400)] 
proto-common: Fix Coverity warnings

cmd_stats: Fix format string types.
mod_chanmode_apply: Move free(bn), solely to make Coverity happy.

3 years agoopserv: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:12:37 +0000 (17:12 -0400)] 
opserv: Fix Coverity warnings

opserv_join_check: Don't opserv_alert() if we don't have an OpServ.
add_user_alert: Ignore alerts with no discriminators.
opserv_discrim_search: Handle the case when there are multiple channels
  and the user is not in the later channels.

3 years agonickserv.c: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:08:42 +0000 (17:08 -0400)] 
nickserv.c: Fix Coverity warnings

nickserv_modify_handle_flags: Don't send_message(NULL, ...).
nickserv_define_func: Fix what looks like a typo.

3 years agomodcmd: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:07:44 +0000 (17:07 -0400)] 
modcmd: Fix Coverity warnings

svccmd_invoke_argv: new_argv must be static for us to use it as argv.
cmd_command: Make sure we never run past the end of HANDLE_FLAGS[].
modcmd_describe_command: Don't overrun buffers if MSG_NONE is too large.
cmd_joiner: cmdname must be static for us to use it in argv.
modcmd_saxdb_write_command: If the command has flags but don't know any of
  them, write "???" instead.
modcmd_load_bots: Don't overrun bot hostnames.
service_make_alias: Check for an empty alias.
import_aliases_db: Plug a memory leak.

3 years agosockcheck: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 21:02:41 +0000 (17:02 -0400)] 
sockcheck: Fix Coverity warnings

sockcheck_readable: Die if we get a bad template.
sockcheck_queue_address: Make sure Coverity knows we won't overrun
  sci->hostname[].
sockcheck_create_response: The "&& end" was spurious.
sockcheck_add_test: Plug some memory leaks.

3 years agouplink_insert(): Require a hostname to enable an uplink
Michael Poole [Sun, 28 Jun 2020 21:00:52 +0000 (17:00 -0400)] 
uplink_insert(): Require a hostname to enable an uplink

3 years agolog: Warn if a log name is too long
Michael Poole [Sun, 28 Jun 2020 21:00:30 +0000 (17:00 -0400)] 
log: Warn if a log name is too long

3 years agohelpfile: Avoid division by zero
Michael Poole [Sun, 28 Jun 2020 21:00:17 +0000 (17:00 -0400)] 
helpfile: Avoid division by zero

3 years agochanserv: Fix Coverity warnings
Michael Poole [Sun, 28 Jun 2020 20:56:34 +0000 (16:56 -0400)] 
chanserv: Fix Coverity warnings

bad_channel_ban: It doesn't like deref'ing *victimCount after checking if
  it was null.  We only care about the output parameters on success.
eject_user: Our earlier code assumes ban is not null, so don't check it.
cmd_set: buf has to be static so that we can save it in argv[].
chanserv_conf_read: Don't leak change.
chanserv_read_suspended: Don't try to strdup(NULL).

4 years agomod-iauth_loc: Use correct size for user.ident and user.hostname.
Michael Poole [Wed, 22 Apr 2020 18:33:23 +0000 (14:33 -0400)] 
mod-iauth_loc: Use correct size for user.ident and user.hostname.

4 years agoproto-p10: Simplify assignments to make_numeric's outbuf
Michael Poole [Wed, 22 Apr 2020 18:32:52 +0000 (14:32 -0400)] 
proto-p10: Simplify assignments to make_numeric's outbuf

4 years agomod-helpserv: Reduce size of some strftime() buffers.
Michael Poole [Wed, 11 Sep 2019 01:15:39 +0000 (21:15 -0400)] 
mod-helpserv: Reduce size of some strftime() buffers.

gcc 8.3 and glibc 2.29 complain about these possibly overflowing later
snprintf() calls.

6 years agosar_getaddr_request: Avoid truncation to full_name.
Michael Poole [Wed, 31 Jan 2018 04:16:02 +0000 (23:16 -0500)] 
sar_getaddr_request: Avoid truncation to full_name.

6 years agoPacify gcc 7's -Wimplicit-fallthrough.
Michael Poole [Wed, 31 Jan 2018 04:15:43 +0000 (23:15 -0500)] 
Pacify gcc 7's -Wimplicit-fallthrough.

6 years agomod-iauth_loc: Tell users if their account is suspended.
Michael Poole [Wed, 31 Jan 2018 04:00:43 +0000 (23:00 -0500)] 
mod-iauth_loc: Tell users if their account is suspended.

7 years agonickserv: Add flag to remotely oper up clients.
Michael Poole [Tue, 2 May 2017 01:54:04 +0000 (21:54 -0400)] 
nickserv: Add flag to remotely oper up clients.

This requires ircd support, e.g. u2.10.12.15 with a config block like:
  UWorld { oper = "srvx.example.org"; };

7 years agoMove do_expandos() to tools.c/common.h.
Michael Poole [Fri, 3 Mar 2017 02:38:06 +0000 (21:38 -0500)] 
Move do_expandos() to tools.c/common.h.

7 years agoiauth_loc: Do not dereference null handle_info pointer.
Michael Poole [Tue, 25 Oct 2016 03:22:43 +0000 (23:22 -0400)] 
iauth_loc: Do not dereference null handle_info pointer.

7 years agonickserv: Remove extraneous byte from struct handle_info.
Michael Poole [Mon, 17 Oct 2016 03:34:10 +0000 (23:34 -0400)] 
nickserv: Remove extraneous byte from struct handle_info.

MD5_CRYPT_LENGTH already includes the null terminator byte.

7 years agomod-blacklist: Fix typo in comment.
Michael Poole [Mon, 17 Oct 2016 03:33:37 +0000 (23:33 -0400)] 
mod-blacklist: Fix typo in comment.

7 years agosha256: Output using big-endian byte ordering.
Michael Poole [Mon, 17 Oct 2016 03:33:24 +0000 (23:33 -0400)] 
sha256: Output using big-endian byte ordering.

Most test vectors on the Internet use big-endian ordering.
cryptpass_sha256() uses Z85 encoding for big-endian SHA-256 output.

7 years agotools: Add Z85 (Ascii85 variant) encoder and decoder.
Michael Poole [Mon, 17 Oct 2016 03:31:15 +0000 (23:31 -0400)] 
tools: Add Z85 (Ascii85 variant) encoder and decoder.

7 years agocmd_opmode: Support OPMODE <user> +o.
Michael Poole [Thu, 13 Oct 2016 03:31:58 +0000 (23:31 -0400)] 
cmd_opmode: Support OPMODE <user> +o.

7 years agosha256: New hash function for passwords.
Michael Poole [Wed, 28 Sep 2016 02:03:21 +0000 (22:03 -0400)] 
sha256: New hash function for passwords.

7 years agoblacklist: Fix potential memory leak (#15)
Static [Wed, 14 Sep 2016 19:37:10 +0000 (15:37 -0400)] 
blacklist: Fix potential memory leak (#15)

Use realloc() instead. In the event we get multiple TXT
records, we just reallocate on top of that instead of leaking
the last result.

7 years agoblacklist: Fix null terminator being improperly placed
staticfox [Tue, 13 Sep 2016 23:58:19 +0000 (19:58 -0400)] 
blacklist: Fix null terminator being improperly placed

Also avoid undefined behavior

7 years agoMakefile: Fix HAS_GIT even more.
Michael Poole [Thu, 8 Sep 2016 04:06:49 +0000 (00:06 -0400)] 
Makefile: Fix HAS_GIT even more.

Out-of-tree builds would fail.

7 years agoproto-p10: Fail BURST on invalid channel names.
Michael Poole [Thu, 1 Sep 2016 13:51:26 +0000 (09:51 -0400)] 
proto-p10: Fail BURST on invalid channel names.

7 years agoMakefile.am: Fix default target name.
Michael Poole [Thu, 1 Sep 2016 13:50:44 +0000 (09:50 -0400)] 
Makefile.am: Fix default target name.

7 years agoconfigure.ac: Only set HAS_GIT if gitdir exists.
Michael Poole [Thu, 1 Sep 2016 13:50:24 +0000 (09:50 -0400)] 
configure.ac: Only set HAS_GIT if gitdir exists.

7 years agoMakefile: Pass "make distcheck".
Michael Poole [Thu, 25 Aug 2016 01:28:03 +0000 (21:28 -0400)] 
Makefile: Pass "make distcheck".

7 years agoMakefile: Remove mention of non-existent UPGRADE file.
Michael Poole [Wed, 24 Aug 2016 03:34:43 +0000 (23:34 -0400)] 
Makefile: Remove mention of non-existent UPGRADE file.

7 years agoproto-p10: Avoid errors triggered by maintainer mode.
Michael Poole [Wed, 24 Aug 2016 03:33:47 +0000 (23:33 -0400)] 
proto-p10: Avoid errors triggered by maintainer mode.

7 years agohelp: Use modes that actually exist in csearch
Static [Wed, 20 Jul 2016 21:37:48 +0000 (17:37 -0400)] 
help: Use modes that actually exist in csearch

7 years agonickserv: Allow renaming handles to new casings
staticfox [Wed, 13 Jul 2016 02:19:10 +0000 (22:19 -0400)] 
nickserv: Allow renaming handles to new casings

8 years agounsplit_string(): Be even more graceful. *cough*
Michael Poole [Mon, 16 May 2016 02:31:54 +0000 (22:31 -0400)] 
unsplit_string(): Be even more graceful.  *cough*

8 years agounsplit_string(): Gracefully handle max == 0.
Michael Poole [Mon, 16 May 2016 02:25:15 +0000 (22:25 -0400)] 
unsplit_string(): Gracefully handle max == 0.

8 years agoproto-p10: Fix burst syntax for channels with bans but no users.
Michael Poole [Mon, 16 May 2016 01:45:05 +0000 (21:45 -0400)] 
proto-p10: Fix burst syntax for channels with bans but no users.

8 years agoRemove references to StrictOp, AutoOp, Voice
staticfox [Fri, 6 May 2016 03:46:03 +0000 (23:46 -0400)] 
Remove references to StrictOp, AutoOp, Voice

Remove these options from set_shows

Conflicts [resolved by Michael Poole]:
srvx.conf.example

8 years agoopserv: Add ?csearch "mode" criterion.
Michael Poole [Sat, 23 Apr 2016 01:25:50 +0000 (21:25 -0400)] 
opserv: Add ?csearch "mode" criterion.

8 years agoproto-p10: Support cmd_rping().
Michael Poole [Tue, 19 Apr 2016 02:52:27 +0000 (22:52 -0400)] 
proto-p10: Support cmd_rping().

This requires a new helper function, GetServerG().

8 years agomod-iauth_loc: Quash a compiler warning.
Michael Poole [Wed, 13 Apr 2016 01:41:15 +0000 (21:41 -0400)] 
mod-iauth_loc: Quash a compiler warning.

8 years agotools: Quash a compiler warning.
Michael Poole [Wed, 13 Apr 2016 01:41:01 +0000 (21:41 -0400)] 
tools: Quash a compiler warning.

8 years agoconfigure.in: Rename to configure.ac to make autoreconf happy.
Michael Poole [Wed, 13 Apr 2016 01:40:02 +0000 (21:40 -0400)] 
configure.in: Rename to configure.ac to make autoreconf happy.

8 years agomod-iauth_loc: Login failures should use AGAIN, not NO.
Michael Poole [Fri, 15 May 2015 03:41:54 +0000 (23:41 -0400)] 
mod-iauth_loc: Login failures should use AGAIN, not NO.

8 years agogitignore: Ignore config.h.in~
staticfox [Thu, 7 Apr 2016 22:30:14 +0000 (18:30 -0400)] 
gitignore: Ignore config.h.in~

8 years agoMerge pull request #9 from staticfox/mem_leak
Adrian [Tue, 12 Jan 2016 21:58:56 +0000 (22:58 +0100)] 
Merge pull request #9 from staticfox/mem_leak

opserv_cdiscrim_create(): Fix memory leak

8 years agoMerge pull request #10 from staticfox/syntax
Adrian [Tue, 12 Jan 2016 21:58:16 +0000 (22:58 +0100)] 
Merge pull request #10 from staticfox/syntax

opserv_discrim_create(): wrap argc - 1 in parentheses

8 years agoMerge pull request #11 from staticfox/listlogins
Adrian [Sat, 12 Dec 2015 19:41:29 +0000 (20:41 +0100)] 
Merge pull request #11 from staticfox/listlogins

nickserv: Add LISTLOGINS

8 years agonickserv: Add LISTLOGINS
Matt Ullman [Mon, 7 Dec 2015 21:57:51 +0000 (16:57 -0500)] 
nickserv: Add LISTLOGINS

8 years agoopserv_discrim_create(): wrap argc - 1 in parentheses
Matt Ullman [Fri, 25 Sep 2015 06:57:27 +0000 (02:57 -0400)] 
opserv_discrim_create(): wrap argc - 1 in parentheses

This is mostly to match the syntax of opserv_cdiscrim_create(),
but it does help provide clarity.

8 years agoopserv_cdiscrim_create(): Fix memory leak
Matt Ullman [Fri, 25 Sep 2015 01:53:14 +0000 (21:53 -0400)] 
opserv_cdiscrim_create(): Fix memory leak

If opserv_cdiscrim_create()'s (used in CSEARCH) parameters are
not met, it returns NULL. However, the issue is that it should be
going to the fail statement rather than simply returning NULL.
This creates the issue that discrim is never freed, where fail frees
discrim and returns null in one shot.

9 years agoMerge pull request #7 from blindirc/helpserv-pickup-helpfile
ThiefMaster [Thu, 8 Jan 2015 20:50:21 +0000 (21:50 +0100)] 
Merge pull request #7 from blindirc/helpserv-pickup-helpfile

Improve helpserv pickup help entry

9 years agoChange PICKUP's help entry to reflect its functionality
Matt Ullman [Thu, 8 Jan 2015 20:46:45 +0000 (15:46 -0500)] 
Change PICKUP's help entry to reflect its functionality

9 years agoMerge pull request #5 from blindirc/checkemail-doc
ThiefMaster [Sat, 15 Nov 2014 18:41:27 +0000 (19:41 +0100)] 
Merge pull request #5 from blindirc/checkemail-doc

Document nickserv.checkemail and nickserv.checkpass

9 years agoAdded in help for checkpass
Matt Ullman [Sat, 15 Nov 2014 18:20:48 +0000 (13:20 -0500)] 
Added in help for checkpass

9 years agoAdded in help documentation for checkemail
Matt Ullman [Fri, 14 Nov 2014 01:00:20 +0000 (20:00 -0500)] 
Added in help documentation for checkemail

9 years agoMerge pull request #3 from blindirc/gitignore
Brenton [Tue, 30 Sep 2014 16:29:47 +0000 (12:29 -0400)] 
Merge pull request #3 from blindirc/gitignore

Ignore object files when committing

9 years agoIgnore object files when committing
Matt Ullman [Tue, 23 Sep 2014 08:16:02 +0000 (04:16 -0400)] 
Ignore object files when committing

9 years agoFix persistence lines in helpserv set output
ThiefMaster [Mon, 22 Sep 2014 19:34:50 +0000 (21:34 +0200)] 
Fix persistence lines in helpserv set output

9 years agoFix invalid-interval message in HelpServ
ThiefMaster [Mon, 22 Sep 2014 19:34:21 +0000 (21:34 +0200)] 
Fix invalid-interval message in HelpServ

9 years agoBound check for intervals in mod-helpserv
Pierre Schweitzer [Thu, 28 Aug 2014 16:06:46 +0000 (18:06 +0200)] 
Bound check for intervals in mod-helpserv

This prevents integer overflow in helpserv bots configuration.
This integer overflow can lead to a srvx crash and thus to an
impossible restart without fixing the configuration manually.

See CVE-2014-5508

12 years agoAdd a login-on-connect module using XQUERY/XRESPONSE.
Michael Poole [Fri, 20 Jan 2012 02:29:15 +0000 (21:29 -0500)] 
Add a login-on-connect module using XQUERY/XRESPONSE.

12 years agoSupport ircu's XQUERY and XRESPONSE.
Michael Poole [Fri, 20 Jan 2012 02:29:02 +0000 (21:29 -0500)] 
Support ircu's XQUERY and XRESPONSE.

12 years agoFix the modules list for module names ending in c.
Michael Poole [Fri, 20 Jan 2012 02:28:39 +0000 (21:28 -0500)] 
Fix the modules list for module names ending in c.

The backslashes in the regular expression \.c\$ were not quoted enough.

12 years agoEnable silent rules for automake (requires automake 1.10 or later).
Michael Poole [Fri, 20 Jan 2012 02:27:56 +0000 (21:27 -0500)] 
Enable silent rules for automake (requires automake 1.10 or later).

12 years agoMove m4 support files into m4/ directory.
Michael Poole [Tue, 17 Jan 2012 03:06:49 +0000 (22:06 -0500)] 
Move m4 support files into m4/ directory.

automake 1.11 (or something else new in Ubuntu 11.10) complains if
this is not done.

12 years agoFix which userData is checked for deny-nonchannel memo sending.
Michael Poole [Mon, 31 Oct 2011 04:12:34 +0000 (00:12 -0400)] 
Fix which userData is checked for deny-nonchannel memo sending.

Fixes SourceForge bug #3308832.

src/mod-memoserv.c (memoserv_can_send): Require the recipient to have
    joined a channel for their membership there to count as common
    with the sender.  (This was the original intent.)

12 years agoDo not show "[#channel (500,)]" in a !myaccess list.
Michael Poole [Mon, 31 Oct 2011 03:58:10 +0000 (23:58 -0400)] 
Do not show "[#channel (500,)]" in a !myaccess list.

Fixes SourceForge bug #3072634.

src/chanserv.c (cmd_myaccess): Record where the comma was, and remove
    it if nothing was added after it.

12 years agoAllow !trim (for users) to work for helpers.
Michael Poole [Mon, 31 Oct 2011 03:56:13 +0000 (23:56 -0400)] 
Allow !trim (for users) to work for helpers.

Fixes SourceForge bug #3081638.

src/chanserv.c (cmd_trim_users): Use GetChannelUser() to check user
  access, so that overrides work.

12 years agoAvoid adding expire_channels() to the timeq on !expire.
Michael Poole [Sun, 30 Oct 2011 22:22:21 +0000 (18:22 -0400)] 
Avoid adding expire_channels() to the timeq on !expire.

Fixes SourceForge bug #3000577.

src/chanserv.c (expire_channels): Only (re-)add this function to timeq
    if the data argument is NULL.
  (cmd_expire): Pass a non-NULL pointer when calling expire_channels().

12 years agoRe-fix compilation of src/modcmd.c.
Michael Poole [Sun, 30 Oct 2011 17:32:11 +0000 (13:32 -0400)] 
Re-fix compilation of src/modcmd.c.

(I'm not sure why it looked like this compiled before.)

src/modcmd.c (check_alias_args): strtoul has an attribute that makes
  gcc warn if its result is not used, so store (but ignore) its result.

12 years agoFix compilation warnings from gcc 4.6.
Michael Poole [Sun, 30 Oct 2011 17:23:12 +0000 (13:23 -0400)] 
Fix compilation warnings from gcc 4.6.

src/chanserv.c (zoot_list): Delete this function.
  (cmd_invite): Remove never-read uData variable.
  (ban_read_helper): Remove never-read bData variable.
src/helpfile.c (vsend_message): Remove never-read expand_pos variable.
src/ioset.c (ioset_buffered_read): Remove never-read fdnum variable.
src/log.c (log_entry_search): Remove never-read last variable.
src/mod-helpserv.c (cmd_add_user): Remove never-read new_user variable.
src/modcmd.c (check_alias_args): Remove never-read tmp variable.
src/nickserv.c (cmd_reclaim): Remove never-read hi variable.
src/proto-p10.c (cmd_topic): Remove never-read chan_ts variable.
  (AddLocalUser): Remove never-read timestamp variable.

12 years agoDocument the ChanServ toy commands.
Michael Poole [Sun, 30 Oct 2011 17:19:41 +0000 (13:19 -0400)] 
Document the ChanServ toy commands.

src/chanserv.help: Add documentation for !8ball, !d, !huggle, !ping,
  !unf and !wut.

12 years agoFix MIN_ARGC for ChanServ's !8ball and !d commands.
Michael Poole [Sun, 30 Oct 2011 17:19:08 +0000 (13:19 -0400)] 
Fix MIN_ARGC for ChanServ's !8ball and !d commands.

src/chanserv.c (init_chanserv): These commands need at least one argument.

12 years agoFix typo in #if test for localtime_r().
Michael Poole [Mon, 27 Jun 2011 01:59:22 +0000 (21:59 -0400)] 
Fix typo in #if test for localtime_r().

13 years agoFix the name and type of helpserv_bot.persist_types[].
Michael Poole [Tue, 3 May 2011 02:21:19 +0000 (22:21 -0400)] 
Fix the name and type of helpserv_bot.persist_types[].

This array really contains persistence lengths.  gcc 4.5.2 complains
about the mismatched comparisons.

src/mod-helpserv.c (struct helpserv_bot): Rename persist_types to
    persist_lengths.  Change its type to enum persistence_length.

13 years agoUpdate IP glob matching to work more accurately with IPv6.
Michael Poole [Mon, 22 Nov 2010 12:33:45 +0000 (07:33 -0500)] 
Update IP glob matching to work more accurately with IPv6.

When given an IP like 2001::1234:5678:1:2:3:4, srvx (properly) makes
a glob like 2001:0:4137:*.  However, it wouldn't realize that the
glob actually matches the IP, because it used string glob matching.

src/tools.c (user_matches_glob): Use a parsed glob to match against
  the user's IP address.

13 years agoComplain properly about unterminated comments in config files.
Michael Poole [Mon, 22 Nov 2010 12:31:01 +0000 (07:31 -0500)] 
Complain properly about unterminated comments in config files.

sylar noticed that unterminated comments would often cause an
infinite loop in the config parser.

src/recdb.c (fail_codes): Add UNTERMINATED_COMMENT value.
  (parse_skip_ws): Abort with that on EOF inside a comment.
  (failure_reason): Handle UNTERMINATED_COMMENT.

13 years agoFix available byte count returned by ioq_grow().
Michael Poole [Fri, 19 Nov 2010 21:02:01 +0000 (16:02 -0500)] 
Fix available byte count returned by ioq_grow().

ioq_grow() needs to use the same -1 that ioq_put_avail() uses when
the "get" pointer is at byte 0.

src/ioset.c (ioq_grow): Reduce the reported available-byte count by 1.

13 years agoFix endianness of IPv6 addresses in generate_hostmask().
Michael Poole [Sun, 4 Jul 2010 21:58:35 +0000 (17:58 -0400)] 
Fix endianness of IPv6 addresses in generate_hostmask().

src/proto-common.c (generate_hostmask): The IPv6 address parts are
    network-endian, so convert them before printing them.

14 years agoFix G-line handling and ?gtrace time display.
Michael Poole [Sun, 18 Apr 2010 23:21:41 +0000 (19:21 -0400)] 
Fix G-line handling and ?gtrace time display.

src/gline.c (gline_comparator): Use lifetime rather than expiration time to
    sort G-lines.
  (gline_add): Only update expiration time and reason if the new
     modification time is newer than the previous one.  Never update
     issuer (ircu doesn't track it).
src/opserv.c (gtrace_print_func): Display G-lines with no expiration time
  correctly.

14 years agoClean up the implementations of mod_chanmode_format().
Michael Poole [Thu, 18 Mar 2010 03:31:45 +0000 (23:31 -0400)] 
Clean up the implementations of mod_chanmode_format().

src/proto-bahamut.c (mod_chanmode_format): Use a second buffer for the
    arguments that get associated with some modes, and append it to
    outbuff at the end.

src/proto-p10.c (mod_chanmode_format): Likewise.

14 years agoSilently ignore +z when users use it from ChanServ. Fixes SF#2970686.
Michael Poole [Thu, 18 Mar 2010 03:00:32 +0000 (23:00 -0400)] 
Silently ignore +z when users use it from ChanServ.  Fixes SF#2970686.

src/proto-p10.c (mod_chanmode_parse): Just ignore +z when MCP_REGISTERED
  is set (which only happens from ChanServ).
src/opserv.c (cmd_clearmodes): Do not automatically clear +z.

14 years agoSimplify G-line code somewhat. Generate better output for ?gtrace print.
Michael Poole [Thu, 18 Mar 2010 02:53:30 +0000 (22:53 -0400)] 
Simplify G-line code somewhat.  Generate better output for ?gtrace print.

A hub with a negative clock skew will cause adverse results (like the
issued or lastmod times being in the network's future).  That will be
fixed in ircu.

src/gline.c (gline_for_p): Rewrite to just compare the G-line pointer.
  (gline_add): Use that instead.  Move "issued" back in time if the
    lastmod time is earlier than we know the G-line was issued.
src/opserv.c (OSMSG_GTRACE_FOREVER): New format string.
  (OSMSG_GTRACE_EXPIRED): Likewise.
  (gtrace_print_func): Use the appropriate OSMSG_GTRACE_* string.

14 years agoImplement remote /time query functionality.
Michael Poole [Thu, 18 Mar 2010 02:11:27 +0000 (22:11 -0400)] 
Implement remote /time query functionality.

src/proto-p10.c (cmd_time): New function.
  (init_parse): Register it.

14 years agoSupport G-line lifetimes.
Michael Poole [Thu, 18 Mar 2010 02:11:00 +0000 (22:11 -0400)] 
Support G-line lifetimes.

This involves using the old "expiration" as when the G-line becomes
inactive, and adding a new "lifetime" that is the latest of all the
expiration times that the G-line has ever had.  For convenience,
gline_add() will compare its new "lifetime" argument with its calculated
expiration time -- so callers can safely pass 0 as the lifetime.

src/gline.h (struct gline): Add the lifetime field.  Add Doxygen comments
    for future reference.
  (struct gline_discrim): Add bounds for the lifetime field.
  (gline_add): Add lifetime argument.

src/gline.c (KEY_LIFETIME): New database key.
  (delete_gline_for_p): Delete.
  (gline_expire): Use lifetime to determine whether a G-line expired.
  (gline_remove): Simplify greatly, because we don't actually remove
    G-lines any more (we just mark them immediately expired).
  (gline_add): Add parameter for lifetime, and use it.
  (gline_add_record): Parse lifetime field if it is present.  Simplify
    the parsing of the issued field.
  (gline_write_entry): Write the lifetime.
  (gline_discrim_create): Use ULONG_MAX rather than INT_MAX for
    maximum timestamps.  Parse "lifetime" arguments.
  (gline_discrim_match): Check the lifetime bounds.

src/mod-blacklist.c (dnsbl_hit): Pass 0 lifetime for gline_add().
  (blacklist_check_user): Likewise.

src/mod-sockcheck.c (sockcheck_issue_gline): Likewise.

src/opserv.c (OSMSG_GTRACE_FORMAT): Add lifetime field.
  (opserv_block): Pass 0 lifetime for gline_add().
  (cmd_gline): Likewise.
  (opserv_new_user_check): Likewise.
  (gtrace_print_func): Format the lifetime.

src/proto-p10.c (irc_gline): Include the lifetime in the correct place.
  (irc_ungline): Include the current timestamp (last modified time).
  (cmd_num_gline): When the lifetime argument is given, parse it.
  (cmd_gline): Likewise.  Also implement the normal ircu check for
    expiration as an absolute versus relative time.

14 years agoFix various mode-related bugs (including SF#2964782 and SF#2966959).
Michael Poole [Mon, 15 Mar 2010 01:40:24 +0000 (21:40 -0400)] 
Fix various mode-related bugs (including SF#2964782 and SF#2966959).

src/chanserv.c (cmd_mode): Use MCP_NO_APASS, and unparse the mode
    change for display.
  (chan_opt_usergreeting): Use MCP_NO_APASS here too.
  (chanserv_conf_read): Likewise.
  (chanserv_channel_read): Likewise.

src/opserv.c (cmd_kick): Do not let users try to kick services.

src/proto.h (MCP_NO_APASS): New flag.

src/proto-p10.c (irc_user_mode_chars): Allow displaying +x.
  (mod_usermode): Treat +h as setting +x also.
  (mod_chanmode_parse): Reject +A and +U when passed MCP_NO_APASS.

14 years agoFix parsing of (P10) MODE <nickname> +<mode> <parameters>.
Michael Poole [Sun, 14 Mar 2010 22:51:52 +0000 (18:51 -0400)] 
Fix parsing of (P10) MODE <nickname> +<mode> <parameters>.

src/proto-p10.c (cmd_mode): Unsplit the mode and any trailing arguments.

14 years agoRemove empty +z channels when the +z is removed.
Michael Poole [Tue, 9 Mar 2010 02:52:46 +0000 (21:52 -0500)] 
Remove empty +z channels when the +z is removed.

src/proto-p10.c (dead_channels): New variable.
  (parse_line): Release any dead channels after each command.
  (mod_chanmode_parse): Queue -z'ed channels to be released.

14 years agoDo not send infolines when a normal user joins a +D channel.
Michael Poole [Tue, 9 Mar 2010 02:30:59 +0000 (21:30 -0500)] 
Do not send infolines when a normal user joins a +D channel.

src/chanserv.c (handle_join): Suppress infolines for users whose JOIN is
    not going to be broadcast.