Commit graph

624 commits

Author SHA1 Message Date
William Pitcock 9e07c8f70b whois: add a hook allowing for ShowChannel() behaviour to be overridden for channel visibility 2016-01-05 18:45:07 -06:00
Juuso Lapinlampi 6eb0267a90 messages.h: Remove 900-902 IRCv3.1 SASL trailing period
The IRCv3.1 SASL specification [1] has been updated today, and brings a
level of consistency with the trailing periods (or the lack of).

This implements the change made in
ircv3/ircv3-specifications@6d2ca77ffd.

[1]: http://ircv3.net/specs/extensions/sasl-3.1.html
2015-12-30 12:51:48 +02:00
Juuso Lapinlampi e0160ec5a4 messages.h: Standardize 256 (RPL_ADMINME) with RFC 1459
RPL_ADMINME is a response the client receives using the ADMIN command.
Charybdis used to implement a non-standard version of this.

The RFC 1459 standard [1] says in section "6.2 Command responses.":

            256     RPL_ADMINME
                            "<server> :Administrative info"

This commit corrects the behavior to follow the standard.

[1]: https://tools.ietf.org/html/rfc1459
2015-12-28 21:19:47 -06:00
William Pitcock 0817ad4cd0 messages.h: fix numeric 320 2015-12-28 01:36:40 -06:00
William Pitcock 72ad5c04fe whois: list active operator block and privset when appropriate 2015-12-28 01:33:09 -06:00
William Pitcock d513218a9e LIST: allow channel display threshold to be configured (closes #109) 2015-12-26 22:23:28 -06:00
William Pitcock 2f9687c48c channel: cache duplicate calls to is_banned() and is_quieted() 2015-12-13 08:13:52 -06:00
Jilles Tjoelker 2d28539c68 Reduce clean_nick() code duplication further.
Side effect: hurt and monitor now allow nicks starting with a digit.
2015-12-13 00:22:21 +01:00
William Pitcock 72dee03d50 clean up some code duplication when checking nicks for validity 2015-12-12 08:41:09 -06:00
William Pitcock c1725bda3c ssl: allow cipher list to be overridden (closes #67) 2015-12-12 07:50:48 -06:00
William Pitcock b5b4a0e79b client: use sequential connection ids for ssld connections in ssld RPC, instead of the file descriptor
this avoids race conditions when a file descriptor is reused and an ssld worker has not acked that the previous
connection was closed, which results in the new client being kicked.
2015-12-12 05:20:51 -06:00
William Pitcock 63eb8567cb implement configurable channel modes (closes #31)
While functionally compatible with the implementation in ElementalIRCd, our approach is different,
specifically pre-calculating the bitmask at config load time.  This is more efficient, and allows us
to report errors as part of the configuration phase.
2015-12-11 15:36:53 -06:00
William Pitcock bac8c4829f config.h.dist: resync with config.h (closes #14) 2015-12-11 12:14:34 -06:00
William Pitcock 427a8d5dbb WHOIS: use cipher string if available 2015-12-11 08:20:11 -06:00
William Pitcock ebe33dbfab sslproc: set Client.localClient.cipher_string if sent by ssld 2015-12-11 08:19:50 -06:00
William Pitcock 196740c42b sslproc: likewise 2015-12-10 23:44:31 -06:00
William Pitcock 7801d174d7 Revert "extban: implement helper functions for stackable extbans (part 1) (ref #74)"
This reverts commit 304bd0d095.
2015-12-10 02:19:21 -06:00
William Pitcock 304bd0d095 extban: implement helper functions for stackable extbans (part 1) (ref #74) 2015-12-10 01:33:30 -06:00
William Pitcock 202d496644 override: only engage override code if we're needing to authorize a WRITE to a channel's state (closes #65) 2015-12-10 01:00:32 -06:00
William Pitcock 13d8f0edba allow certfp method to be configured 2015-12-07 01:49:30 -06:00
William Pitcock 4a5330bb4d cap: implement ircv3.2 chghost cap 2015-11-19 22:53:55 -06:00
William Pitcock 583f064fef send: add negation argument to sendto_common_channels_local() and friends 2015-11-19 22:43:45 -06:00
Andrew Wilcox 5f8fb56d02 Revert "remove MONITOR for now pending a complete rewrite"
This reverts commit 87fa262fec.
2015-10-15 17:31:55 -05:00
William Pitcock 87fa262fec remove MONITOR for now pending a complete rewrite 2015-10-15 09:39:48 -05:00
William Pitcock d09bde15a1 monitor: additional cleanup pointed out by mr_flea 2015-10-11 19:32:31 -05:00
William Pitcock d5f856c68e monitor: fix the resource leak properly, unlike the moronic elemental-ircd developers 2015-10-11 18:48:53 -05:00
Jilles Tjoelker 2125182293 Remove the unneeded username parameter to register_local_user(). 2015-09-13 22:59:03 +02:00
Elizabeth Myers 34c10ca8b7 Relocate report_Klines to proper home
This function is not used anywhere else but m_stats, so should be put
there.
2015-08-08 17:25:29 -05:00
Jail Bird 29c92cf95f Spring cleaning redux:
- Implemented changes suggested by Jilles
- Remove some unused parameters in functions
- Remove some unused ssl procs
- 63-bit time_t support in TS deltas
- const char * vs char * cleanup
- struct alignment (void *) casts
- signed vs unsigned fixes
- bad memset() call
- Bad LT_MAIN in libratbox
- char -> unsigned char casts for isdigit/isspace/etc calls

Thanks Jilles!
2015-04-20 00:55:20 -05:00
Aaron Jones c9b5cd623b Remove network_desc configuration option, never actually used anywhere 2015-03-26 14:46:54 -05:00
William Pitcock bb2a50509a config: further EGD removal 2015-03-01 01:06:58 -06:00
William Pitcock 984d80c988 cap-notify: add sendto_local_clients_with_capability() (ref #84) 2015-03-01 00:44:34 -06:00
William Pitcock 13de708352 cap-notify: add cap-notify cap 2015-03-01 00:26:23 -06:00
Max Teufel 1b54aa5c3b src/channel: add support for IRCv3.2 userhost-in-names 2015-02-28 01:06:38 -06:00
William Pitcock 6e3d57dc6b cap: remove SASL_REAUTH capability 2015-02-28 01:01:08 -06:00
William Pitcock 74bae4c6ff remove references to LIBPATH (closes #26). 2015-02-24 20:25:34 -06:00
William Pitcock 95cce5f358 Revert "m_invite: add support for CAP invite-notify"
This reverts commit 93eb76cc32.
2015-02-16 17:50:51 -06:00
Max Teufel 93eb76cc32 m_invite: add support for CAP invite-notify
Specification:
<https://github.com/ircv3/ircv3-specifications/blob/master/extensions/invite-notify-3.2.md>
2015-02-16 15:40:34 -06:00
William Pitcock c6bc97fdcd m_sasl: move some struct members around for sasl-reauth 2015-02-16 15:39:36 -06:00
William Pitcock ef3ab8e3a5 cap: allow clients to do sasl reauth if they requested sasl and sasl-reauth (ref ircv3/ircv3#103). 2015-02-15 17:11:28 -06:00
Max Teufel 7d33cce8ef m_sasl: add configuration option for the nick of the SASL agent
This allows multiple improvements to m_sasl. With this change, the SASL
authentication gets aborted immediately when services are offline.
Additionally, we send the SASL ENCAP messages directly to the specified
SASL agent.
2015-02-14 20:31:25 +01:00
Jilles Tjoelker 483987a464 Explicitly pass the current time to deactivate_conf().
Some places depend on the ban not being destroyed.
2014-09-21 15:02:43 +02:00
Jilles Tjoelker 0f8db0552e channel: Remove write-only field. 2014-05-29 17:41:35 +02:00
Jilles Tjoelker 51452a370b channel: Stop pretending to support per-mode server capabilities.
After a change for dynamic server capabilities, the code to send out mode
changes was changed to use the capabilities belonging to the last mode
being sent out. This does not make sense; therefore, just use no
capabilities and remove supporting infrastructure.
2014-05-29 17:40:16 +02:00
Jilles Tjoelker 72ae8a1f7b Merge branch 'patch-1' of https://github.com/auscompgeek/charybdis 2014-05-29 15:42:47 +02:00
Mantas Mikulėnas c72f15bcf5 m_version: remove spaces from version string
"to make it machine parseable again", as in ircd-seven commit 03b2176b88a1.
2014-05-06 16:28:23 +03:00
auscompgeek bd96349c86 strip_colour: Strip '\x0F' (^O, formatting off)
Reported by ssbr on freenode:

chmode +c doesn't strip ^O, which turns off all previous formatting.
This can cause clients that internally use mIRC formatting to render messages weirdly,
e.g. highlighted messages in HexChat: <https://i.imgur.com/eDX8Aif.png>.
2014-04-17 13:12:11 +10:00
Keith Buck 55abcbb20a Remove trailing whitespace from all .c and .h files.
3134 bytes were removed.
2014-03-03 04:25:47 +00:00
Keith Buck dceac3e4fb conf parsing: Fix memory leaks and clean up code a bit.
Charybdis currently leaks about 45-50k per configuration parse,
including every rehash. This change plugs these leaks by properly
iterating through all conf_parm_t structures to seek all strings that
should be freed and also by freeing the conf_parm_t structures
themselves.

These leaks have been present since the original rewrite of the
configuration parsing system in ircd-ratbox r11953.

Additionally, this change also cleans up and documents the parsing code
a bit.
2014-02-28 17:35:51 +00:00
Jilles Tjoelker 26c6ac3dc7 Simplify module path list, removing strcpy use. 2014-02-23 23:47:27 +01:00
Jilles Tjoelker 77910830e3 Fix various printf arg types. 2014-02-23 23:01:59 +01:00
Jilles Tjoelker a9f1281448 modlist: Fix address display on 64-bit systems. 2014-02-23 22:55:40 +01:00
Rylee Elise Fowler 1870e06ad3 autotools: fix typo relating to ban db 2014-01-31 11:03:54 -05:00
Keith Buck 7f3382fe98 Remove duplicate default-value code.
Default values for default_floodcount and default_ident_timeout are set
in s_conf.c. Remove code that checks for missing values in ircd.c.
Additionally, reset default_ident_timeout to 5 if an invalid value (i.e.
0) is provided.
2013-10-29 09:32:28 +00:00
Jilles Tjoelker 364e59f82a whowas: Use the normal rules for IP visibility.
Add the flags (auth{} spoof, dynamic spoof) to struct Whowas and add a
show_ip_whowas().

Normal users now see IPs of unspoofed users, and remote opers can see IPs
behind dynamic spoofs. Also, general::hide_spoof_ips is now applied when
the IP is shown, not when the client exits.
2013-09-14 12:26:32 +02:00
Jilles Tjoelker 2635cc8089 Fix parameter name in header file for show_ip_conf(). 2013-09-14 12:26:24 +02:00
Keith Buck 77d3d2dbaf Remove s_assert definition from ircd_defs.h and add it to its own header.
s_assert requires some higher-level functionality that shouldn't be
present in ircd_defs.h. ircd_defs.h is used by ssld, which has no notion
of logging or sending IRC messages. Additionally, some of the headers
s_assert depends on result in conflicting definitions in ssld.c.

This change also fixes the compile when using --enable-assert=soft.
2013-09-10 06:10:14 +00:00
Elizabeth Myers 3c93d380e0 Add support for multiple forms of blacklist queries using matches.
It supports both literal and last octet matches from the dnsbl.
If matches is not present, the old behaviour is used.
2013-04-20 20:49:11 -05:00
Elizabeth Myers 9d745dbd21 Implement kill-cancelling hook.
With this comes an example module to block the killing of services.

NOTE: this will not cancel remote kills. Those are still accepted, per
the TS 6 specification.
2013-04-20 01:07:55 -05:00
William Pitcock 6f7b36d5d0 Mostly enable support for checking format strings with -Wformat.
Basically derived from Ratbox 3.1.
2013-02-21 05:46:04 -06:00
William Pitcock 3dae60ef47 cache: use rb_strdup() instead of a static buffer for cache lines.
BUFSIZE limitation is retained as there is no need to remove it, as all lines must be smaller than it
due to RFC1459 message requirements.
2013-01-15 16:24:33 -06:00
Jilles Tjoelker 22cae20f02 server: Make sure CAP_CAP and CAP_TS6 are non-zero.
A zero CAP_CAP caused duplicate CAPAB to go undetected, allowing a
mismatch between what is sent out via ENCAP GCAP and what applies locally.

A zero CAP_TS6 allowed server connections without SID (with a valid
connect block).
2012-12-18 17:03:59 +01:00
William Pitcock 1cf9ef50cd numeric: add 744 (ERR_TOPICLOCK) to list so we don't step on inspircd 2012-10-13 17:50:12 +00:00
Keith Buck 5bd79c2c56 res.c: Try other servers if errors or corrupt replies are encountered.
Currently, the resolver treats SERVFAIL, NOTIMP, and REFUSED queries the
same as NXDOMAIN, but this really should not be the case. Instead, if
the DNS server errors on our request or provides an invalid request, try
another server.

Also, count DNS server errors in addition to timeouts and avoid these
undesirable servers.
2012-10-09 05:58:02 +00:00
William Pitcock c4e81ae9e9 m_starttls: handle error condition with ERR_STARTTLS (691) numeric per tls-3.2 specification 2012-09-22 19:31:55 -05:00
William Pitcock 538d4d6188 m_cap: add 'tls' core capability 2012-09-22 14:15:45 -05:00
William Pitcock 3e54d7bfb0 Define RPL_STARTTLS. 2012-09-22 14:04:57 -05:00
Keith Buck 7d60375446 Add new conf_read_start and conf_read_end hooks. 2012-05-21 20:22:07 +00:00
Keith Buck 62cf5b4036 Call the privmsg_channel hook for part messages too. 2012-04-07 03:03:07 +00:00
William Pitcock f30a5ee4c4 Remove MODE_NOCTCP from core, in favor of chm_noctcp. 2012-03-31 22:48:36 -05:00
William Pitcock 67aeaba593 Remove MODE_NOCOLOR from core, replacing it with modules/chm_nocolour.so. 2012-03-31 22:26:45 -05:00
William Pitcock ca4c2a86ee Add support for hookifying PRIVMSG/NOTICE.
This will allow us to modularize message processing, e.g. having new modules to manipulate
channel and private messages in new ways.

Yes: it can be used to intercept messages, but such modules are already out in the wild for
charybdis anyway -- so this doesn't really change anything there.

If you are changing the text, then it is your responsibility to provide a pointer to a new
buffer.  This buffer should be statically allocated and stored in your module's BSS segment.
We will not, and cannot, free your buffer in core, so dynamically allocated buffers will
cause a memory leak.

This will allow us to simplify m_message considerably, by moving channel mode logic out to
their own modules.
2012-03-31 21:23:01 -05:00
Keith Buck 330692a1f2 Add option to immediately apply nick RESVs by FNC'ing. 2012-03-25 01:34:45 +00:00
William Pitcock 02270e9602 Add listen::defer_accept option for controlling usage of TCP_DEFER_ACCEPT option. 2012-03-17 10:00:39 -05:00
Jilles Tjoelker 57b1cd5f6b strip_colour: Prefer IsDigit to isdigit.
Unlike isdigit, IsDigit can safely be applied to 'char's.
Arguments to isdigit needs a character cast to 'unsigned char' or EOF.
2012-03-15 00:58:56 +01:00
Jilles Tjoelker aba43ba823 When stripping colour/control codes, also strip \004.
Some clients such as irssi interpret \004 as colour or other markup.
2012-03-15 00:17:40 +01:00
Nathan Phillip Brink 9f9b7042fb Run autoconf and autoheader. 2012-03-01 03:49:35 +00:00
Nathan Phillip Brink c74836dc4a Add explicit support for being installed into a system triggered with --enable-fhs-paths.
Add two mechanism for avoiding name-collisions in a system-wide
installation of charybdis. The ssld and bandb daemons, intended to be
directly used by ircd and not the user, install into libexec when
--enable-fhs-paths is set. For binaries which are meant to be in PATH
(bindir), such as ircd and viconf, there is now an option
--with-program-prefix=progprefix inspired by automake. If the user
specifies --with-program-prefix=charybdis, the ircd binary is named
charybdisircd when installed.

Add support for saving the pidfile to a rundir and storing the ban
database in localstatedir instead of in sysconfdir. This is, again,
conditional on --enable-fhs-paths.

Fix(?) genssl.sh to always write created SSL key/certificate/dh
parameters to the sysconfdir specified during ./configure. The
previous behavior was to assume that the user ran genssl.sh after
ensuring that his current working directory was either sysconfdir or a
sibling directory of sysconfdir.
2012-03-01 02:41:09 +00:00
Jilles Tjoelker f8e43a0b8f Remove dummies, given that ratelimit already broke the ABI once.
As with ratelimit, ircd/modules before and after this commit
are incompatible, but not detected as such.
2012-02-21 21:02:20 +01:00
William Pitcock 63a0ed0604 numeric: reserve RPL_SASLMECHS (908) 2012-02-21 09:15:15 -06:00
Jilles Tjoelker d42e6915cf Pace aways.
This becomes important because of away-notify sending aways to common
channels much like nick changes (which are also paced).

Marking as unaway is not limited (but obviously only does something if the
user was away before). To allow users to fix typos in away messages, two
aways are allowed in sequence if away has not been used recently.
2012-02-18 16:32:57 +01:00
Keith Buck e88a1f1b15 Add ratelimit for high-bandwidth commands. 2012-02-18 03:54:44 +00:00
Keith Buck c5bbc60375 Add away-notify client capability. 2012-02-14 14:15:44 +00:00
William Pitcock a16910aa4e capability: add capability_index_stats() for getting statistics about the capability broker system 2012-02-04 21:27:43 -06:00
William Pitcock 885cd603b5 capability: add global list of capability indexes, and name all capability indexes 2012-02-04 21:16:40 -06:00
Jilles Tjoelker bde42c6063 Don't shadow the name "index". 2012-02-04 15:15:26 +01:00
William Pitcock f01f67f0ad capability: add capability_require(). 2012-02-04 02:00:33 -06:00
William Pitcock 346fba9252 Migrate capability negotiation code to new dynamic capability management API.
This needs a lot of testing, obviously.
2012-02-04 01:47:46 -06:00
William Pitcock ec3a9055f2 capability: add capability_index_mask() which calculates old CAP_MASK 2012-02-04 00:39:53 -06:00
William Pitcock 5e773521a9 capability: add capability_index_list() to build a list of capabilities given an index and mask 2012-02-04 00:36:42 -06:00
William Pitcock 64b56afd8c Add a new dynamic capability manager.
Specifically, what this capability manager does, is map keywords to
calculated bitmasks.  These bitmasks are allocated at runtime, so that
the any managed capability index can be manipulated by modules.

Modules should call capability_orphan() when orphaning capabilities.  This
makes it so that bitmasks aren't reallocated, except for cases where the
capability is the same.
2012-02-04 00:05:13 -06:00
Jilles Tjoelker fe74401bf0 Add one more const. 2012-01-08 16:25:34 +01:00
Jilles Tjoelker d9af501aa8 Fix a warning about const with forward channels. 2012-01-08 16:23:18 +01:00
Jilles Tjoelker ae52fe0ff7 Show underlying IPv4 in a remote whois. 2012-01-08 15:51:48 +01:00
Jilles Tjoelker 524a5b3ac7 Add code to get IPv4 addresses from 6to4 and Teredo IPv6 addresses.
It is not used yet.
2012-01-08 15:51:44 +01:00
Jilles Tjoelker be0365e152 Add an error message if a ban mask is invalid.
This is given if the ban mask is too long, it is an invalid extban or the
forward channel is invalid and no other message has been given about that.
2011-12-18 23:24:22 +01:00
William Pitcock b583faf970 Add support for customizing the usable nick length.
This adds a new ISUPPORT token, NICKLEN_USABLE which is strictly an informative value.
NICKLEN is always the maximum runtime NICKLEN supported by the IRCd, as other servers may
have their own usable NICKLEN settings.  As NICKLEN_USABLE is strictly informative, and
NICKLEN is always the maximum possible NICKLEN, any clients which depend on NICKLEN for
memory preallocation will be unaffected by runtime changes to NICKLEN_USABLE.

The default NICKLEN is 50; the default serverinfo::nicklen in the config file is set to
30, which is the NICKLEN presently used on StaticBox.
2011-11-29 16:10:21 -06:00
Stephen Bennett a695b0e40e Apply extended-join client cap to QJM joins 2011-11-12 14:41:01 +00:00
Jilles Tjoelker d74fa5b502 Prefer PATH_MAX to non-standard MAXPATHLEN. 2011-10-28 16:45:18 +02:00
Jilles Tjoelker d182b85454 Minor cleanup to command throttling code:
* Deduce allow_read from the client's state (IsFloodDone) rather than
   storing it in LocalUser.
 * Fix the documentation (in oper /info), however strange
   client_flood_burst_rate and client_flood_burst_max may seem, that is
   how they currently work.
2011-10-04 00:46:00 +02:00