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.
This commit is contained in:
Alexey Sokolov
2025-05-08 21:55:40 +01:00
parent 1063b7f5d6
commit 1c197a5508
5 changed files with 58 additions and 4 deletions
+4
View File
@@ -83,6 +83,8 @@ class CZNC : private CCoreTranslationMixin {
void ClearTrustedProxies();
bool AddTrustedProxy(const CString& sHost);
bool RemTrustedProxy(const CString& sHost);
const SCString& GetClientCapBlacklist() const { return m_ssClientCapBlacklist; }
const SCString& GetServerCapBlacklist() const { return m_ssServerCapBlacklist; }
void Broadcast(const CString& sMessage, bool bAdminOnly = false,
CUser* pSkipUser = nullptr, CClient* pSkipClient = nullptr);
void AddBytesRead(unsigned long long u) { m_uBytesRead += u; }
@@ -307,6 +309,8 @@ class CZNC : private CCoreTranslationMixin {
VCString m_vsBindHosts; // TODO: remove (deprecated in 1.7.0)
VCString m_vsTrustedProxies;
VCString m_vsMotd;
SCString m_ssClientCapBlacklist;
SCString m_ssServerCapBlacklist;
CFile* m_pLockFile;
unsigned int m_uiConnectDelay;
unsigned int m_uiAnonIPLimit;