]> jfr.im git - irc/charybdis-ircd/charybdis.git/log
irc/charybdis-ircd/charybdis.git
6 years agocharybdis 4-rc5 charybdis-4-rc5
Simon Arlott [Sun, 30 Jul 2017 17:43:52 +0000 (18:43 +0100)] 
charybdis 4-rc5

6 years agombedtls.c: minor fixups
Aaron Jones [Mon, 3 Jul 2017 00:12:47 +0000 (00:12 +0000)] 
mbedtls.c: minor fixups

- Add (void) casts for unused function parameters
- Rearrange member in `struct rb_mbedtls_cfg_context' for data alignment
- Document a `clang-4.0 -Weverything' (-Wcast-qual) diagnostic
- Avoid pointless conversions between positive/negative error codes
- Use capital hexadecimals in error codes and properly cast to
  (unsigned int) for %x/%X

6 years agom_cap: use rn_snprintf_try_append
Simon Arlott [Sun, 30 Jul 2017 17:04:38 +0000 (18:04 +0100)] 
m_cap: use rn_snprintf_try_append

6 years agotests: add rb_snprintf_append, rb_snprintf_try_append tests
Simon Arlott [Sun, 30 Jul 2017 16:05:26 +0000 (17:05 +0100)] 
tests: add rb_snprintf_append, rb_snprintf_try_append tests

6 years agolibrb: add rb_snprintf_try_append
Simon Arlott [Sun, 30 Jul 2017 16:04:06 +0000 (17:04 +0100)] 
librb: add rb_snprintf_try_append

For when it might fit, or it might not.

6 years agolibrb: rb_snprinf_append: handle error return value from vsnprintf()
Simon Arlott [Sun, 30 Jul 2017 16:03:30 +0000 (17:03 +0100)] 
librb: rb_snprinf_append: handle error return value from vsnprintf()

6 years agotests: add rb_linebuf_put tests
Simon Arlott [Sun, 30 Jul 2017 14:56:29 +0000 (15:56 +0100)] 
tests: add rb_linebuf_put tests

6 years agolibrb: linebuf: reduce the number of "put" implementations from 4 to 1
Simon Arlott [Sun, 30 Jul 2017 12:47:27 +0000 (13:47 +0100)] 
librb: linebuf: reduce the number of "put" implementations from 4 to 1

6 years agoRevert "Core modules cannot be unloaded, otherwise bad things happen."
Simon Arlott [Sat, 29 Jul 2017 22:51:54 +0000 (23:51 +0100)] 
Revert "Core modules cannot be unloaded, otherwise bad things happen."

This reverts commit b5cfad03195d566cd259154d212875fb238f5d80.

6 years agom_join: remove global variable parabuf
Simon Arlott [Sat, 29 Jul 2017 22:19:24 +0000 (23:19 +0100)] 
m_join: remove global variable parabuf

6 years agom_join: remove global variable modebuf
Simon Arlott [Sat, 29 Jul 2017 22:15:14 +0000 (23:15 +0100)] 
m_join: remove global variable modebuf

6 years agom_join: remove global variable para
Simon Arlott [Sat, 29 Jul 2017 22:11:36 +0000 (23:11 +0100)] 
m_join: remove global variable para

6 years agom_join: remove global variable pargs
Simon Arlott [Sat, 29 Jul 2017 22:10:35 +0000 (23:10 +0100)] 
m_join: remove global variable pargs

6 years agom_join: remove global variable mbuf
Simon Arlott [Sat, 29 Jul 2017 22:09:16 +0000 (23:09 +0100)] 
m_join: remove global variable mbuf

6 years agolibrb: linebuf needs to use the buffer limit from msgbuf_unparse_prefix
Simon Arlott [Sat, 29 Jul 2017 22:32:27 +0000 (23:32 +0100)] 
librb: linebuf needs to use the buffer limit from msgbuf_unparse_prefix

6 years agoircd: send: these buffers can be static
Simon Arlott [Sat, 29 Jul 2017 22:24:23 +0000 (23:24 +0100)] 
ircd: send: these buffers can be static

6 years agom_cap: Fix CAP LS generation
Simon Arlott [Sat, 29 Jul 2017 21:15:27 +0000 (22:15 +0100)] 
m_cap: Fix CAP LS generation

The `caplen` variable was unused, so the cap to be output wasn't considered
when determining whether or not it would fit.

6 years agolibrb: rb_rawbuf_length: do something if soft assert fails
Simon Arlott [Sat, 29 Jul 2017 16:47:07 +0000 (17:47 +0100)] 
librb: rb_rawbuf_length: do something if soft assert fails

correct the value of rb->len

6 years agotests: add msgbuf_unparse tests
Simon Arlott [Fri, 28 Jul 2017 17:34:46 +0000 (18:34 +0100)] 
tests: add msgbuf_unparse tests

6 years agotests: add substitution_parse tests
Simon Arlott [Thu, 27 Jul 2017 11:58:13 +0000 (12:58 +0100)] 
tests: add substitution_parse tests

6 years agotests: add msgbuf_parse tests
Simon Arlott [Wed, 26 Jul 2017 20:06:49 +0000 (21:06 +0100)] 
tests: add msgbuf_parse tests

6 years agomsgbuf: correctly split buffers into IRCv3 tags and RFC1459 message data
Simon Arlott [Wed, 28 Jun 2017 20:24:10 +0000 (21:24 +0100)] 
msgbuf: correctly split buffers into IRCv3 tags and RFC1459 message data

6 years agolinebuf: increase buffer size to accommodate IRCv3 tags
Simon Arlott [Wed, 28 Jun 2017 19:40:03 +0000 (20:40 +0100)] 
linebuf: increase buffer size to accommodate IRCv3 tags

6 years agotests: add C TAP harness
Simon Arlott [Tue, 25 Jul 2017 20:02:45 +0000 (21:02 +0100)] 
tests: add C TAP harness

6 years agolibrb: remove unnecessary NULL from the end of rb_string_to_array output
Simon Arlott [Fri, 28 Jul 2017 20:50:16 +0000 (21:50 +0100)] 
librb: remove unnecessary NULL from the end of rb_string_to_array output

6 years agoircd: attach_conf: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:26:21 +0000 (20:26 +0100)] 
ircd: attach_conf: avoid clang static analysis warning

In the impossible scenario where ClassPtr(aconf) is NULL, reject the
client instead of dereferencing the NULL pointer.

6 years agomake soft asserts better by allowing them to be used in expressions
Simon Arlott [Sat, 29 Jul 2017 16:37:53 +0000 (17:37 +0100)] 
make soft asserts better by allowing them to be used in expressions

6 years agowsockd: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 20:05:41 +0000 (21:05 +0100)] 
wsockd: avoid clang static analysis warning

Don't set `x = 0` twice.

6 years agoauthd: opm: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 21:31:04 +0000 (22:31 +0100)] 
authd: opm: avoid clang static analysis warning

Remove unused `c` variable.

6 years agoircd: send_to_channel_flags: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:45:53 +0000 (20:45 +0100)] 
ircd: send_to_channel_flags: avoid clang static analysis warning

Set current_capmask and then use it, instead of referencing target_p->localClient->caps again.

This makes the purpose of current_capmask a bit clearer.

6 years agoircd: sendto_one_notice: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:41:37 +0000 (20:41 +0100)] 
ircd: sendto_one_notice: avoid clang static analysis warning

target_p->from can't be NULL, and if it is then get_id(..., target_p)
dereferences it later in the function anyway

6 years agolibrb: rb_lib_loop: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:35:54 +0000 (20:35 +0100)] 
librb: rb_lib_loop: avoid clang static analysis warning

6 years agossld: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:29:24 +0000 (20:29 +0100)] 
ssld: avoid clang static analysis warning

Don't set `x = 0` twice.

6 years agoircd: sendto_one_numeric: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:16:59 +0000 (20:16 +0100)] 
ircd: sendto_one_numeric: avoid clang static analysis warning

target_p->from can't be NULL, and if it is then get_id(..., target_p)
dereferences it later in the function anyway

6 years agoauthd: opm: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:16:26 +0000 (20:16 +0100)] 
authd: opm: avoid clang static analysis warning

Remove unused `lookup` variables.

6 years agoircd: get_or_create_channel: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 19:14:43 +0000 (20:14 +0100)] 
ircd: get_or_create_channel: avoid clang static analysis warning

Use `len` after setting it.

6 years agossld: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 18:45:07 +0000 (19:45 +0100)] 
ssld: avoid clang static analysis warning

6 years agoircd: sendto_one_prefix: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 18:25:11 +0000 (19:25 +0100)] 
ircd: sendto_one_prefix: avoid clang static analysis warning

target_p->from can't be NULL, and if it is then get_id(..., target_p)
dereferences it later in the function anyway

6 years agoexit_remote_server: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 18:17:34 +0000 (19:17 +0100)] 
exit_remote_server: avoid clang static analysis warning

if IsServer(source_p) then the following must be all non-NULL:
 ->serv
 ->servptr
 ->servptr->serv

Remove unnecessary and inconsistent pointer checks.

6 years agolibrb: rb_linebuf_copy_raw: remove unused assignment
Simon Arlott [Sat, 29 Jul 2017 18:27:19 +0000 (19:27 +0100)] 
librb: rb_linebuf_copy_raw: remove unused assignment

6 years agoircd: hostmask: avoid clang static analysis warning
Simon Arlott [Sat, 29 Jul 2017 16:39:28 +0000 (17:39 +0100)] 
ircd: hostmask: avoid clang static analysis warning

arec->Mask.ipa.bits is unused if arec->masktype == HM_HOST

6 years agolibrb: commio: Must set addrlen before every call to accept()
Simon Arlott [Sat, 29 Jul 2017 20:38:34 +0000 (21:38 +0100)] 
librb: commio: Must set addrlen before every call to accept()

If an IPv4 connection is dropped by the pre-callback, and there is a
pending IPv6 connection on the same listening socket then the retried
accept() will be unable to populate `st` because `addrlen` will be too
small. Also initialise `st` each time to avoid a clang static analysis
warning.

6 years agoircd: listener: Document check_reject() behaviour
Simon Arlott [Sat, 29 Jul 2017 20:31:17 +0000 (21:31 +0100)] 
ircd: listener: Document check_reject() behaviour

6 years agowsockd: Initialise ws_frame_hdr_t before using it
Simon Arlott [Sat, 29 Jul 2017 18:59:20 +0000 (19:59 +0100)] 
wsockd: Initialise ws_frame_hdr_t before using it

Outgoing messages have uninitialised data from the stack in the 3 reserved
bits of the opcode_rsv_fin value.

6 years agosslproc: check number of arguments to zipstats command
Simon Arlott [Fri, 28 Jul 2017 20:28:44 +0000 (21:28 +0100)] 
sslproc: check number of arguments to zipstats command

6 years agosrc/channel.c: don't use the bancache in is_banned()/is_quieted()
Aaron Jones [Wed, 5 Jul 2017 17:35:28 +0000 (17:35 +0000)] 
src/channel.c: don't use the bancache in is_banned()/is_quieted()

The bancache will be re-architected onto clients in future for easier
invalidation, but this is a good-enough temporary fix for issue #243

Fixes #243

6 years agoRevert "no really, it's dead people"
Simon Arlott [Thu, 27 Jul 2017 17:51:13 +0000 (18:51 +0100)] 
Revert "no really, it's dead people"

This reverts commit 40ac82e87820d9941bdd38571d0390122008e5d3.

6 years agocharybdis 4-rc4 charybdis-4-rc4
Simon Arlott [Thu, 27 Jul 2017 17:46:42 +0000 (18:46 +0100)] 
charybdis 4-rc4

6 years agomsgbuf: remove unused field parselen
Simon Arlott [Wed, 26 Jul 2017 11:10:17 +0000 (12:10 +0100)] 
msgbuf: remove unused field parselen

6 years agoircd: substitution: fix NULL termination buffer overrun when the output is too large...
Simon Arlott [Thu, 27 Jul 2017 11:58:23 +0000 (12:58 +0100)] 
ircd: substitution: fix NULL termination buffer overrun when the output is too large for the buffer

6 years agoircd: substitution: fix overrun with unterminated '}' in format string
Simon Arlott [Wed, 26 Jul 2017 21:52:51 +0000 (22:52 +0100)] 
ircd: substitution: fix overrun with unterminated '}' in format string

handle a variable following an unterminated variable better

6 years agomsgbuf: s_assert is not a substitute for proper code
Simon Arlott [Wed, 26 Jul 2017 18:18:08 +0000 (19:18 +0100)] 
msgbuf: s_assert is not a substitute for proper code

(dns, m_alias, m_stats updated as msgbuf no longer includes s_assert.h)

6 years agoircd: check_server: don't allow a connection if that would exceed the class limit
Simon Arlott [Sun, 23 Jul 2017 14:34:29 +0000 (15:34 +0100)] 
ircd: check_server: don't allow a connection if that would exceed the class limit

6 years agoircd: serv_connect: don't try to connect if that would exceed the class limit
Simon Arlott [Sun, 23 Jul 2017 13:59:22 +0000 (14:59 +0100)] 
ircd: serv_connect: don't try to connect if that would exceed the class limit

6 years agom_webirc: use rb_inet_ntop_sock to populate sockhost
Simon Arlott [Tue, 27 Jun 2017 19:45:02 +0000 (20:45 +0100)] 
m_webirc: use rb_inet_ntop_sock to populate sockhost

6 years agoircd: s_conf: fix use of strlcpy in strip_tabs
Simon Arlott [Sun, 25 Jun 2017 18:48:49 +0000 (19:48 +0100)] 
ircd: s_conf: fix use of strlcpy in strip_tabs

strlcpy should be called with the size of the destination buffer, not
the length of the source string.

When the source is an empty string, the destination buffer isn't
written at all, resulting in it trying to output uninitialised data.

This could also cause a buffer overflow on very long invalid config
lines.

7 years agono really, it's dead people
William Pitcock [Tue, 28 Feb 2017 05:31:32 +0000 (23:31 -0600)] 
no really, it's dead people

7 years agoCREDITS: fix my nickname and update my email address
Simon Arlott [Fri, 6 Jan 2017 21:51:05 +0000 (21:51 +0000)] 
CREDITS: fix my nickname and update my email address

7 years agoMbedTLS: Disable TLSv1.0
Aaron Jones [Fri, 30 Dec 2016 17:54:05 +0000 (17:54 +0000)] 
MbedTLS: Disable TLSv1.0

7 years agoOpenSSL: Disable TLSv1.0
Aaron Jones [Fri, 30 Dec 2016 17:44:03 +0000 (17:44 +0000)] 
OpenSSL: Disable TLSv1.0

Also some misc other cleanups/additions to bring it in line with the
release/3.5 backend

7 years agoGNUTLS: Provide a default priority string, disable TLSv1.0 in it
Aaron Jones [Fri, 30 Dec 2016 17:39:45 +0000 (17:39 +0000)] 
GNUTLS: Provide a default priority string, disable TLSv1.0 in it

The user can still override this choice with the ssl_cipher_list option
in ircd.conf -- this is the only backend that will allow you to do so.

7 years agoextensions/extb_channel: Allow matching secret channels.
Keith Buck [Thu, 29 Dec 2016 05:44:18 +0000 (05:44 +0000)] 
extensions/extb_channel: Allow matching secret channels.

This change modifies extb_channel to allow matching users in secret
channels, which prevents trivial ban evasion by setting the target
channel +s. Information leak due to this change is unlikely since the
attacker would have to know that the target channel exists, the name of
the channel (or guess it), have a specific user they wanted to know
whether was in the channel (and not know already), and the target user
would need to have something like autojoin-on-invite enabled (or any of
the other various ways hostname cloaking is attacked).

7 years agoDocumentation: Comment-out the OPM block and its options by default
Aaron Jones [Wed, 28 Dec 2016 23:41:32 +0000 (23:41 +0000)] 
Documentation: Comment-out the OPM block and its options by default

The feature is not yet stable and is causing several issues.

7 years agoWhen a remote MODRESTART command is received, it will pass through the
Aaron Jones [Wed, 28 Dec 2016 22:08:14 +0000 (22:08 +0000)] 
When a remote MODRESTART command is received, it will pass through the
ENCAP module. The ms_encap function is responsible for dispatching the
command handler and then the modules will eventually be reloaded.

However, if the ENCAP module is reloaded to a different address, the
stack now contains the address of a function that no longer exists.

Also, in this version of the IRCd, the module restarting functionality
was located in a function that is itself located in a module, so things
will also go badly if that module is reloaded to a different address,
too.

Return immediately from the command handler and have the event loop
call the function responsible for reloading the modules instead.

c.f. release/3.5 commit db05a3621058

Reported-by: mniip (Freenode)
7 years agomkpasswd: avoid strdup(NULL) and the like if rb_crypt() fails
Aaron Jones [Tue, 20 Dec 2016 17:29:37 +0000 (17:29 +0000)] 
mkpasswd: avoid strdup(NULL) and the like if rb_crypt() fails

7 years agoauthd: don't exit() on OPM duplicate scanner errors, just ignore it
Aaron Jones [Mon, 19 Dec 2016 04:56:54 +0000 (04:56 +0000)] 
authd: don't exit() on OPM duplicate scanner errors, just ignore it

I run into this code even with a single kind of scanner with a single
port, so I'm not even sure how it thinks it already exists.

Perhaps it's being parsed twice, or something similar.

c.f. issue #229

7 years agomr_server: Handle certificate validation errors.
Keith Buck [Fri, 9 Dec 2016 10:01:22 +0000 (10:01 +0000)] 
mr_server: Handle certificate validation errors.

When certificate validation fails, the certificate fingerprint won't be
calculated, resulting in an attempt to format NULL into a log line
showing the fingerprint. Instead, add a different error message for
missing fingerprint (i.e. validation failed).

7 years ago.gitignore: ignore .exe extension.
Jason Volk [Mon, 5 Dec 2016 19:14:23 +0000 (14:14 -0500)] 
.gitignore: ignore .exe extension.
Utilized when building on windows, but shouldn't require any iff
windows case when on unix, so it can be simply ignored.

[ci skip]

7 years agom_rehash: Require admin privileges for REHASH SSLD.
Keith Buck [Sun, 4 Dec 2016 22:03:34 +0000 (22:03 +0000)] 
m_rehash: Require admin privileges for REHASH SSLD.

This change enforces admin privileges for the REHASH SSLD command, as
originally intended.

7 years agoFix cross compile for Windows
Simon Arlott [Sun, 4 Dec 2016 20:21:07 +0000 (20:21 +0000)] 
Fix cross compile for Windows

7 years agomsgbuf: don't append a ';' unless there are existing tags
Simon Arlott [Fri, 25 Nov 2016 16:02:11 +0000 (16:02 +0000)] 
msgbuf: don't append a ';' unless there are existing tags

When both account-tag and server-time are present but the client
doesn't have the first (i == 0) of these enabled. They will get
an erroneous ';' after the '@'.

Track whether or not there are tags present, and use this to
determine whether to add the ';' or not. Also remove the extra
function that loops over all of the tags by using this flag to
handle the case where there are no tags being written.

7 years agofix privmsg/notice send functions to use variable argument lists properly
Simon Arlott [Fri, 25 Nov 2016 16:19:29 +0000 (16:19 +0000)] 
fix privmsg/notice send functions to use variable argument lists properly

7 years agoreference.conf: Use proper IPv6 RFC Documentation Range Subnet
Aaron Jones [Sun, 27 Nov 2016 20:51:06 +0000 (20:51 +0000)] 
reference.conf: Use proper IPv6 RFC Documentation Range Subnet

[ci skip]

7 years agoecho-message should work for privmsg/notice to another user
Simon Arlott [Wed, 23 Nov 2016 21:43:33 +0000 (21:43 +0000)] 
echo-message should work for privmsg/notice to another user

Build the same message but send it to the local client first,
so that the echo-message capability works. But don't do it when
sending a message to yourself.

7 years agoecho-message should work for clients that aren't in the target channel
Simon Arlott [Wed, 23 Nov 2016 21:14:44 +0000 (21:14 +0000)] 
echo-message should work for clients that aren't in the target channel

Move the echo part to the end of the channel membership loop so that it
works even if the user isn't on the channel.

7 years agoserver_estab: don't try to send to a dead client
Simon Arlott [Sun, 20 Nov 2016 21:41:18 +0000 (21:41 +0000)] 
server_estab: don't try to send to a dead client

If the zlib setup fails the client will be exited, so don't send
to it before checking this.

7 years agolistener: use exit_client instead of free_client
Simon Arlott [Sun, 20 Nov 2016 20:43:53 +0000 (20:43 +0000)] 
listener: use exit_client instead of free_client

As well as leaking a connid and leaving the connection open,
these calls to free_client() leave the client in the unknown_list
causing check_unknowns_list() to crash when either ptr->data
(ptr being the freed client_p->localClient->tnode) is NULL or
when client_p->localClient is NULL.

Flag the client as an IO error so that we don't try to send it
any data (as this is not a normal plaintext connection).

7 years agoreference.conf: document that SPKI is supported in version 3.5 now
Aaron Jones [Tue, 15 Nov 2016 12:36:01 +0000 (12:36 +0000)] 
reference.conf: document that SPKI is supported in version 3.5 now

7 years agoTLS backends: Move some library-dependent functions to the proper location
Aaron Jones [Tue, 15 Nov 2016 12:16:03 +0000 (12:16 +0000)] 
TLS backends: Move some library-dependent functions to the proper location

The comment incorrectly stated these were library-agnostic; infact, they
use library-dependent data types or macro names.

7 years agoREADME: Document glibtoolize use on Mac systems
Aaron Jones [Mon, 31 Oct 2016 09:08:46 +0000 (09:08 +0000)] 
README: Document glibtoolize use on Mac systems

Fixes #224

7 years agoUse const hook data where possible
Simon Arlott [Sun, 30 Oct 2016 12:36:50 +0000 (12:36 +0000)] 
Use const hook data where possible

core/m_nick.c: In function `change_remote_nick':
core/m_nick.c:745: warning: assignment discards qualifiers from pointer target type

7 years agofree cache emptyline rb_dlink_node, allocated automatically but never freed
Simon Arlott [Sun, 30 Oct 2016 12:05:45 +0000 (12:05 +0000)] 
free cache emptyline rb_dlink_node, allocated automatically but never freed

==00:00:01:09.081 1762== 48 bytes in 2 blocks are definitely lost in loss record 545 of 991
==00:00:01:09.081 1762==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:01:09.081 1762==    by 0x56C14A2: rb_malloc (rb_memory.h:41)
==00:00:01:09.081 1762==    by 0x56C177C: rb_bh_alloc (balloc.c:189)
==00:00:01:09.081 1762==    by 0x56CA0A9: rb_make_rb_dlink_node (tools.c:65)
==00:00:01:09.081 1762==    by 0x4E52D85: cache_file (cache.c:146)
==00:00:01:09.081 1762==    by 0x4E52AC3: init_cache (cache.c:67)
==00:00:01:09.081 1762==    by 0x4E69530: charybdis_main (ircd.c:762)
==00:00:01:09.081 1762==    by 0x400815: main (main.c:8)

==00:00:01:09.100 1762== 2,808 bytes in 117 blocks are definitely lost in loss record 960 of 991
==00:00:01:09.100 1762==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:01:09.100 1762==    by 0x56C14A2: rb_malloc (rb_memory.h:41)
==00:00:01:09.100 1762==    by 0x56C177C: rb_bh_alloc (balloc.c:189)
==00:00:01:09.100 1762==    by 0x56CA0A9: rb_make_rb_dlink_node (tools.c:65)
==00:00:01:09.100 1762==    by 0x4E52D85: cache_file (cache.c:146)
==00:00:01:09.100 1762==    by 0x4E5337A: load_help (cache.c:301)
==00:00:01:09.100 1762==    by 0x4E698AA: charybdis_main (ircd.c:848)
==00:00:01:09.100 1762==    by 0x400815: main (main.c:8)

==00:00:01:09.100 1762== 5,328 (5,304 direct, 24 indirect) bytes in 221 blocks are definitely lost in loss record 971 of 991
==00:00:01:09.100 1762==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:01:09.100 1762==    by 0x56C14A2: rb_malloc (rb_memory.h:41)
==00:00:01:09.100 1762==    by 0x56C177C: rb_bh_alloc (balloc.c:189)
==00:00:01:09.100 1762==    by 0x56CA0A9: rb_make_rb_dlink_node (tools.c:65)
==00:00:01:09.100 1762==    by 0x4E52D85: cache_file (cache.c:146)
==00:00:01:09.100 1762==    by 0x4E53278: load_help (cache.c:266)
==00:00:01:09.100 1762==    by 0x4E698AA: charybdis_main (ircd.c:848)
==00:00:01:09.100 1762==    by 0x400815: main (main.c:8)

7 years agofree server_p->certfp, allocated in newconf.c
Simon Arlott [Sun, 30 Oct 2016 11:45:56 +0000 (11:45 +0000)] 
free server_p->certfp, allocated in newconf.c

==01:17:20:36.920 5966== 429 bytes in 3 blocks are possibly lost in loss record 899 of 1,020
==01:17:20:36.920 5966==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==01:17:20:36.920 5966==    by 0x4E73867: rb_strdup (rb_memory.h:70)
==01:17:20:36.920 5966==    by 0x4E7674C: conf_set_connect_fingerprint (newconf.c:1421)
==01:17:20:36.920 5966==    by 0x4E78D55: conf_call_set (newconf.c:2562)
==01:17:20:36.920 5966==    by 0x4E6A33D: yyparse (ircd_parser.y:215)
==01:17:20:36.920 5966==    by 0x4E7FFC7: read_conf (s_conf.c:834)
==01:17:20:36.920 5966==    by 0x4E81718: read_conf_files (s_conf.c:1419)
==01:17:20:36.920 5966==    by 0x4E69567: charybdis_main (ircd.c:775)
==01:17:20:36.920 5966==    by 0x400815: main (main.c:8)

7 years agofree localClient->cipher_string, allocated in sslproc.c
Simon Arlott [Sun, 30 Oct 2016 11:21:02 +0000 (11:21 +0000)] 
free localClient->cipher_string, allocated in sslproc.c

==01:17:20:36.919 5966== 280 bytes in 8 blocks are definitely lost in loss record 876 of 1,020
==01:17:20:36.919 5966==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==01:17:20:36.919 5966==    by 0x4E93F4F: rb_strdup (rb_memory.h:70)
==01:17:20:36.919 5966==    by 0x4E95280: ssl_process_cipher_string (sslproc.c:476)
==01:17:20:36.919 5966==    by 0x4E95540: ssl_process_cmd_recv (sslproc.c:561)
==01:17:20:36.919 5966==    by 0x4E9582A: ssl_read_ctl (sslproc.c:632)
==01:17:20:36.919 5966==    by 0x56CBAB6: rb_select_epoll (epoll.c:199)
==01:17:20:36.919 5966==    by 0x56C4EB5: rb_select (commio.c:2085)
==01:17:20:36.919 5966==    by 0x56C7FD6: rb_lib_loop (rb_lib.c:228)
==01:17:20:36.919 5966==    by 0x4E69987: charybdis_main (ircd.c:872)
==01:17:20:36.919 5966==    by 0x400815: main (main.c:8)

7 years agofree localClient->zipstats, allocated in sslproc.c
Simon Arlott [Sun, 30 Oct 2016 11:17:41 +0000 (11:17 +0000)] 
free localClient->zipstats, allocated in sslproc.c

==01:17:20:36.906 5966== 48 bytes in 1 blocks are definitely lost in loss record 544 of 1,020
==01:17:20:36.906 5966==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==01:17:20:36.906 5966==    by 0x4E93F0C: rb_malloc (rb_memory.h:41)
==01:17:20:36.906 5966==    by 0x4E961E8: start_zlib_session (sslproc.c:901)
==01:17:20:36.906 5966==    by 0x4E86FAC: server_estab (s_serv.c:877)
==01:17:20:36.906 5966==    by 0x13B2921A: mr_server (m_server.c:304)
==01:17:20:36.906 5966==    by 0x4E7AF03: handle_command (parse.c:241)
==01:17:20:36.906 5966==    by 0x4E7A96A: parse (parse.c:157)
==01:17:20:36.906 5966==    by 0x4E7A3DC: client_dopacket (packet.c:354)
==01:17:20:36.906 5966==    by 0x4E798D6: parse_client_queued (packet.c:98)
==01:17:20:36.906 5966==    by 0x4E79FAC: read_packet (packet.c:282)
==01:17:20:36.906 5966==    by 0x56CBAB6: rb_select_epoll (epoll.c:199)
==01:17:20:36.906 5966==    by 0x56C4EB5: rb_select (commio.c:2085)

7 years agocppcheck: fix various warnings/errors
Simon Arlott [Fri, 28 Oct 2016 18:23:21 +0000 (19:23 +0100)] 
cppcheck: fix various warnings/errors

[ircd/match.c:316]: (error) Shifting a negative value is undefined behaviour
[librb/src/patricia.c:55]: (error) Shifting a negative value is undefined behaviour
[modules/m_alias.c:64]: (portability) '(void*)message' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
[modules/m_time.c:111]: (warning) %u in format string (no. 9) requires 'unsigned int' but the argument type is 'signed int'.
[modules/m_time.c:111]: (warning) %u in format string (no. 10) requires 'unsigned int' but the argument type is 'signed int'.
[librb/src/dictionary.c:819]: (warning) %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'.
[librb/src/radixtree.c:1080]: (warning) %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'.
[ircd/s_user.c:351] -> [ircd/s_user.c:357]: (warning) Either the condition '0!=source_p' is redundant or there is possible null pointer dereference: source_p.
[extensions/ip_cloaking_3.0.c:109]: (warning, inconclusive) The buffer 'buf' may not be null-terminated after the call to strncpy().
[ircd/chmode.c:256]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_help.c:100]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_knock.c:169]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_stats.c:628]: (style) Clarify calculation precedence for '&' and '?'.
[modules/m_stats.c:727]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:601]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:704]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:739]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:763]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:768]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:774]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:781]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:786]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:791]: (style) Clarify calculation precedence for '&' and '?'.
[librb/src/radixtree.c:804]: (style) Clarify calculation precedence for '&' and '?'.
[ircd/wsproc.c:372]: (style) Unused variable: len
[modules/core/m_modules.c:382]: (style) Unused variable: i
[modules/m_stats.c:741]: (style) Unused variable: amsg
[ircd/authproc.c:390]: (style) Unused variable: iter
[ircd/authproc.c:391]: (style) Unused variable: client_p

7 years agoauthproc: don't allow authd to write too many parameters to parv array
Simon Arlott [Sat, 22 Oct 2016 21:42:22 +0000 (22:42 +0100)] 
authproc: don't allow authd to write too many parameters to parv array

7 years agomsgbuf_parse: rb_string_to_array outputs to a MAXPARA+1 size array
Simon Arlott [Sat, 22 Oct 2016 21:37:35 +0000 (22:37 +0100)] 
msgbuf_parse: rb_string_to_array outputs to a MAXPARA+1 size array

7 years agorb_string_to_array: document parv array size
Simon Arlott [Sat, 22 Oct 2016 21:36:47 +0000 (22:36 +0100)] 
rb_string_to_array: document parv array size

7 years agoOpenSSL: Adjust ciphersuite order and update documentation
Aaron Jones [Tue, 18 Oct 2016 11:17:41 +0000 (11:17 +0000)] 
OpenSSL: Adjust ciphersuite order and update documentation

7 years agoMbedTLS: Adjust ciphersuite order and update documentation
Aaron Jones [Tue, 18 Oct 2016 11:16:38 +0000 (11:16 +0000)] 
MbedTLS: Adjust ciphersuite order and update documentation

7 years agoREADME: Fix location of channel
Aaron Jones [Sat, 15 Oct 2016 12:50:47 +0000 (12:50 +0000)] 
README: Fix location of channel

7 years agoSASL: Relax rate limiting for failures a little
Aaron Jones [Sun, 2 Oct 2016 14:13:02 +0000 (14:13 +0000)] 
SASL: Relax rate limiting for failures a little

Begin at 8 seconds after 2 failures and up to ~4 minutes

7 years agoMerge pull request #221 from Xenthys/release/4
Aaron Jones [Sun, 2 Oct 2016 10:02:02 +0000 (10:02 +0000)] 
Merge pull request #221 from Xenthys/release/4

Added kick immunity to umode +p (oper-override)

7 years agoMerge pull request #222 from Xenthys/release/4+sasl
Aaron Jones [Sun, 2 Oct 2016 09:50:57 +0000 (09:50 +0000)] 
Merge pull request #222 from Xenthys/release/4+sasl

SASL: rate-limit after the 2nd failed attempt (m_sasl.c)

7 years agoSASL: rate-limit after the 2nd failed attempt (m_sasl.c)
Xenthys [Sun, 2 Oct 2016 01:57:11 +0000 (03:57 +0200)] 
SASL: rate-limit after the 2nd failed attempt (m_sasl.c)

7 years agoAdded kick immunity to umode +p (oper-override)
Xenthys [Wed, 28 Sep 2016 22:34:53 +0000 (00:34 +0200)] 
Added kick immunity to umode +p (oper-override)

7 years agowhois: check target is an oper before assuming they have a privset
Aaron Jones [Tue, 20 Sep 2016 13:46:33 +0000 (13:46 +0000)] 
whois: check target is an oper before assuming they have a privset

The CHALLENGE functionality will set opername but not privset --
if an oper performs a WHOIS on someone currently half-way through
a challenge we will perform a NULL dereference.

Related to ircd-seven commit d7b05f7583babf6

7 years agohelpops: add duplication guards on helper/dehelper state changes
William Pitcock [Sun, 18 Sep 2016 22:11:00 +0000 (17:11 -0500)] 
helpops: add duplication guards on helper/dehelper state changes

7 years agoGNUTLS: Forward-port release/3.5 improvements
Aaron Jones [Sat, 17 Sep 2016 17:53:01 +0000 (17:53 +0000)] 
GNUTLS: Forward-port release/3.5 improvements

The changes made in this file are detailed in release/3.5 commits
4d89c83c324605b through ecfdcb08e8c2bdd inclusive.

Some slight alterations are necessary; librb instead of libratbox,
snprintf() instead of rb_snprintf(), etc. Also, release/4 has
offline certificate digesting functionality. For more insight,
simply diff the gnutls.c between release/3.5 and release/4.