diff --git a/include/struct.h b/include/struct.h index 9e7a58b2f..71d6e3e1e 100644 --- a/include/struct.h +++ b/include/struct.h @@ -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 diff --git a/src/ircd.c b/src/ircd.c index 84a32570b..4971509f8 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -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) { diff --git a/src/modules/m_nick.c b/src/modules/m_nick.c index c39e3de11..106a05e11 100644 --- a/src/modules/m_nick.c +++ b/src/modules/m_nick.c @@ -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))) { diff --git a/src/modules/m_pass.c b/src/modules/m_pass.c index 0b6c2bb2e..576cfff99 100644 --- a/src/modules/m_pass.c +++ b/src/modules/m_pass.c @@ -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); } diff --git a/src/modules/m_stats.c b/src/modules/m_stats.c index 12fc7995b..975ec2bc0 100644 --- a/src/modules/m_stats.c +++ b/src/modules/m_stats.c @@ -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 : ""); - } - 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 : ""); - } - } + 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) diff --git a/src/s_bsd.c b/src/s_bsd.c index ca6b8ac3a..7141aefa8 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -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); diff --git a/src/s_conf.c b/src/s_conf.c index 818cd34a6..675bf1ad8 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -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; }