1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 11:23:12 +02:00

Move blacklist hits to snomask +b (new) rather than notifying all ircops.

This snomask is set by default but this can be overridden via
set::snomask-on-oper or oper::snomask. Suggested by hayek (#4566).
This commit is contained in:
Bram Matthys
2016-03-04 13:50:55 +01:00
parent 4cad9cb0c5
commit caa5eba30f
3 changed files with 16 additions and 12 deletions
+1
View File
@@ -123,6 +123,7 @@ help Snomasks {
"-";
" Below is a list of possible snomasks:";
" ==-------------------------oOo-----------------------==";
" b = View blacklist hits";
" c = View connects/disconnects on local server";
" e = View 'Eyes' server messages (OperOverride, /CHG* and /SET* usage, ..)";
" f = View flood alerts";
+1 -1
View File
@@ -322,7 +322,7 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
* -DuffJ
*/
#define SNO_DEFOPER "+kscfvGqo"
#define SNO_DEFOPER "+kscfvGqob"
#define SNO_DEFUSER "+ks"
#define SEND_UMODES (SendUmodes)
+14 -11
View File
@@ -20,6 +20,15 @@
#include "unrealircd.h"
#include "res.h"
ModuleHeader MOD_HEADER(blacklist)
= {
"blacklist",
"4.0",
"Check connecting users against DNS Blacklists",
"3.2-b8-1",
NULL
};
/* In this module and the config syntax I tried to 'abstract' things
* a little, so things could later be extended if we ever want
* to introduce another blacklist type (other than DNSBL).
@@ -70,16 +79,6 @@ struct _bluser {
int refcnt;
};
/* Module header */
ModuleHeader MOD_HEADER(blacklist)
= {
"blacklist",
"4.0",
"Check connecting users against DNS Blacklists",
"3.2-b8-1",
NULL
};
/* Global variables */
ModDataInfo *blacklist_md = NULL;
Blacklist *conf_blacklist = NULL;
@@ -101,6 +100,8 @@ void blacklist_free_bluser_if_able(BLUser *bl);
#define SetBLUser(x, y) do { moddata_client(x, blacklist_md).ptr = y; } while(0)
#define BLUSER(x) ((BLUser *)moddata_client(x, blacklist_md).ptr)
long SNO_BLACKLIST = 0L;
MOD_TEST(blacklist)
{
HookAdd(modinfo->handle, HOOKTYPE_CONFIGTEST, 0, blacklist_config_test);
@@ -132,6 +133,8 @@ MOD_INIT(blacklist)
HookAdd(modinfo->handle, HOOKTYPE_UNKUSER_QUIT, 0, blacklist_quit);
HookAdd(modinfo->handle, HOOKTYPE_REHASH, 0, blacklist_rehash);
SnomaskAdd(modinfo->handle, 'b', 1, umode_allow_opers, &SNO_BLACKLIST);
return MOD_SUCCESS;
}
@@ -635,7 +638,7 @@ void blacklist_hit(aClient *acptr, Blacklist *bl, int reply)
snprintf(buf, sizeof(buf), "[Blacklist] IP %s matches blacklist %s (%s/reply=%d)",
GetIP(acptr), bl->name, bl->backend->dns->name, reply);
sendto_realops("%s", buf);
sendto_snomask(SNO_BLACKLIST, "%s", buf);
ircd_log(LOG_KILL, "%s", buf);
name[0] = "ip";