[DONE] Deny certain ban masks network-wide

Need a module converted from 3.2.x to UnrealIRCd 4? Or looking for a certain module? Ask here.

Moderators: Gottem, Supporters

Post Reply
Gottem
Posts: 171
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

[DONE] Deny certain ban masks network-wide

Post by Gottem » Sat Jan 07, 2017 6:44 pm

I saw a request by PeGaSuS in the IRC channel:
<PeGaSuS> as everyone that uses Anope services know, the ChanServ has a feature named 'peace' that disallows any op to set a ban like '*!*@*'..
<PeGaSuS> but, if for some reason we don't have the services running, and if the one 'non-op' user obtains op after a crash, *net *split or whatever, they can set that ban and no one will be able to join the channel (except IRCops, ofc) and that's bad. in my humble opinion, UnrealIRCd could have an option like 'deny ban { mask *@*; };' to avoid such situation
So I went ahead and wrote a module that does exactly that. =] I even went a bit further and also applied these restrictions to SAMODE. ;]

Simply load the module and fire up an editor to change unrealircd.conf. The config block looks like this:

Code: Select all

denyban {
	allowopers 0;
	denynotice 1;
	//reason "$num of your ban masks were disallowed by the network operators";
	mask BAN_ALL;
	mask *!*@*myirc.net;
};
The mask *!*@* is kinda special, so you'll have to specify BAN_ALL to prevent people from doing /mode #chan +b *!*@* etc. For anything else it will do a wildcard match, as is usual.

The directives allowopers and denynotice should be pretty clear. They default to 1 and 0, respectively.

For the reason directive you can use $num, which will be replaced with the actual amount of stripped masks. ;] No masks means they'll see the default message.

I went with denyban over deny ban (notice the space) as I'm not sure if the latter will conflict with any of Unreal's internals (like "deny dcc" etc).

Get it from here.
If you like my modules, pls consider donating (through PayPal) or becoming a monthly Patron ;];]

Post Reply