Bram Matthys
d80e601760
Rename sptr->username to sptr->ident, since that is what it is.
...
[skip ci]
2019-09-11 14:31:14 +02:00
Bram Matthys
c69bdbe175
->status is now an enum of ClientStatus and STAT_xx -> CLIENT_STATUS_xx
2019-09-11 14:27:32 +02:00
Bram Matthys
792709bf4f
Move cptr->fd to cptr->local->fd. This may cause some crashes while
...
the rest of the code is audited / checked ;)
2019-09-11 14:21:07 +02:00
Bram Matthys
cb236eea88
Rename cptr->from to cptr->direction, since the 'from' is rather misleading
...
as cptr->from is NOT (necessarily) the server where cptr is connected to.
So we now call it cptr->direction since it indicates the directly connected
server (or &me)... in other words: the direction of the client path.
2019-09-11 14:03:27 +02:00
Bram Matthys
6a019d6188
Let's allow user connections.
...
*sigh*
(at least we have automated tests for this)
2019-09-11 13:44:55 +02:00
Bram Matthys
1e6a3bdd55
Bump PASSWDLEN to something "large enough for everyone" (256) rather than current (48).
2019-09-11 13:27:45 +02:00
Bram Matthys
786054e6b7
Remove 'md5', 'sha1' and 'ripemd160' from auth code. These are insecure and
...
old authentication types that are already deprecated in UnrealIRCd 4.x.
They don't contain any rounds which means they can be cracked at a rate of
millions per second. Use the secure hashing type 'argon2' instead
(or, if you must, use the less secure 'bcrypt' type).
2019-09-11 13:17:28 +02:00
Bram Matthys
04607f5b1a
Various auth cleanups: Auth_Check() now returns 1 on allow and 0 on deny (!)
...
to keep things simple, rather than having 4 different return values
(yes.. FOUR!).
[skip ci]
2019-09-11 13:10:15 +02:00
Bram Matthys
05e776fb71
More cleanups: now mostly auth-related: use better names and use enums
...
for authentication types. Rename Auth_Make to Auth_Hash. Add docs. etc.
2019-09-11 12:37:34 +02:00
Bram Matthys
e8d53ffe8e
And more type changes to make things consistent and more readable.
2019-09-11 11:04:31 +02:00
Bram Matthys
2a5ea10453
Lots of changes again. Most notable: Cmdoverride -> CommandOverride,
...
including things like CallCmdoverride() to CallCommandOverride().
Type changes like aTKline -> TKL and many more (in particular
aSomething to Something etc. such as aWatch to Watch) but these are
less used by 3rd party module coders.
2019-09-11 10:20:00 +02:00
Bram Matthys
f55682cbaa
More (typedef) struct name changes. Mostly configuration but also
...
aCommand to RealCommand. Although not sure if this latter makes
things a lot more descriptive :D. Can revisit later.
(more to follow)
2019-09-11 10:04:47 +02:00
Bram Matthys
23116d344a
Give structs the same name as the typedefs. Rename aClient to Client,
...
aChannel to Channel, and some more. Third party module coders will
love this. But.. it makes things more logical and the doxygen output
will look more clean and logical as well.
(More changes will follow)
2019-09-11 09:48:00 +02:00
GottemHams
fbd7ff1f5a
Implemented set::min-nick-length (default 0 aka no minimum required) and added a line for it to /stats S, as a bonus my editor strips trailing whitespace :D
2019-09-09 20:33:38 +02:00
GottemHams
a0db737408
hideserver module still used old-style version string [skip-ci]
2019-09-09 19:46:46 +02:00
Bram Matthys
e5f73fdbcd
Don't use custom inet_pton{4,6} functions
...
[skip ci]
2019-09-09 17:08:25 +02:00
Bram Matthys
5e4c481d93
Yes, strcasecmp is always available, configure.
2019-09-09 16:30:02 +02:00
Bram Matthys
7d4b7c2fed
Get rid of stricmp/strnicmp (use strcasecmp/strncasecmp)
2019-09-09 16:13:32 +02:00
Bram Matthys
8d453ffc40
Get rid of index() and some useless casts
2019-09-09 14:54:49 +02:00
Bram Matthys
d434cf948b
Get rid of bcmp/bcopy/bzero.
2019-09-09 14:41:40 +02:00
Bram Matthys
a0aec38df2
Get rid of DISABLE_USERMOD, since you can achieve the same in U5 via
...
the restrict-commands module in a dynamic way (with more options too).
2019-09-09 13:27:25 +02:00
Bram Matthys
90d39d4665
tkldb module: Turn a few config_error() into config_warn() since
...
we continue, while errors mean we would fail to boot (or fail to rehash)
which is not the case.
2019-09-08 20:50:55 +02:00
Bram Matthys
0c4502bf79
Define and use SIPHASH_KEY_LENGTH rather than some magic value.
2019-09-08 14:15:23 +02:00
Bram Matthys
ebd9c738f2
Some cleanup/rewrites of 'r' (repeat) in the floodprot module (+f).
...
Use a more simple hashing algorithm and one that uses 64 bits,
don't allocate any memory dynamically, just use an int64_t.
Also, only do the hashing if 'r' is actually enabled in +f
on the channel, as otherwise it's pointless.
2019-09-08 14:06:40 +02:00
Bram Matthys
9fe82e4a9f
Fix read-after-free in HOOKTYPE_LOCAL_PART hook.
2019-09-08 08:41:58 +02:00
Bram Matthys
e9847a2279
Fix OOB read due to last commit ( 62c7f67f7a)
2019-09-08 08:38:13 +02:00
Bram Matthys
62c7f67f7a
Make StripControlCodes() filter out zero width space as well (U+200B).
2019-09-07 18:32:21 +02:00
Bram Matthys
7eb9ed90cb
Cleanup sub1_from_channel. Don't kick insecure users on +z channels when we
...
are merging (equal TS), only kick our users when we are on the losing side
(=if there is a different TS, IOTW: the channel was recreated later).
2019-09-07 14:45:47 +02:00
Bram Matthys
ab0608a98c
Don't send OperOverride notice if &me (server)
...
[skip ci]
2019-09-07 11:06:04 +02:00
Bram Matthys
c6cfc2f5c8
Fix receiving "+i must be set" twice (for users) or more (for opers)
...
[skip ci]
2019-09-07 10:52:38 +02:00
Bram Matthys
b9e2f1c5fb
Fix crash in RMTKL (only possible with rogue server traffic)
...
[skip ci]
2019-09-07 10:25:36 +02:00
Bram Matthys
62dc1181ba
Protect against late bogus PROTOCTL SID=xxx (from authenticated servers)
2019-09-07 10:16:46 +02:00
Bram Matthys
d3db771a1b
Add some tracing code until a certain RMTKL bug is found.
2019-09-07 09:35:50 +02:00
Bram Matthys
7c9325d8d1
Move get_mode_bitbychar() and get_extmode_bitbychar() to the core
...
rather than helper functions in floodprot. (I need them)
2019-09-07 09:24:26 +02:00
Bram Matthys
62c0edde12
Partially rewrite SVSMODE #chan code to fix a crash from hostile servers.
...
Also get rid of the TS parameter in there, which nobody uses anyway.
It didn't even refer to the channel TS.. quite confusing..
it used user->since... so it seems it was against crossing users
(nick changes)... well, we have UID for that now.
2019-09-07 08:02:07 +02:00
Bram Matthys
dc5fd50a54
Fix potential issues if msgbypass extban module is not loaded.
...
[skip ci]
2019-09-06 20:55:42 +02:00
Bram Matthys
a3e911a174
Make issecure (+Z/-Z) use the same msgids network-wide.
2019-09-06 15:18:45 +02:00
Bram Matthys
cf873d826a
Add MessageTag *mtags argument to various (channel related) hooks, in case
...
they need access to those. For more information, see:
https://bugs.unrealircd.org/view.php?id=5343
2019-09-06 14:30:16 +02:00
Bram Matthys
4a6f56e967
Fix list modes not being restored properly from channeldb.
2019-09-06 13:06:53 +02:00
Bram Matthys
758dc74315
Fix memory leak in new ban exception code.
2019-09-06 09:15:27 +02:00
Bram Matthys
73d320f553
Use enum for BAN_ACT_* and silence a (stupid) clang warning.
2019-09-05 20:54:31 +02:00
Bram Matthys
868895c70a
Add except ban type 'all'. For a full list of options, see
...
https://www.unrealircd.org/docs/Except_ban_block#UnrealIRCd_5
Also, fix shun (s) not being available as an exempt option (bug).
2019-09-04 19:38:23 +02:00
Bram Matthys
750479aa2c
Add more /ELINE options to bypass the following types: unknown data flood,
...
antirandom, antimixedutf8 and ban version. Just type /ELINE to see the
options / syntax. (TODO: more testing)
2019-09-04 18:43:06 +02:00
Bram Matthys
72664fc3df
Deal with hostile servers in msgid code
2019-09-02 20:45:58 +02:00
Bram Matthys
0724c0ce13
stfu compiler, you are wrong
2019-09-02 20:16:46 +02:00
Bram Matthys
7ff78b4cf6
Make config test for except ban::type. Also use 'connect-flood'
...
rather than throttling, since that's the term we use everywhere
in our documentation and for config options.
2019-09-02 20:14:48 +02:00
Bram Matthys
a006a9aea9
Recode tkl type table. '/STATS except' works now (lists ELINEs and
...
except ban in config).
If you want to play with exceptions, type /ELINE for information.
For the configuration file it is important to know that 'except tkl'
is now called 'except ban'.
Also if you do not specify an except ban::type we now default to
exempt from all regular server ban types (but not qline, spamfilters,
blacklist or throttling)
2019-09-02 19:30:23 +02:00
Bram Matthys
58618bf2b6
Add support for ban exceptions, via /ELINE and via the config file.
...
Still need to fix some FIXME/TODO items and things haven't been
fully tested yet, so server sync issues or crashes are still possible.
Release notes will be updated another day as well..
2019-09-01 20:49:14 +02:00
Bram Matthys
76b1655f9b
Add TKL exception type handling (phase 2 of X)
2019-09-01 10:58:29 +02:00
Bram Matthys
2483376796
Fix crash on adding QLINE (reported by The_Myth) and 'STATS bannick'
...
should really show QLINEs as well. Up to now it only showed (local)
config banned nicks.
Fixes https://bugs.unrealircd.org/view.php?id=5387
2019-09-01 08:31:03 +02:00