13596 Commits

Author SHA1 Message Date
genius3000
3203d698ae Fix ELine::Matches returning false on existing match
When checking for an E-Line match, we want to actually check for a
current match even if we previously matched and are set exempt.

This fixes situations where you have an E-Lined CGI:IRC address,
a G-Lined IP range for some area/host/etc and a smaller E-Lined
IP range for known good clients. Currently when CGI:IRC changes
the IP, E-Lines are rechecked but because the user is already exempt
(from the CGI:IRC E-Line), they are set no longer exempt and match
a G-Line, when they should match an E-Line.

This exact change has been done before in commit 'c8b344e' and shortly
reverted in 'c490a90' to fix issue #989 (CGI:IRC users remaining exempt
when the CGI:IRC address is E-Lined but they are not).
The actual cause to this issue was likely that the user's hostname was
not changed from the CGI:IRC hostname/IP prior to rechecking E-Lines.
This is being fixed in a separate commit.
2018-04-06 22:29:42 +01:00
Peter Powell
1cc4cf341c Set User::host before calling ChangeIP()
ChangeIP() calls SetClientIP() which revalidates whether the user
matches an ELine. However, because the hostname has not changed yet
the user may incorrectly be marked as non-exempt.
2018-04-06 22:29:42 +01:00
Dylan Frank
4ec475ba10 Refactor m_sqloper to be a full opers.conf replacement (#983).
m_sqloper now supports dynamic fields, works with m_sslinfo, and works with /stats o.
2018-04-06 18:34:15 +01:00
Peter Powell
d04db003df Implement support for banning users from channels by country code. 2018-04-06 18:05:15 +01:00
genius3000
9ea8191a05 Validate settings in order in ValidateSettings() (#1475).
* Validate the settings in the same order as the parameter syntax
* Always validate Lines and Secs regardless of having a Diff
* Check Backlog for greater than Max as well as being disabled
2018-04-06 16:08:30 +01:00
Dylan Frank
d53d919bd8 Prioritize checking for +ikl last to match previous behavior (#1474). 2018-03-31 22:51:51 +01:00
Peter Powell
802eed1734 Move <security:announceinvites> to core_channel. 2018-03-31 13:16:27 +01:00
Peter Powell
b3a728d93f Move checking for +ikl from the core to to core_channel. 2018-03-31 13:00:57 +01:00
genius3000
fdeccd7dd3 Update the GeoIP ExtItem when CGI:IRC sets the real IP (#1471)
Since CGI:IRC calls it's 'ChangeIP()' either from 'OnCheckReady()'
or 'OnUserRegister()', both of which are called after the user has
sent NICK/USER, we can safely skip re-setting the ExtItem prior to
this point.

This skips the first 'OnSetUserIP()' from 'User::AddUser()' as
the 'OnSetConnectClass()' catch handles the initial setting.
2018-03-30 17:08:22 +01:00
Dylan Frank
3fb20b61b6 Ignore expired or invalid client certificates (#1468).
Fixes #1345.
2018-03-29 19:11:55 +01:00
Dylan Frank
90ec02cc98 Do not send unset topics on channel join per RFC (#1469)
Fixes #1091.
2018-03-25 21:24:38 +01:00
Dylan Frank
c7de80233a Separate secret and private channels on whois for non-opers (#1447)
Separate secret and private channels on WHOIS for all users.

- Move the config parsing from the core to core_whois.
- Replace <security:operspywhois> with an oper privilege.
- Introduce <options:splitwhois> to split WHOIS channel lists.

Closes #969.
2018-03-25 17:02:00 +01:00
Peter Powell
017e23fb61
Merge pull request #1461 from puckipedia/haiku-support
Add Haiku support.
2018-03-13 19:31:43 +00:00
Puck Meerburg
56a1ef63e7 Add Haiku support 2018-03-10 20:44:09 +01:00
Peter Powell
ded4474855
Merge pull request #1463 from clinew/insp20+openssl-v1.1-compat
m_ssl_openssl: Remove deprecated API members.
2018-03-04 13:58:00 +00:00
Wade Cline
4cfed4e5f6 m_ssl_openssl: Remove deprecated API members.
Backported from 2afc1af4639ae2bbef397f4f6acc834950017d91.
2018-03-02 21:05:05 -08:00
Peter Powell
27e92622b5 Improve the message shown to the admin when generating SSL certs.
Self-signed SSL certificates are intended for testing purposes. A
production server should be using a CA-signed certificate instead.
2018-03-01 19:43:36 +00:00
Peter Powell
52e8d8b72e
Merge pull request #1458 from linuxdaemon/insp20+duplicate-redir-meta
[2.0] Make sure banredirect metadata can not be duplicated
2018-02-24 11:50:54 +00:00
Peter Powell
7e5e4a5ae2 Append LDFLAGS at the same time as CPPFLAGS and CXXFLAGS.
This deduplicates the addition of these flags.
2018-02-24 11:48:02 +00:00
Peter Powell
0858015761 Release v3.0.0 alpha 6. v3.0.0a6 2018-02-17 21:49:58 +00:00
Peter Powell
5628d84f9e Move m_sslrehashsignal to the extra directory.
This module uses platform-specific behaviour that does not work on
Windows.
2018-02-17 17:44:52 +00:00
Peter Powell
d2efdbf6bb Fix building on Windows (mostly). 2018-02-17 17:12:26 +00:00
Peter Powell
fc4a935e25
Merge pull request #1460 from genius3000/insp20+helpop_fix
[2.0]: Helpop: Move extban 'U' from acting to matching
2018-02-12 10:41:03 +00:00
genius3000
f58ac460e6
[2.0]: Helpop: Move extban 'U' from acting to matching
Already fixed in master in 8587df2
2018-02-11 18:40:23 -07:00
Peter Powell
36e6dc7bc8 Import the anticaps module from inspircd-extras. 2018-02-07 12:20:42 +00:00
Peter Powell
12a47e788b Send the ACCEPT and KEYLEN ISUPPORT tokens.
- The ACCEPT=[count] token specifies the maximum amount of nicks
  which can be added to a m_callerid accept list. This token was
  added by ircd-ratbox in 3.0.9.

- The KEYLEN=[length] token specifies the maximum length of a
  channel key. This token was added by ircd-ratbox in 3.1 beta.

For more info see http://defs.ircdocs.horse/defs/isupport.html
2018-02-07 11:35:42 +00:00
Peter Powell
4132a44396 Allow the maximum length of a chanfilter message to be configured. 2018-02-02 12:54:59 +00:00
Peter Powell
c2376ac6f4 Add names for a bunch of numerics. 2018-02-02 10:43:32 +00:00
Peter Powell
d5a6054948 Add ERR_INVALIDMODEPARAM for responding to invalid mode params.
Currently on invalid modes we do a combination of different things:

1. Send a custom mode-specific numeric (which often collides with
   other modes).

2. Send a server notice.

3. Do absolutely nothing.

This new numeric is a generic way of handling invalid parameters
when setting a mode that avoids all of the mistakes of the previous
behaviour.
2018-01-29 11:52:13 +00:00
linuxdaemon
219e01b5ce Revert std::set changes and add duplicate checking in m_banredirect instead, as requested by @Adam- 2018-01-25 21:34:40 -06:00
linuxdaemon
cf9fb00675 Fix comparator logic for ordering by channel 2018-01-25 19:12:23 -06:00
linuxdaemon
8e5237cca1 Make sure banredirect metadata can not be duplicated 2018-01-25 16:07:30 -06:00
systocrat
3398ce7e50 Improve performance under load of OnDataReady and remove C-isms.
Re-use variables initialized within loop, const-ify config variables
accessed repeatedly, remove eol_found label.

Merges #1451.
2018-01-25 12:11:51 +00:00
Peter Powell
9da5c8e200 Add a module which rehashes SSL modules on receiving SIGUSR1.
This has been imported from inspircd-extras where it was known as
m_rehashsslsignal. The name has been changed slightly to match the
other modules which do SSL stuff (sslmodes, sslinfo).
2018-01-25 11:51:14 +00:00
Peter Powell
b7ecd18b73 Pass an irc::socket::sockaddrs to SocketEngine::SendTo(). 2018-01-20 12:24:35 +00:00
Peter Powell
b18e6b5556 Pass an irc::socket::sockaddrs to SocketEngine::Connect(). 2018-01-20 12:08:09 +00:00
Peter Powell
be12938393 Remove duplicated code in LocalUser::GetServerPort(). 2018-01-20 11:28:47 +00:00
Peter Powell
51206352a9 Fix some minor Doxygen errors. 2018-01-14 18:07:05 +00:00
Peter Powell
e336c3dfa9 Release v3.0.0 alpha 5. v3.0.0a5 2018-01-12 14:57:56 +00:00
Peter Powell
4b7b332b94 Fix some char signedness oversights when using bitsets. 2018-01-07 23:28:01 +00:00
Shawn Smith
cd43acedc9 Add user mode +z for ssl-only private messages.
Closes #468.
2018-01-07 10:35:16 +00:00
Peter Powell
aa78793b3a Strip commas from channel keys like Charybdis and others do. 2018-01-06 16:29:18 +00:00
Peter Powell
2fcb5ff438 Rework message handling.
- Move all message-related types to their own header to make moving
  them to a cross-module events easier.
- Rename OnUserMessage to OnUserPostMessage.
- Rename OnText to OnUserMessage.
- Replace the dest, target_type, and status parameters with the
  MessageTarget class.
- Replace the text, exempt_list, and msgtype parameters with the
  MessageDetails struct.
- Add echooriginal and originaltext to the MessageDetails struct
  to allow spam filtering to not be broken by cap echo-message.
2018-01-06 14:18:21 +00:00
Peter Powell
40514d0ba8 Improve the method that blockcaps uses to block messages.
Previously it had a list of upper case letters and assumed that all
other characters were lower case. This method is flawed as it can
be evaded by using non-alphanumeric characters.

The new method takes a list of lower case letters as well as upper
case letters and ignores any letters which are not listed in one of
the two lists.

The majority of the code for this was borrowed from the m_anticaps
module in inspircd-extras.
2018-01-03 22:33:29 +00:00
Peter Powell
57e4bf9725 Fix m_chanhistory sending the history notice directly to the user.
Closes #1452.
2018-01-03 16:24:19 +00:00
Peter Powell
372bb6ec31 Make InspIRCd::Format return std::string instead of const char*.
Using the latter is problematic as if you don't copy the return
value before calling Format again your formatted message will be
overwritten by something else. This bug was observed in m_callerid
where InspIRCd::Format was being used for formatting two arguments
the latter of which was being overwritten with the former.

We could have preserved the return type and just copied the string
but then callers would have had to deallocate the string once they
have finished with it which is an undesirabable burden to put on
callers.
2018-01-03 12:38:40 +00:00
Peter Powell
5c6352dd9a Increase the config default for <chanhistory:maxlines> to 50. 2017-12-31 18:38:21 +00:00
Michael Hazell
758cf504f1 m_chanhistory: optionally exempt bots from receiving history.
Sending history to some bots can cause problems as without the
IRCv3 chathistory batch they have no way of knowing what messages
are history and what they should respond to.

Closes #1450.
2017-12-31 10:59:02 +00:00
Peter Powell
45689d251a Don't hardcode mode characters which are sent in 005 tokens. 2017-12-29 23:53:44 +00:00
Peter Powell
592dd0e818 Fix various issues with the cgiirc module.
- Respect the value of <cgiirc:opernotice> when sending snotices
  to operators.
- Write to the log file if opernotice is disabled.
- Log to the correct snomask in all cases. This was caused by an
  oversight when merging insp20 into master.
- Replace the full user mask in log messages with a uuid/ip. The
  WEBIRC command is sent as the first command so there will not be
  a nickname or username at this point.
2017-12-27 13:15:43 +00:00