mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-04 09:43:12 +02:00
For proxy::type web, automatically add proxy::mask to exceptions
for blacklist, connect-flood, handshake-data-flood (Well, unless mask::ip is used with a wildcard, due to current technical limitations, that will be resolved later)
This commit is contained in:
+22
@@ -4505,6 +4505,28 @@ int _conf_proxy(ConfigFile *conf, ConfigEntry *ce)
|
||||
|
||||
AddListItem(proxy, conf_proxy);
|
||||
|
||||
/* For proxy type web, we automatically add the host to except ban { }
|
||||
* for blacklist, connect-flood, handshake-data-flood
|
||||
*/
|
||||
if (proxy->type == PROXY_WEB)
|
||||
{
|
||||
ConfigItem_mask *m;
|
||||
NameList *n;
|
||||
for (m = proxy->mask->mask; m; m = m->next)
|
||||
{
|
||||
tkl_add_banexception(TKL_EXCEPTION, "*", m->mask, NULL, "proxy { } block",
|
||||
"-config-", 0, TStime(), 0, "bcd", TKL_FLAG_CONFIG);
|
||||
}
|
||||
for (n = proxy->mask->ip; n; n = n->next)
|
||||
{
|
||||
char ip[64];
|
||||
if (strchr(n->name, '*') || strchr(n->name, '?'))
|
||||
continue; /* we are not this advanced yet ;) */
|
||||
tkl_add_banexception(TKL_EXCEPTION, "*", n->name, NULL, "proxy { } block",
|
||||
"-config-", 0, TStime(), 0, "bcd", TKL_FLAG_CONFIG);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user