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

- Added oper CIDR

This commit is contained in:
stskeeps
2007-06-14 18:23:38 +00:00
parent 0748ba0aa5
commit 451a05d951
5 changed files with 20 additions and 6 deletions
+1
View File
@@ -1495,3 +1495,4 @@
- #0002420 reported by KnuX fixed by WolfSage
- #0003147 reported by vonitsanet, fixed by djGrrr regarding making
spamfilters work in case of /setname
- Added oper CIDR
+5 -5
View File
@@ -568,11 +568,11 @@ into spaces at runtime. And double underscore ('__') gets an underscore ('_'). A
<p>UnrealIRCd now has support for CIDR (Classless Interdomain Routing). CIDR allows you to ban
IP ranges. IPs are allocated to ISPs using CIDR, therefore, being able to set a CIDR based ban
allows you to easily ban an ISP. Unreal supports CIDR for both IPv4 and IPv6. CIDR masks may be
used in the allow::ip, ban user::mask, ban ip::mask, except ban::mask, except throttle::mask,
and except tkl::mask (for gzline, gline, and shun). Additionally, CIDR can be used in /kline,
/gline, /zline, /gzline, and /shun. Unreal uses the standard syntax of IP/bits, e.g.,
127.0.0.0/8 (matches 127.0.0.0 - 127.255.255.255), and fe80:0:0:123::/64 (matches
fe80:0:0:123:0:0:0:0 - fe80:0:0:123:ffff:ffff:ffff:ffff).</p></div>
used in the allow::ip, oper::from::userhost, ban user::mask, ban ip::mask, except ban::mask,
except throttle::mask, and except tkl::mask (for gzline, gline, and shun). Additionally, CIDR
can be used in /kline, /gline, /zline, /gzline, and /shun. Unreal uses the standard syntax of
IP/bits, e.g., 127.0.0.0/8 (matches 127.0.0.0 - 127.255.255.255), and fe80:0:0:123::/64
(matches fe80:0:0:123:0:0:0:0 - fe80:0:0:123:ffff:ffff:ffff:ffff).</p></div>
<p><font size="+2"><b>3.16 - Nick Character Sets</b></font><a name="feature_nickchars"></a></p><div class="desc">
<p>UnrealIRCd now has the ability to specify which charsets/languages should be allowed
+1
View File
@@ -1159,6 +1159,7 @@ struct _configitem_oper_from {
ConfigItem *prev, *next;
ConfigFlag flag;
char *name;
struct irc_netmask *netmask;
};
struct _configitem_drpass {
+2 -1
View File
@@ -198,7 +198,8 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
strlcpy(nuhhost2, make_user_host(sptr->user->username, Inet_ia2p(&sptr->ip)), sizeof(nuhhost2));
for (oper_from = (ConfigItem_oper_from *) aconf->from;
oper_from; oper_from = (ConfigItem_oper_from *) oper_from->next)
if (!match(oper_from->name, nuhhost) || !match(oper_from->name, nuhhost2))
/* if (!match(oper_from->name, nuhhost) || !match(oper_from->name, nuhhost2)) */
if (match_ip(sptr->ip, nuhhost, oper_from->name, oper_from->netmask))
break;
if (!oper_from) {
sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]);
+11
View File
@@ -1845,6 +1845,10 @@ void config_rehash()
{
next2 = (ListStruct *)oper_from->next;
ircfree(oper_from->name);
if (oper_from->netmask)
{
MyFree(oper_from->netmask);
}
DelListItem(oper_from, oper_ptr->from);
MyFree(oper_from);
}
@@ -3167,6 +3171,7 @@ int _conf_oper(ConfigFile *conf, ConfigEntry *ce)
ConfigItem_oper *oper = NULL;
ConfigItem_oper_from *from;
OperFlag *ofp = NULL;
struct irc_netmask tmp;
oper = MyMallocEx(sizeof(ConfigItem_oper));
oper->name = strdup(ce->ce_vardata);
@@ -3236,6 +3241,12 @@ int _conf_oper(ConfigFile *conf, ConfigEntry *ce)
{
from = MyMallocEx(sizeof(ConfigItem_oper_from));
ircstrdup(from->name, cepp->ce_vardata);
tmp.type = parse_netmask(from->name, &tmp);
if (tmp.type != HM_HOST)
{
from->netmask = MyMallocEx(sizeof(struct irc_netmask));
bcopy(&tmp, from->netmask, sizeof(struct irc_netmask));
}
AddListItem(from, oper->from);
}
}