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

2635 Commits

Author SHA1 Message Date
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
Bram Matthys b42953868b Update parameters of other RunHook()s, other than in mode.c,
for HOOKTYPE_REMOTE_CHANMODE and HOOKTYPE_LOCAL_CHANMODE.
2021-11-19 19:04:48 +01:00
Bram Matthys b078a9c8b5 Fix cut-off and expansion issues with MODE, which is a possible problem when
using mixed UnrealIRCd 5 and UnrealIRCd 6 networks.

This is a slightly complex rewrite of make_mode_str() and do_mode(),
as we nog go from single mode lines to potentially multiple mode lines.

In short: whenever we would be near buffer cut-off point (the famous
512 byte limit) then previously we would prevent the mode, though not
succesfully in all cases where a network consists of mixed 5.x and 6.x.
From this point onward we no longer do that. Instead we convert one
MODE command to two MODE lines if that is needed.
The benefit of this is that we no longer prevent it BEFORE processing
the MODE, which is a flawed method and could be wrong (causing desyncs).
And also, we no longer partially ignore MODE lines from clients when
they would cause the limit to be exceeded, as we replace them with
two MODE lines instead.

These are more changes than I wanted at such a late point but.. they seem
to be necessary to prevent U5-U6 compatibility issues.
2021-11-19 13:53:21 +01:00
Bram Matthys 36274f7242 Fix nick-flood message appearing even though the user was not changing nicks. 2021-11-13 13:45:39 +01:00
k4be 0cb599be09 extjwt: enable valid "vfy" url checking and update related documentation 2021-11-11 07:55:22 +01:00
simplexish ec9104a3e1 Fix a typo in SERVER_LINKED_REMOTE log message
Removing ) which doesn't seem to belong
2021-11-11 02:53:16 +03:00
Bram Matthys 717f190336 Fix crash with non-matching link block. 2021-11-10 16:13:02 +01:00
Bram Matthys 36a06b0011 A few changes to server linking notices:
1) Don't forward link.SERVER_LINKED since we already generate
   link.SERVER_LINKED_REMOTE ourselves.
2) Fix using wrong server name(s) in link.SERVER_LINKED_REMOTE
   reported by flo in https://bugs.unrealircd.org/view.php?id=5988
3) Don't show link.SERVER_LINKED_REMOTE messages when we
   are syncing to a network, otherwise you would get eg 50 of
   such messages for 50 servers when you link in 1 server.
2021-11-10 15:42:10 +01:00
Bram Matthys 9f56fb4aa7 Make /WALLOPS send the text also back to the person who issued it
reported by PeGaSuS in https://bugs.unrealircd.org/view.php?id=5764
2021-11-10 07:27:47 +01:00
k4be 48d5af8936 Fix possible null pointer dereferencing 2021-11-06 14:53:08 +01:00
Bram Matthys 761cc8514a Whatever, not important (poison vs unitialized) 2021-11-06 14:17:21 +01:00
Bram Matthys 08f3561ce6 Fix-for-fix from a couple of minutes ago. Duh.. 2021-11-06 14:16:47 +01:00
Bram Matthys 2abef3cdfb Don't check for NULL client in match_user() since it cannot or should not be.
(raises false expectations)
[skip ci]
2021-11-06 13:33:37 +01:00
Bram Matthys 700c579ee7 Fix possible crash in set::part-instead-of-quit-on-comment-change. 2021-11-06 13:27:45 +01:00
Bram Matthys c35174db32 Cleanup: don't check for NULL if they can't be NULL (variables
already dereferenced before)
[skip ci]
2021-11-06 13:26:57 +01:00
Bram Matthys 75b213c0db Fix theoretical bug in case a 3rd party module CommandOverride's "CYCLE" and
reads parv[1] after calling the command.
(Then it would have pointed to local storage which is wrong)
2021-11-06 13:10:17 +01:00
Bram Matthys 4cf2940605 Fix-for-fix from a few minutes ago:
Ah okay, the `continue` in the switch was used as a `break 2`.
Changed to a `return` now as no memory is allocated anyway and
nothing further needs to be done. Also makes it immediately clear
(if you read the code) that processing ends there.
2021-11-06 13:01:12 +01:00
Bram Matthys 01c9891757 Fix some more memory leaks (all config related, and a debug one)
[skip ci]
2021-11-06 12:55:45 +01:00
Bram Matthys ff967957f4 Fix two small memory leaks in extjwt (sfilename, b64sig) and change another
one (extjwt_hash_val) to just a simply safe_free() as well which is less
error prone (just needs the value to be initialized to NULL at the beginning
but that is already done).
2021-11-06 12:45:07 +01:00
Bram Matthys 10d2701bfe fclose() before return in geoip_csv.c 2021-11-06 12:39:18 +01:00
Bram Matthys 5ae33809de Fix read-after-free in SVSNICK and remote NICK if there is any module
checking 'mtags' in HOOKTYPE_POST_LOCAL_NICKCHANGE.
[skip ci]
2021-11-06 11:31:40 +01:00
Bram Matthys dccab58090 Code cleanup: this just looks too weird otherwise.
[skip ci]
2021-11-06 11:19:51 +01:00
Bram Matthys 509b96b5f7 Clean up: some unimportant control flow issues, eg using 'continue'
instead of 'break' in a while(0) loop.
2021-11-06 11:10:17 +01:00
Bram Matthys abb575bdb6 S2S traffic: Fix using wrong variable in a loop, causing an OOB read. 2021-11-06 10:16:37 +01:00
Bram Matthys e0b9118efe Don't show empty 'via' for link.LINK_DENIED_DUPLICATE_SID_LINKED.
Reported by fo in https://bugs.unrealircd.org/view.php?id=5989
2021-11-05 14:54:10 +01:00
Bram Matthys a52a7304a2 Check for SID collision in SID command as well. We already checked in
PROTOCTL SERVERS=xxx which all servers send, so if these are all
UnrealIRCd servers then we should not reach this, BUT.. you never know
and non-unreal servers don't send this, so it matters for eg services.
2021-11-05 14:47:02 +01:00
simplexish 2e30b40d9c Fix incorrect SAPART server notice / log message (#177) 2021-11-03 08:52:23 +01:00
Bram Matthys 01815adfba Fix about 8 log messages that were incomplete (due to invalid var expansion) 2021-11-01 10:11:46 +01:00
Bram Matthys 99436ee83c Fix memory leak in /WHOIS 2021-11-01 09:23:45 +01:00
Bram Matthys 9b842140fc Fix missing comma 2021-11-01 07:31:05 +01:00
Bram Matthys d128510ee4 More fixes for $client.detail -> $client.details 2021-11-01 07:11:56 +01:00
Valerie Pond f3db0d5971 Correct chgcmd snotice behaviour (#173)
Fix CHG commands snomask messages ($target.detail -> $target.details)
2021-11-01 07:09:49 +01:00
Bram Matthys 7dd40614dd Fix showing wrong oper login name and operclass in WHOIS (to opers). 2021-10-31 17:34:10 +01:00
Bram Matthys c196e31c60 Fix using wrong numeric for certfp in /WHOIS 2021-10-31 07:35:02 +01:00
Bram Matthys ca36a5256c Some text updates UnrealIRCd 5 -> UnrealIRCd 6 2021-10-31 07:20:57 +01:00
Bram Matthys 9fcb4ddbe9 Fix some log messages, reported by delta. 2021-10-30 18:41:09 +02:00
Bram Matthys 57cb9ebc20 Consistently use $existing_client instead of $other_client.
Fixes some expansion issues (too), as reported by delta.
2021-10-30 17:41:15 +02:00
Bram Matthys e3b7ad8fc4 Fix crash in SENDSNO 2021-10-30 17:25:58 +02:00
Bram Matthys 041b169fa6 Use -rpath for geoip modules as well, when needed.
And yeah, should probably not use @VAR@ here directly but pass
it all the way up from other makefiles. Lazy.
2021-10-30 10:11:31 +02:00
Bram Matthys ed9f7cfb57 Add /GEOIP command so it's a bit easier to debug these things.
Load geoip_classic with correct settings (for now) in modules.optional.conf.
2021-10-30 09:57:27 +02:00
Bram Matthys 2adbb42ec7 Fix missing symbols in GeoIP modules, move -lXYZ to the end. 2021-10-30 08:51:15 +02:00
Bram Matthys 32aa4dc625 Metadata can stay a 3rd party module for now. 2021-10-10 09:39:55 +02:00
Bram Matthys 3b4ed32d71 Use more enums instead of defines 2021-10-08 08:40:16 +02:00
Bram Matthys 520804edc2 Add set::whois-detail which allows you to configure which items
to expose to which users and in what detail.

The default configuration is as follows:

set {
	whois-details {
		basic		{ everyone full; }
		modes		{ everyone none;	self full;	oper full; }
		realhost	{ everyone none;	self full;	oper full; }
		registered-nick	{ everyone full; }
		channels	{ everyone limited;	self full;	oper full; }
		server		{ everyone full; }
		away		{ everyone full; }
		oper		{ everyone limited;	self full;	oper full; }
		secure		{ everyone limited;	self full;	oper full; }
		bot		{ everyone full; }
		services	{ everyone full; }
		reputation	{ everyone none;	self none;	oper full; }
		geo		{ everyone none;	self none;	oper full; }
		certfp		{ everyone full; }
		shunned		{ everyone none;	self none;	oper full; }
		account		{ everyone full; }
		swhois		{ everyone full; }
		idle		{ everyone limited;	self full;	oper full; }
	}
}

Oh, yeah, and for "secure" this also adds displaying of the TLS cipher
in /WHOIS for ircops and self by default. For all others it is limited
to just "is using a Secure Connection".

This also removes the newly added set::geoip::whois-for-anyone since
it is now configured via set::whois-details::geo.

Module coders: HOOKTYPE_WHOIS changed and you may no longer send
directly to the client from this hook. Instead, you should use
add to the NameValuePrioList, usually via the functions
add_nvplist_numeric() and add_nvplist_numeric_fmt().
For inspiration see bot_whois in src/modules/usermodes/bot.c
and reputation_whois in src/modules/reputation.c
2021-09-27 17:27:26 +02:00
Bram Matthys ee8cc0e8e2 Get rid of Usermode_Table[] and use a linked list called usermodes.
Just like already done for Channelmode_Table[] -> channelmodes.
2021-09-26 12:46:34 +02:00
Bram Matthys 05f2694685 Add cloak_none module. Also improve warning when loading multiple cloak
modules a bit.
2021-09-26 08:57:40 +02:00
Bram Matthys fae7c0fef7 cloak_sha256: require cloaking key to be at least 80 characters.
This may also help with people accidentally loading cloak_sha256
when they previously had cloak keys for cloak_md5.

[skip ci]
2021-09-26 08:32:27 +02:00