1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 06:03:13 +02:00

Rip out CONF_BAN_NICK, CONF_BAN_IP, CONF_BAN_USER, now that they are moved

to the TKL layer.
This commit is contained in:
Bram Matthys
2019-06-15 18:18:19 +02:00
parent 97fc19591c
commit 8e6302d003
7 changed files with 13 additions and 58 deletions
-3
View File
@@ -995,10 +995,7 @@ struct _configflag_tld
unsigned rulesptr : 1;
};
#define CONF_BAN_NICK 1
#define CONF_BAN_IP 2
#define CONF_BAN_SERVER 3
#define CONF_BAN_USER 4
#define CONF_BAN_REALNAME 5
#define CONF_BAN_VERSION 6
#define CONF_BAN_UNAUTHENTICATED 7
+2 -10
View File
@@ -465,19 +465,11 @@ int check_tkls(aClient *cptr)
if (IsPerson(cptr))
{
/* Check ban user { } and ban realname { } */
bconf = Find_ban(cptr, NULL, CONF_BAN_USER);
if (bconf)
killflag++;
else if (!ValidatePermissionsForPath("immune",cptr,NULL,NULL,NULL) && (bconf = Find_ban(NULL, cptr->info, CONF_BAN_REALNAME)))
/* Check ban realname { } */
if (!ValidatePermissionsForPath("immune",cptr,NULL,NULL,NULL) && (bconf = Find_ban(NULL, cptr->info, CONF_BAN_REALNAME)))
killflag++;
}
/* If still no match, check ban ip { } */
if (!killflag && (bconf = Find_ban(cptr, NULL, CONF_BAN_IP)))
killflag++;
/* If user is meant to be killed, take action: */
if (killflag)
{
-6
View File
@@ -1333,12 +1333,6 @@ int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, cha
else
u1 = NULL;
/* Check ban user { } blocks (K-lines in conf) */
if ((bconf = Find_ban(sptr, NULL, CONF_BAN_USER)))
{
ircstp->is_ref++;
return banned_client(sptr, "K-Lined", bconf->reason?bconf->reason:"", 0, 0);
}
/* Check ban realname { } blocks */
if ((bconf = Find_ban(NULL, sptr->info, CONF_BAN_REALNAME)))
{
+1 -5
View File
@@ -73,11 +73,7 @@ int _check_banned(aClient *cptr)
aClient *acptr;
ConfigItem_ban *bconf;
if ((bconf = Find_ban(cptr, NULL, CONF_BAN_IP)))
{
return banned_client(cptr, "K-Lined", bconf->reason ? bconf->reason : "", 0, 0);
}
else if ((tk = find_tkline_match_zap(cptr)))
if ((tk = find_tkline_match_zap(cptr)))
{
return banned_client(cptr, "Z-Lined", tk->reason, (tk->type & TKL_GLOBAL)?1:0, 0);
}
+2 -23
View File
@@ -970,32 +970,11 @@ int stats_denydcc(aClient *sptr, char *para)
int stats_kline(aClient *sptr, char *para)
{
ConfigItem_ban *bans;
ConfigItem_except *excepts;
char type[2];
for (bans = conf_ban; bans; bans = bans->next)
{
if (bans->flag.type == CONF_BAN_USER)
{
if (bans->flag.type2 == CONF_BAN_TYPE_CONF)
type[0] = 'K';
type[1] = '\0';
sendnumeric(sptr, RPL_STATSKLINE, type, bans->mask, bans->reason
? bans->reason : "<no reason>");
}
else if (bans->flag.type == CONF_BAN_IP)
{
if (bans->flag.type2 == CONF_BAN_TYPE_CONF)
type[0] = 'Z';
else if (bans->flag.type2 == CONF_BAN_TYPE_TEMPORARY)
type[0] = 'z';
type[1] = '\0';
sendnumeric(sptr, RPL_STATSKLINE, type, bans->mask, bans->reason
? bans->reason : "<no reason>");
}
}
tkl_stats(sptr, TKL_KILL, NULL);
tkl_stats(sptr, TKL_ZAP, NULL);
for (excepts = conf_except; excepts; excepts = excepts->next)
{
if (excepts->flag.type == CONF_EXCEPT_BAN)
+2 -9
View File
@@ -1061,15 +1061,8 @@ add_con_refuse:
}
}
if ((bconf = Find_ban(acptr, acptr->ip, CONF_BAN_IP)))
{
if (bconf)
{
banned_client(acptr, "K-Lined", bconf->reason ? bconf->reason : "no reason", 0, NO_EXIT_CLIENT);
goto add_con_refuse;
}
}
else if ((tk = find_tkline_match_zap(acptr)))
// FIXME: can't we use check_banned() and then pass the NO_EXIT_CLIENT flag? compare!!
if ((tk = find_tkline_match_zap(acptr)))
{
ircstp->is_ref++;
banned_client(acptr, "Z-Lined", tk->reason, (tk->type & TKL_GLOBAL)?1:0, NO_EXIT_CLIENT);
+6 -2
View File
@@ -2949,8 +2949,12 @@ ConfigItem_ban *Find_ban(aClient *sptr, char *host, short type)
if (match_user(ban->mask, sptr, MATCH_CHECK_REAL))
{
/* Person got a exception */
if ((type == CONF_BAN_USER || type == CONF_BAN_IP)
&& Find_except(sptr, CONF_EXCEPT_BAN))
// FIXME: this code is for the transition
// it should not be called blindly like
// we do now, since it would allow bypassing
// of even qlines and such..
// contact Syzop when in doubt :D
if (Find_except(sptr, CONF_EXCEPT_BAN))
return NULL;
return ban;
}