Commit Graph

182 Commits

Author SHA1 Message Date
Alexey Sokolov
4b12c0dc3c Fix nullptr dereference
If client sends TAGMSG while server is not connected
2025-06-23 22:52:34 +01:00
Alexey Sokolov
3d1551b7f2 Don't forward client JOINs during registration
ZNC remembers that it should join these channels, and will join them after registration. But if client automatically joins some channels, we don't want it to be added to send queue before parts of registration itself (CAP, AUTHENTICATE), because server will just disconnect with "Registration timeout". After registration is complete, using /join still joins the channel immediately.

Only limiting this to joins, because server may request some input from user to finish registration, and joins are the ones which are prone to be sent automatically by client to cause issues.

Fix #1949
2025-05-10 20:09:25 +01:00
Alexey Sokolov
c2f299abdf Filter out server-dependent caps in CAP NEW using blacklist too 2025-05-08 23:25:58 +01:00
Alexey Sokolov
1c197a5508 Add a way to disable certain capabilities
This is a way for admins to mitigate some issues caused by caps if such issues ever arise.

E.g. add this to global level in znc.conf:

DisableClientCap = sasl
DisableServerCap = chghost
DisableServerCap = message-tags

Then these caps will be NAKed to client / not requested from server.

Note that this mechanism doesn't fully prevent a cap from being activated, e.g. one could use *send_raw module to request it from server even when disabled.
2025-05-08 21:55:40 +01:00
Alexey Sokolov
2f02a9ea00 Merge branch 'master' into unix 2025-05-01 22:41:27 +01:00
Alexey Sokolov
d8234a1a71 Fix the IP in SASL
This is wrong PR for that, but I noticed the issue while debugging failed tests here
2025-04-22 00:10:21 +01:00
Alexey Sokolov
5befe2f7f8 Implement invite-notify 2025-04-18 22:23:01 +01:00
Alexey Sokolov
ef4b59005c CTCP sent to *status shouldn't reach server 2025-04-11 21:45:45 +01:00
Alexey Sokolov
f93829e3b3 Implement message-tags spec
Message tags were supported already, but not arbitrary tags, and not
TAGMSG
2025-04-11 21:28:10 +01:00
Alexey Sokolov
0a45c4710a SASL: Support receiving USER and NICK after CAP END 2025-03-16 09:44:10 +00:00
Alexey Sokolov
8778a2bb5d Parse network and client from authzid. Tests will be in future commit 2025-02-24 09:21:30 +00:00
Alexey Sokolov
4f07558a7d Remove a footgun by decreasing the SASL API surface for modules
Even without the bad vtable of mutex inside shared_ptr, if a module
creates a subclass of CAuthBase, but then unloads, we have the same
problem.
2025-02-23 09:25:24 +00:00
Alexey Sokolov
6e9980d67f Various SASL changes 2025-02-22 15:59:52 +00:00
Alexey Sokolov
4ef64eb4d5 rename next sasl module hook 2025-02-13 21:36:07 +00:00
Alexey Sokolov
c8266aafda Rename new callback, fix build 2025-02-13 21:22:09 +00:00
Alexey Sokolov
22f27b2e88 Fix indentation of SASL code.
This should help understanding what it's trying to do.
2025-02-13 21:03:16 +00:00
Alexey Sokolov
41a0030fdb Merge branch 'master' into sasl
Conflicts:
	include/znc/Client.h
	src/Client.cpp
	src/Modules.cpp
	test/integration/tests/modules.cpp
2025-02-13 20:37:32 +00:00
Peter
44e4b95a20 Welcome to 2025 (#1929) 2025-02-07 23:23:45 +00:00
Alexey Sokolov
d49399bbca Implement chghost capability
Interaction with extended-join doesn't yet work correctly, because ZNC
doesn't keep track of everyone's real names
2024-10-15 13:26:20 +01:00
Alexey Sokolov
ca3b76368d Suspend registration on CAP REQ
Fix #1820
2024-02-10 00:53:44 +00:00
Alexey Sokolov
6e0591ff98 Remove unused field and getter
When account-tag was introduced, these fields were used, but since cap
3.2 this is no longer useful
2024-02-10 00:18:11 +00:00
Alexey Sokolov
b1009bd809 Code cleanup
Since now there are no server-dependent caps defined in the core
2024-01-14 00:27:21 +00:00
Alexey Sokolov
f7ff0ee3f3 Modulefy core server-dependent caps 2024-01-13 23:34:03 +00:00
Alexey Sokolov
b5a6ff528b The test is now working 2024-01-07 22:55:52 +00:00
Alexey Sokolov
1d3b33354f Merge branch 'master' into cap302 2024-01-06 20:36:24 +00:00
Alexey Sokolov
66137bd89a Progress 2024-01-05 00:45:41 +00:00
Falk Rund
17a004aa0b Welcome to 2024
[skip ci]
2023-12-31 21:09:25 +01:00
Alexey Sokolov
4cbccac707 Merge branch 'master' into cap302 2023-11-19 10:53:47 +00:00
KindOne
ee9ad2ff8e Use module names as the module ident.
Some clients will reuse query windows as the client thinks its just a
nick change if you have a existing query window with a module and a different one messages you.

Fix that by using the modules name as the ident.

Update tests to match new modules ident.
2023-09-08 07:21:31 -04:00
delthas
1dd995ef77 Reabse and address PR comments 2023-08-31 14:35:49 +02:00
MrLenin
d27e2cce5c SASL Authentication for Clients 2023-08-30 17:25:32 +02:00
Alexey Sokolov
50a3226b4f Don't duplicate the map of cap handlers per client
The idea here was that modules would dynamically add handlers to the
map, then it needs to be per client; but a simpler way to achieve this
will be in next commit
2023-03-04 10:01:56 +00:00
Alexey Sokolov
9eebb1ff04 Move CClient constructor body to .cpp 2023-03-04 09:32:57 +00:00
Alexey Sokolov
c15fc63c55 Implement cap negotiation 3.2 on server side
Used for "server-dependent" caps which already rely on sending NEW and
DEL to client. This functionality is not yet available for caps added by
modules.
2023-01-09 01:08:04 +00:00
Alexey Sokolov
d49168b93f Make it possible for modules to send values in CAP LS 2023-01-08 15:46:21 +00:00
Alexey Sokolov
b57d794aaf Send multiline CAP LS response for IRCv3.2 clients 2023-01-08 15:32:27 +00:00
Falk Rund
f9fd05c307 Welcome to 2023 2023-01-01 06:49:00 +01:00
Falk Rund
6402d241ac Welcome to 2022
The same procedure as last year, Miss Sophie?
Same procedure as every year, James.
2022-01-01 14:05:32 +01:00
MAGIC
99687b0f24 Welcome to 2021 2021-01-01 19:37:07 +01:00
NuclearW
f5c3ea403d Cleanup capabilities from m_ssAcceptedCaps in CClient::ClearServerDependentCaps after CAP DEL 2020-08-03 13:43:36 -04:00
Alexey Sokolov
6cce5fe08d Check for m_pNetwork being not null in several more places
I don't know whether these are crasheable, but now they will definitely
be not.
2020-05-31 11:46:05 +01:00
Alexey Sokolov
2390ad111b Fix null pointer dereference in echo-message
The bug was introduced while fixing #1705. If a client did not enable
echo-message, and doesn't have a network, it crashes.

Thanks to LunarBNC for reporting this
2020-05-31 11:45:40 +01:00
Alexey Sokolov
d229761821 Fix echo-message for *status
Close #1705
2020-03-29 08:45:10 +01:00
MAGIC
9081aa971d Welcome to 2020 2020-01-02 00:36:05 +01:00
Aspen (linudaemon)
95369455fc Rework MODE/RPL_CHANMODEIS handling for trailing args (#1661)
Some servers may send a colon even if the last parameter doesn't need it, currently this leads to issues with permission/mode tracking, as the core doesn't handle the colon properly.

This fix replaces reconstructing the parameter string with just passing a vector of the relevant parameters to CChan::SetModes() and adds overrides for CChan::SetModes() and CChan::ModeChange() that accept the vector instead.

Clean up uses of old CModeMessage::GetModes()
2019-08-08 21:54:49 +01:00
Alexey Sokolov
0ab205ccfa Merge pull request #1628 from dgw/welcome-to-2019
Welcome to 2019
2019-01-08 22:50:58 +00:00
dgw
8d5427cf9b Welcome to 2019
What are we going to do today, Brain?

The same thing we do every year, Pinky: Update all the copyright
headers!

[Skip CI]
2019-01-01 17:05:05 -06:00
Pierre Gordon
6af027c5dd Normalize methods with 'UserName' to 'Username' 2019-01-01 16:19:27 -05:00
Alexey Sokolov
d22fef8620 Better cleanup lines coming from network.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
2018-07-14 07:08:50 +01:00
Alexey Sokolov
6d1e77bb52 Revert "transperancy: Make the user aware that DEBUG mode is enabled."
This reverts commit ab501767a1.

Superceded by admindebug module
2018-06-18 00:41:18 +01:00