Bram Matthys [Mon, 20 Nov 2017 15:48:48 +0000 (16:48 +0100)]
extbans/timedban (~t): fix unset not working for +e/+I and reduce load
by spreading the unset event over multiple events (process roughly a
quarter each time). Not important for small networks but for big ones..
Bram Matthys [Mon, 20 Nov 2017 08:44:25 +0000 (09:44 +0100)]
Timedban support in +f [5t#b2]:10 (set 2 minute ban on text flood).
Naturally this is only available if the extbans/timedban module is
loaded and you should do so on all your servers on the same network
if you want to avoid confusion/desynchs.
Bram Matthys [Mon, 20 Nov 2017 08:16:03 +0000 (09:16 +0100)]
Timed bans: ~t:duration:mask
These are bans that are automatically removed by the server.
The duration is in minutes and the mask can be any ban mask.
=> Note that you need to load the extbans/timedban module!
Some examples:
* A 5 minute ban on a host:
+b ~t:5:*!*@host
* A 5 minute quiet ban on a host (unable to speak):
+b ~t:5:~q:*!*@host
* An invite exception for 1440m/24hrs
+I ~t:1440:*!*@host
* A temporary exempt ban for a services account
+e ~t:1440:~a:Account
* Allows someone to speak through +m for the next 24hrs:
+e ~t:1440:~m:moderated:*!*@host
* And any other crazy ideas you can come up with...
Bram Matthys [Sun, 19 Nov 2017 19:43:15 +0000 (20:43 +0100)]
Bug: set::restrict-extendedbans did not have effect in stacked bans.
For example if you had:
set { restrict-extendedbans "a"; };
Then this would be rejected:
MODE #chan +b ~a:Account
However, you could still set:
MODE #chan +b ~q:~a:Account
Now this is properly rejected as well.
Bram Matthys [Sat, 18 Nov 2017 18:15:44 +0000 (19:15 +0100)]
Send errors regarding invalid bans (if available).
Fix case where conv_param() returns NULL (ban rejected)
causing is_ok() function not to be called so the user
never sees the error. We now try to call the is_ok after
conv_param returns NULL.
So not really an API change, more like a fix.
Bram Matthys [Mon, 13 Nov 2017 15:47:22 +0000 (16:47 +0100)]
UnrealIRCd will no longer give +z to users on WEBIRC gateways, unless
the WEBIRC gateway gives us some assurance that the
client<->webirc gateway connection is also secure (eg: https).
This is the regular WEBIRC format:
WEBIRC password gateway hostname ip
This indicates a secure client connection (NEW):
WEBIRC password gateway hostname ip :secure
Naturally, WEBIRC gateways MUST NOT send the "secure" option if
the client is using http or some other insecure protocol.
Bram Matthys [Sun, 29 Oct 2017 10:20:52 +0000 (11:20 +0100)]
Fix numerous crash bugs in server to server code.
In 3.2.x we didn't fix these bugs since servers are trusted and
should send correct commands. In 4.0.x we changed this so we would
fix them when we come across such issues at normal priority (not
consider them security issues). I now took it a step further and
actively checked/looked for these issues and a bunch of them were
found. Almost all are NULL pointer dereferences, with some exceptions.
* S2S: MODE: check conv_param return value (NULL ptr crash)
* S2S: MODE: floodprot: More checks (NULL ptr crash)
* S2S: MODE: OOB write of NULL (write NULL past last element in an array)
* S2S: NICK: old compat fixes (NULL ptr crash)
* S2S: PROTOCTL: Check for double SID=
* S2S: SERVER: require at least 3 parameters (NULL ptr crash)
* S2S: SJOIN: require at least 3 parameters (NULL ptr crash)
* S2S: SJOIN: Fix OOB read (read 1 byte past buffer)
* S2S: TKL: validate set_at and expire_at (NULL ptr crash)
* S2S: TKL: require at least 9 parameters for spamf, not 8 (NULL ptr crash)
* S2S: TKL: ignore invalid spamfilter matching type (remove abort() call)
* S2S: TOPIC: querying for topic is not permitted (NULL ptr crash)
* S2S: UID: require 12 parameters (NULL ptr crash)
* S2S: WATCH: this is not a server command (NULL ptr crash)
* Fix OOB read (1 byte beyond string) for timevals. This was reachable
from config code, TKL (S2S) and /*LINE (Oper). In practice no crash.
* MODE: make code less confusing (effectively no change)
* TRACE: remove strange output in case of 0 lines of output
* Fix unimportant memory leak on boot (#4713, reported by dg)
* Fix small memory leak upon 'DNS i' (oper only command)
* Always work on a copy in clean_ban_mask(). This fixes a bug that could
result in a strlcpy(buf, buf, sizeof(buf)). So, overlapping strings,
which is undefined behavior.
Bram Matthys [Mon, 23 Oct 2017 08:07:33 +0000 (10:07 +0200)]
API change for HOOKTYPE_PRE_INVITE and fix #5023:
* API change for HOOKTYPE_PRE_INVITE:
(aClient *sptr, aClient *target, aChannel *chptr, int *override)
Modules must now send the error message instead of only returning
HOOK_DENY. Also check for operoverride and set *override=1.
This so modules can send their own error messages instead of the
default message being sent ("channel is +V" - which is not true).
Bram Matthys [Sun, 22 Oct 2017 14:41:23 +0000 (16:41 +0200)]
1) From double escaping to single escaping, such joy.
2) Use 'iscc' rather than 'compil32' since the latter pops up a
dialog box which blocks the entire build process.
3) Apparently the VS2017 image has a broken VS2012 since it bails
on winsock.h. So try to use different images for both builds.
Bram Matthys [Wed, 18 Oct 2017 13:03:12 +0000 (15:03 +0200)]
If you have any blacklist { } block then UnrealIRCd will set an
set::handshake-delay of 2 seconds by default. This will allow (most)
DNSBL checking to be finished before the user comes online, while
still allowing a smooth user experience.
If your DNS(BL) is slow then you could raise this setting slightly.
Bram Matthys [Mon, 9 Oct 2017 12:59:19 +0000 (14:59 +0200)]
Add './unrealircd spkifp' which will output the SPKI fingerprint
along with the exact password section to use in the link block
on the other side of the link.
Also used in tutorial now at
https://www.unrealircd.org/docs/Tutorial:_Linking_servers
Bram Matthys [Mon, 9 Oct 2017 12:17:35 +0000 (14:17 +0200)]
Tell admins to verify the SSL/TLS certificates of their server links.
https://www.unrealircd.org/docs/Link_verification
This is only outputted if both sides are 4.0.16+ so we can use spkifp
and use the same instruction on both sides of the link.
(If we would do it for previous versions then we would only give
half of the instructions to the users, which makes no sense)
Bram Matthys [Mon, 9 Oct 2017 10:28:08 +0000 (12:28 +0200)]
Add support for 'spki' authtype. Example:
password "AHMYBevUxXKU/S3pdBSjXP4zi4VOetYQQVJXoNYiBR0=" { spkifp; };
This value will stay the same even for new SSL/TLS certificates,
as long as the key stays the same. This can be useful in case of
Let's Encrypt (if you use a tool that keeps the same key, that is,
certbot does not at the moment). Suggested by grawity (#5014).
Also make auth type 'sslclientcert' available as 'cert' and
make 'sslclientcertfp' available as 'certfp'.
Bram Matthys [Sun, 8 Oct 2017 16:19:16 +0000 (18:19 +0200)]
When booting the IRCd and the log is full (log::maxfilesize), the IRCd
would not write the appropriate 'Max file size reached' message to the
old log file. Reported by NoMiaus (#4919).
Bram Matthys [Sun, 8 Oct 2017 15:09:28 +0000 (17:09 +0200)]
A common complaint is that spamfilters are hard to remove. Well, no more!
There is now '/spamfilter del' which will output all spamfilter along with
the appropriate command to delete each spamfilter (by unique ID).
This way it should be easy for anyone to delete an existing spamfilter.
We also refer to this new feature from '/spamfilter', '/stats spamfilter',
etc.
Bram Matthys [Sun, 8 Oct 2017 13:44:42 +0000 (15:44 +0200)]
Add option: set { ban-include-username yes; }; which will make bans
places by spamfilters (and some other systems) to be placed not on *@ip
but rather on user@ip. Note that this won't work for ZLINE/GZLINE since
no ident/username lookups are done in such cases.
Bit of a niche feature but okay..
Bram Matthys [Sun, 8 Oct 2017 13:14:57 +0000 (15:14 +0200)]
Add set { cloak-method ip; }; which will make cloaking only be done
on the IP and thus result in an XX.YY.ZZ.IP cloaked host.
This so you can have "IP cloaking" without disabling DNS lookups.
GLINES on hosts still work and IRCOps (and yourself) can still see
the host in /WHOIS.
Requested in 4957 by Gottem and The_Myth.
Bram Matthys [Sat, 7 Oct 2017 19:05:49 +0000 (21:05 +0200)]
Automatically discover SASL server if saslmechlist is sent by services
and set::sasl-server is not set by the administrator. Looks like this:
*** Services server 'services.test.net' provides SASL authentication, good! I'm setting set::sasl-server to 'services.test.net' internally.
Hopefully this will increase SASL availability significantly.
That is, once anope and atheme start sending the saslmechlist to us,
of course ;) (see commit d6e26d59e5d403702152b34c94634fb873bba015)
Bram Matthys [Sat, 7 Oct 2017 17:40:39 +0000 (19:40 +0200)]
Move CAP NEW "sasl" sending to after EOS (End Of Synch)
This so saslmechs are properly sent in case of services (re)connect,
otherwise the CAP NEW is sent too early when the saslmechs are
not known yet.
NOTE: This makes sending "EOS" mandatory for any SASL servers.
You should be doing this since 14 years ago (it was added
in 3.2beta18 in August 2003) so hopefully that is the case.
Anope is good anyway :)
Bram Matthys [Sat, 7 Oct 2017 17:20:06 +0000 (19:20 +0200)]
Allow services to set the saslmechlist so it can be used by sasl v3.2.
Note to services coders: send something like this:
MD client your.services.server saslmechlist :EXTERNAL,PLAIN