1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-28 23:06:38 +02:00
Commit Graph

2681 Commits

Author SHA1 Message Date
Bram Matthys f169a3cf77 Fix channel ops unable to -h someone, even though they could +h.
Reported by Jaka in https://bugs.unrealircd.org/view.php?id=6077 and
Valware and buayadarat in https://bugs.unrealircd.org/view.php?id=6078

This commit also makes the halfop rules for +h/-h match the ones in U5:

Previously in 6.0.0 - 6.0.2 it was:
* halfops can set +h on others
* halfops cannot set -h on others
* halfops can set -h on themselves

Now in 6.0.3+ it matches 5.x behavior again:
* halfops cannot set -h or +h on others
* halfops can set -h on themselves
2022-03-18 07:26:53 +01:00
Bram Matthys 29fd2e772a ** UnrealIRCd 6.0.2 ** 2022-01-28 17:02:19 +01:00
Bram Matthys 83e74893da Relookup reputation and geo information when client IP changes due to WEBIRC
or another type of proxy request.
This fixes a problem where ban user { } or except ban { } is not working
for ~country:XX when the request comes via a WEBIRC or other proxy.
Reported by CaoS in https://bugs.unrealircd.org/view.php?id=6058
It should also fix security-group being incorrect for ~security-group bans
or exempts.
2022-01-17 08:09:15 +01:00
Bram Matthys d4f09f8fed HOOKTYPE_*_CHANGED -> HOOKTYPE_*_CHANGE to be a bit more consistent with
the rest of the hooks, most of which do not use the past tense.
Only affects HOOKTYPE_USERHOST_CHANGE / HOOKTYPE_REALNAME_CHANGE.

This does, however, make it inconsistent with the userhost_changed()
call, though :D.
2022-01-17 08:02:18 +01:00
Bram Matthys f3d827c577 Add HOOKTYPE_IP_CHANGE and call it when the IP address changes.
Eg for WEBIRC or other proxy.

This does not yet fix any problem, it just changes the way things are
called. More to follow.
2022-01-17 07:55:45 +01:00
i c1ec164a65 fix flat-map display 2022-01-08 03:46:09 +03:00
Bram Matthys 60a70acd86 channeldb: convert letter extbans to named extbans (.db for +P channels) 2022-01-07 12:10:10 +01:00
Bram Matthys 329fd07f3a Revert set::spamfilter::utf8-support from yesterday.
This will be for a later release, needs more thought and work.
2022-01-06 18:03:26 +01:00
Bram Matthys bd05cdf779 Don't do GeoIP lookups for remote users. These are already looked up and
synced by the server the user is on, and this way the country will be
consistently the same on all servers (and not BE on one, and NL on another,
which would be confusing for the ban matching code, giving different
results on each server).
2022-01-06 15:31:54 +01:00
Bram Matthys dedff543b5 Add option set::spamfilter::utf8-support which defaults to 'no' for now.
When you set this to 'yes' you get more options...
See next (modified) copy-paste from April 2020, which had to be reverted
because PCRE2 was broken. Now it's an opt-in and hopefully matured a bit.

This means:
* Case insensitive matches work better in UTF8 now, such as extended Latin.
  For example, a spamfilter on "ę" now also matches "Ę", while previously
  it did not catch this.
* Other PCRE2 features such as https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC5
  are now available. For example you can now set a spamfilter with the regex
  \p{Arabic} to block all Arabic script, or
  \p{Cyrillic} to block all Cyrillic script (such as Russian)
  Use these new tools with care, of course. Blocking an entire language,
  or script, is quite a drastic measure.

All of this was possible because of the new PCRE2_MATCH_INVALID_UTF
compile time option which was introduced in PCRE2 10.34. Now, that
version turned out to be buggy. As recent as PCRE 10.36 some major bugs
were fixed. This also means we now require at least PCRE2 10.36 version
so everyone can benefit from this new spamfilter UTF8 feature, IF they
enable set::spamfilter::utf8-support, that is.

Many systems come with older PCRE2 versions so this means we will
fall back to the shipped PCRE2 version in UnrealIRCd. This means
./Config will take a little longer to compile things.

For packagers (rpm/deb/ports): if you choose to patch configure to
not require such a recent PCRE2, then please do not allow enabling
of set::spamfilter::utf8-support since it will likely cause crashes
and misbehavior. Check PCRE2 changelog, CTRL+F at PCRE2_MATCH_INVALID_UTF
2022-01-05 18:08:52 +01:00
i 1c4da04346 add WHO parameter for searching by connect time 2022-01-04 21:25:36 +03:00
i 7430d3718a add support for rate limiting -x/-t (set::anti-flood::<groupname>::vhost-flood) 2022-01-04 21:23:57 +03:00
i d8f440e9e7 add map percentages 2022-01-04 21:21:38 +03:00
Bram Matthys 33dac730c7 When a remote server forgets to send the TS in a MODE message with the
sender being a server, then we now spread it on with a zero TS so we
avoid a potential desync elsewhere, or at least try to limit it.
2022-01-04 11:10:40 +01:00
Bram Matthys 243c6635da Update /STATS P output a little (since it shows the control channel). 2022-01-03 13:51:46 +01:00
k4be d8bb78677f Add TS to s2s MODE messages generated by SVS(2)MODE
(if the source is a server).
2022-01-02 20:09:57 +01:00
Bram Matthys 834736070e Make "SVS(2)MODE -b user" work properly for extended bans.
It was missing for a lot of extbans (removing too little) and
for ~t it was removing too much (eg quiet bans).
Bug reported and changes suggested by k4be.

Coders:
Setting extban.options to EXTBOPT_CHSVSMODE has no effect anymore,
just didn't want to remove it so modules would still compile.
We now purely match based on .is_banned_events including BANCHK_JOIN.
2022-01-02 13:12:33 +01:00
Bram Matthys dbef19cd7a Add initial implementation of UNIX domain sockets (listen::file).
Various things still need to be done: a lot more testing, ability to
set permissions on the file, #ifdef's because of lack of support
on Windows (currently won't compile), etc.

One thing that I don't intend to change is that I chose not to display
the socket in the host but have clients show up as 'localhost' (and
ip '127.0.0.1'). Doing it this way keeps things easy, otherwise we risk
a lot of breakage for nearly nothing gained, really.

Things can be tested via:
listen {
        file "/tmp/listen";
}

and then with netcat:
nc -U /tmp/listen
USER x x x x
NICK hai
etc...
2022-01-01 18:48:17 +01:00
Bram Matthys 40c528acde Add missing space in spamfilter log message.
This is a fix-for-fix b98d02817a.

Reported by armyn in https://bugs.unrealircd.org/view.php?id=6049
2021-12-30 16:42:29 +01:00
Bram Matthys 0242b509b8 Fix compatibility between U5 and U6 for named extended bans in SJOIN
when SJSBY is enabled. This caused named bans not to show up properly
(or not at all) on the U5 side when syncing servers.
2021-12-29 19:21:02 +01:00
Valerie Pond f4bf9986af Fix some typos in CHGIDENT and CHGNAME log messages (#189) 2021-12-28 18:09:08 +01:00
Bram Matthys f7719d2de2 Make TKL add/remove/expire oper messages show a [duration: 60m] instead of
the [expires: ZZZZZZZZZZZZZZZZZZZZ GMT] string.

This because most people are interested in the length of the ban (so
relative time) and the exact time a TKL expires is less interesting
(the absolute time) and due to GMT/UTC requires calculating to the
local timezone too.

This also makes the tkl expiry messages be more like the add message,
with []'s, while previous it used more free text at the end of the line.
2021-12-26 09:00:39 +01:00
Bram Matthys b98d02817a In SPAMFILTER_MATCH log message, remove leading space in 'destination' JSON.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6027
2021-12-22 17:11:44 +01:00
Bram Matthys c586c14b9f Fix ~T / ~text ban not working (was not censoring or blocking) 2021-12-22 09:25:59 +01:00
Bram Matthys 8dd1864cee Channel mode +f (flood) could place a timed extban with ~t instead of ~time.
This was only a visual issue, and coincidently these bans were still being
removed after the appropriate time, even without the fix for
0b6a70368c.
2021-12-22 09:10:51 +01:00
Bram Matthys 0b6a70368c Fix timed bans (~t/~time) not expiring if all servers on the net are U6.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6032
2021-12-22 09:10:05 +01:00
Bram Matthys 3059f3289a Channel is not +H? Send empty response/batch (as per IRCv3 discussion)
Backport of https://github.com/unrealircd/unrealircd/pull/156
(simplified)
2021-12-19 10:45:52 +01:00
crazycatdevs 9e7d4b0122 Small simplification (#185) 2021-12-19 10:24:36 +01:00
Bram Matthys d77f42e4be This one should be the other way around...
Not that anything is this particular code path should trigger it (OK,
maybe if some 3rd party module kills the user from HOOKTYPE_SECURE_CONNECT)
better safe than sorry.
2021-12-17 14:20:39 +01:00
Bram Matthys 2a574120f5 Rename function to avoid clashes 2021-12-11 10:25:15 +01:00
Bram Matthys bf1860bba8 Send nick!user@host in WALLOPS message from self.
Fix-for-fix 9f56fb4aa7
2021-12-10 19:41:36 +01:00
Bram Matthys 4702185315 Fix authprompt module: was sending trailing NUL byte in SASL, causing
all authentication attempts to fail via the module (/AUTH user:pass).
2021-12-05 10:19:33 +01:00
Bram Matthys c604a3a70e Make soft extended server bans actually work (GLINE %~country:XX)
Reported by musk in https://bugs.unrealircd.org/view.php?id=6019
2021-12-05 09:45:13 +01:00
Bram Matthys adc8d5802f Fix +s/+p during netmerge (was on todo) 2021-12-04 10:17:34 +01:00
Bram Matthys b25da63d27 Allow SVSLOGIN also if set::sasl-server is not set.
Because yeah... why not.
2021-12-04 09:42:51 +01:00
Bram Matthys e78df2461f Fix wrong mode being mentioned in ERR_NOTFORHALFOPS for +L 2021-12-04 09:15:58 +01:00
Bram Matthys b363b2e804 Fix wrong +q vs +a KICK access check. 2021-12-03 18:11:54 +01:00
Bram Matthys 8c8b4279b8 Ignore case-changes in nicks, even though not clear yet if it should be,
https://bugs.unrealircd.org/view.php?id=6013 reported by progval.
2021-12-01 08:49:41 +01:00
Bram Matthys 4af7a541f8 Add 'oldnick' to HOOKTYPE_POST_LOCAL_NICKCHANGE and HOOKTYPE_POST_REMOTE_NICKCHANGE 2021-12-01 08:40:02 +01:00
Bram Matthys 92820fc2e8 Fix uninitialized memory read on snomask change (oper-only) 2021-11-30 06:34:54 +01:00
Bram Matthys d59537391a Cut off channel for KICK at first comma, as we did in U3.2/U4/U5.
Reported by progval in https://bugs.unrealircd.org/view.php?id=6015
2021-11-29 17:23:45 +01:00
Bram Matthys 1cd79e381a Fix expansion issue in log message on invalid SJOIN SJSBY (rare)
'$client' was shown as-is instead of expanded, since it was missing.
2021-11-27 10:46:53 +01:00
Bram Matthys cb55931c6e Fix crash on incorrect S2S traffic: "HISTORY" request from remote user.
(This cannot be triggered by clients under normal conditions, only with
deliberate wrong S2S traffic, such as OS RAW, modified source, etc)
2021-11-26 17:06:27 +01:00
Bram Matthys 46d0b4d6bb Actually let's fix this one in -beta4 as well. 2021-11-21 17:34:00 +01:00
Bram Matthys 0408c10533 Fix permission check for MODE. Reported by Valware.
This check was accidentally cut out when removing support for bounce
modes in a5b86fcc11.
2021-11-21 16:41:03 +01:00
Bram Matthys d3c98413c1 Websocket module: fix memory leak and also two issues in new forwarder
code (OOB write and a NULL pointer dereference), those last two only
happen for trusted forwarders though.
2021-11-21 16:38:12 +01:00
Bram Matthys e817606ead More of the same. 2021-11-21 10:11:56 +01:00
Bram Matthys dfb7e403e3 Fix issue where an UnrealIRCd 5 server sends one mode line and an
UnrealIRCd 6 server would expand it into two different mode lines
with IDENTICAL msgid values. Obviously message ids must be different
for different events.
Introduced by b078a9c8b5.
2021-11-21 09:35:37 +01:00
Bram Matthys 86b7284e37 Fix another memory leak in SJOIN, similar to the one of an hour ago.
Introduced by b078a9c8b5.
2021-11-21 09:28:13 +01:00
Bram Matthys 75ef181d97 Fix memory leak in SJOIN.
Introduced by b078a9c8b5.
2021-11-21 08:19:40 +01:00