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

2596 Commits

Author SHA1 Message Date
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
Bram Matthys 72fd878664 Add "cloak_sha256" module.
This is based on the old MD5 module, it uses SHA256 instead.
Some re-indenting, replacing hardcoded values with a define,
and some other small changes due to the different hash size.
2021-09-25 20:13:57 +02:00
Bram Matthys e4b449adf8 Add set_channel_mode() which can be used to issue a server mode.
It's usage would be rare, but this is f.e. used from channeldb.
Other uses may be in some 3rd party module.
Example: set_channel_mode(channel, "+k", "key")
2021-09-25 17:42:21 +02:00
Bram Matthys 892a639272 Get rid of big chunk in postconf_defaults() that is unneeded / much
easier now, now that we process the set { } block before all other
blocks (since a few years already).
2021-09-25 17:27:53 +02:00
Bram Matthys c6ef13b258 Remove HOOKTYPE_REQUIRE_SASL which was never called.
Apparently the other hooks were sufficient after all for authprompt ;D
2021-09-25 17:15:49 +02:00
Bram Matthys 834d38e904 Update HOOKTYPE_PRE_KNOCK to include reason (not used, though) 2021-09-25 17:08:53 +02:00
Bram Matthys 707575bc32 Resolve a number of todo items, most by simply removing them :D 2021-09-25 16:54:29 +02:00
Bram Matthys 38e47b9b62 Rename find_person() to find_user() to be consistent in the naming that
we use since UnrealIRCd 5: we have users (IsUser) and servers (IsServer).
2021-09-25 16:44:11 +02:00
Bram Matthys 73b908e413 Changes to BanContext struct (extended ban API):
* Now ban_check_types (previously checktype):
  this is one or more of BANCHK_* OR'd together, eg BANCHK_JOIN, BANCHK_MSG..
* Now ban_type (previously what2):
  this is the type of the ban, eg EXBTYPE_BAN, EXBTYPE_EXCEPT, etc.
* Now is_ok_check (previously is_ok_checktype)
  this is one of EXBCHK_* for is_ok, eg EXBCHK_PARAM to check parameter.
2021-09-25 16:28:10 +02:00
k4be 11fb778e9d Move METADATA isupport to a correct place 2021-09-25 16:01:27 +02:00
Bram Matthys 49e1a8a565 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-09-25 15:25:00 +02:00
k4be a07f7f2567 extjwt cmodes: generate array of mode characters 2021-09-25 15:23:04 +02:00
Bram Matthys 174459587c Fix crash on CAP-capable TLS client connect.
Crash was introduced couple of weeks ago by proxy stuff.
2021-09-25 15:22:17 +02:00
Bram Matthys 8603c2eb71 Update hunt_server() so command is really the command (eg "LUSERS") and
not a format string (eg ":%s LUSERS %s"). It now simply concats all parv[]'s.
That is, up to parc count. And it automatically does the :stuff for the
last parameter if it contains spaces or starts with a : etc.

This gets rid of a bit sketchy code with an arbitrary maximum etc.

Now it's just:
if (hunt_server(client, NULL, "REHASH", 1, parc, parv) != HUNTED_ISME)
	return;

This has one side effect, though:
Previously we used the format string, so it may be possible for S2S
traffic to now have more arguments then before here and there.
Eg:
* It could be that the caller was using a format string to
  intentionally cut off an extra parameter at the end.
  You can still do that if you call with eg parc-1 instead of parc.
  I don't think there were any such cases though, but hard to rule out.
* Extranous parameters may show up in S2S traffic where it was
  previously unexpected.
2021-09-25 14:49:19 +02:00
Bram Matthys b5375de52d Move some reputation log msgs to ULOG_DEBUG (they already required DEBUGMODE) 2021-09-25 14:24:15 +02:00
Bram Matthys 10ec3c164a Rename the old cloaking module to "cloak_md5" (UnrealIRCd 3.2.1 - 5.2.X)
It was used from July 2004 and served us well it seems.
2021-09-25 11:23:14 +02:00
Bram Matthys ec8f54ec26 Update cloaking key mismatch error and rename some stuff. 2021-09-25 11:19:15 +02:00
Bram Matthys 47279108e4 Use get_operclass() in extbans/operclass as well. 2021-09-25 11:02:39 +02:00
Bram Matthys cac8c34bcc JSON logging: expand operlogin and operclass for users who are ircop.
This uses the new get_operlogin() / get_operclass() functions.
Also updated whois code to use them too.
2021-09-25 10:58:39 +02:00
Bram Matthys c1378abc32 Initialize variables to NULL (duh) 2021-09-25 10:33:47 +02:00
Bram Matthys 677fcf6b71 Move the HOOKTYPE_LOCAL_OPER back out of remove_oper_privileges().
Can't have it in that function as it may be called even when the
user was not oper before (as a safety precaution). Pitty.
2021-09-25 10:32:25 +02:00
Bram Matthys ce5917e0d9 Expose operlogin and operclass via moddata so they can be seen in WHOIS
and used for auditting purposes across servers (assuming the servers
itself can be trusted).
This is done via the 'operlogin' module which is loaded by default.
Obviously for opers of U5 and below this information is not available.

This also changes the HOOKTYPE_LOCAL_OPER hook to include oper block info:
-int hooktype_local_oper(Client *client, int add);
+int hooktype_local_oper(Client *client, int add, ConfigItem_oper *oper_block);
2021-09-25 10:28:36 +02:00
Bram Matthys bf7a72a850 Usermode_Table[].flag -> Usermode_Table[].letter
just like how it is now in U6 in channel modes and extended bans
2021-09-25 09:13:34 +02:00
Bram Matthys fbf3a51517 Add HOOKTYPE_CAN_SET_TOPIC, which works similar to HOOKTYPE_CAN_KICK.
Move checking of +t restrictions to chanmodes/topiclimit.
Move checking for +m restrictions to chanmodes/moderated.
Now the only check remaining in topic is for +b (banned users)
which is fine I think.
2021-09-25 09:04:19 +02:00
Bram Matthys 847f2fc384 Remove is_ip_valid() as we already have is_valid_ip(), and update
the doxygen docs a bit for that function.
2021-09-25 08:17:47 +02:00
Bram Matthys fabe16a95c Get rid of has_voice(), is_half_op(), is_skochanop(), is_chan_op(), is_chanadmin(),
is_chanowner(). Using check_channel_access() instead now.
2021-09-25 08:00:57 +02:00
Bram Matthys baa07b179f Get rid of some other old upgrade conf stuff as well. Remove some,
but keep some other errors, since they may still be helpful,
or at least for now.
2021-09-24 16:47:23 +02:00
Bram Matthys 4b079dbd1b Add JOIN/PART/KICK logging (snomask 'j').
This also changes the remove_user_from_channel() function to have an
extra parameter to hide it from logs. This is used for KICK (already
logged) and QUIT (which would be stupid to generate 10 part log lines for).
2021-09-24 16:08:41 +02:00
Bram Matthys 1d73db560c Get rid of modules/snomasks directory, since the snomask module API is gone.
(IRCOps can set any snomask dynamically now)
2021-09-24 10:10:27 +02:00
Bram Matthys b41311ddaf Update default snomask to +bBcdfkqsSoO 2021-09-24 10:03:18 +02:00
Bram Matthys bcfe43788d Some unimportant unreal_log() updates.
[skip ci]
2021-09-24 09:41:21 +02:00
Bram Matthys be6bbbcc6b Convert all remaining sendto_umode()/sendto_umode_global() to unreal_log().
Except, of course, the ones that actually need to send to a user mode,
which is only LOCOPS and GLOBOPS.
2021-09-24 08:28:37 +02:00
Bram Matthys 43e4c5444f We already got rid of sendto_ops(), now get rid of sendto_realops().
Use the new logging instead.
2021-09-23 19:57:05 +02:00
Bram Matthys 2a7da65574 Fix header: wallops -> usermodes/wallops 2021-09-23 19:31:28 +02:00
Bram Matthys 0439e4f89d Move wallops module from "wallops" to "usermodes/wallops"
(which includes the command)
2021-09-23 19:25:38 +02:00
Bram Matthys 20c4ac2cd1 Move all wallops code out of the core. 2021-09-23 19:21:19 +02:00
Bram Matthys b94707a51b Change (or delete) old sendto_ops() calls. Function is now gone. 2021-09-23 19:14:10 +02:00
Bram Matthys e36c85e4ce I don't understand much from this old code, but.. whatever. 2021-09-23 19:13:55 +02:00
Bram Matthys 6abd74b121 Get rid of REHASH flag handling for staff, just rehash ffs...
And this module is not perm so we can ditch all this code.
2021-09-23 18:55:17 +02:00
Bram Matthys 720f597ad6 Get rid of current snomask system and allow ircops to set any snomask
(that is: a-z A-Z) so to use the dynamic system with the new logging.
Largely untested.
2021-09-22 15:49:20 +02:00