mirror of
https://github.com/znc/znc.git
synced 2026-08-05 16:33:46 +02:00
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:
+15
-1
@@ -55,11 +55,14 @@ CZNC::CZNC()
|
||||
m_vsBindHosts(),
|
||||
m_vsTrustedProxies(),
|
||||
m_vsMotd(),
|
||||
m_ssClientCapBlacklist(),
|
||||
m_ssServerCapBlacklist(),
|
||||
m_pLockFile(nullptr),
|
||||
m_uiConnectDelay(5),
|
||||
m_uiAnonIPLimit(10),
|
||||
m_uiMaxBufferSize(500),
|
||||
m_uDisabledSSLProtocols(Csock::EDP_SSL | Csock::EDP_TLSv1 | Csock::EDP_TLSv1_1),
|
||||
m_uDisabledSSLProtocols(Csock::EDP_SSL | Csock::EDP_TLSv1 |
|
||||
Csock::EDP_TLSv1_1),
|
||||
m_pModules(new CModules),
|
||||
m_uBytesRead(0),
|
||||
m_uBytesWritten(0),
|
||||
@@ -1185,6 +1188,17 @@ bool CZNC::LoadGlobal(CConfig& config, CString& sError) {
|
||||
AddTrustedProxy(sProxy);
|
||||
}
|
||||
|
||||
m_ssClientCapBlacklist.clear();
|
||||
config.FindStringVector("disableclientcap", vsList);
|
||||
for (const CString& sCap : vsList) {
|
||||
m_ssClientCapBlacklist.insert(sCap);
|
||||
}
|
||||
m_ssServerCapBlacklist.clear();
|
||||
config.FindStringVector("disableservercap", vsList);
|
||||
for (const CString& sCap : vsList) {
|
||||
m_ssServerCapBlacklist.insert(sCap);
|
||||
}
|
||||
|
||||
CString sVal;
|
||||
if (config.FindStringEntry("pidfile", sVal)) m_sPidFile = sVal;
|
||||
if (config.FindStringEntry("statusprefix", sVal)) m_sStatusPrefix = sVal;
|
||||
|
||||
Reference in New Issue
Block a user