From 670c9ee653ffc07faabe62c4f00553f79f430271 Mon Sep 17 00:00:00 2001 From: codemastr Date: Fri, 9 Nov 2001 22:17:24 +0000 Subject: [PATCH] Made the /kline hostmask checker work like the G:line checker, (it was too easy to K:line *@*) --- Changes | 1 + src/modules/m_kline.c | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index 5a84461c0..88454ae1f 100644 --- a/Changes +++ b/Changes @@ -912,3 +912,4 @@ seen. gmtime warning still there coding) - Webserver caching fix - A little bug fix that prevented the G:line hostmask checker from checking ? +- Made the /kline hostmask checker work like the G:line checker, (it was too easy to K:line *@*) diff --git a/src/modules/m_kline.c b/src/modules/m_kline.c index 20f8a4f6d..05eb427ef 100644 --- a/src/modules/m_kline.c +++ b/src/modules/m_kline.c @@ -117,7 +117,7 @@ DLLFUNC int m_kline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { char *host, *tmp, *hosttemp; char uhost[80], name[80]; - int ip1, ip2, ip3, temp; + int ip1, ip2, ip3, temp, i; aClient *acptr; ConfigItem_ban *bconf; @@ -157,13 +157,23 @@ DLLFUNC int m_kline(aClient *cptr, aClient *sptr, int parc, char *parv[]) parv[0]); return 0; } - if (!strcmp(uhost, "*") || !strchr(uhost, '.')) + if (hosttemp) { - sendto_one(sptr, - "NOTICE %s :*** What a sweeping K:Line. If only your admin knew you tried that..", - parv[0]); - sendto_realops("%s attempted to /kline *@*", parv[0]); - return 0; + hosttemp++; + i = 0; + while (*hosttemp) + { + if (*hosttemp != '*' && *hosttemp != '.' && *hosttemp != '?') + i++; + hosttemp++; + } + if (i < 4) + { + sendto_one(sptr, + ":%s NOTICE %s :*** [K:Line error] Too broad mask", + me.name, sptr->name); + return 0; + } } }