From d41d26a16300cb0efa8237fe1646cefbbff491d9 Mon Sep 17 00:00:00 2001 From: codemastr Date: Thu, 10 Apr 2003 21:13:36 +0000 Subject: [PATCH] SQLINE/UNSQLINE and SVSNLINE fixes --- Changes | 3 +++ src/modules/m_sqline.c | 17 ++++++++++++----- src/modules/m_svsnline.c | 11 ++++++++++- src/modules/m_unsqline.c | 11 ++++++++++- src/s_serv.c | 1 - 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Changes b/Changes index bcd6db168..c332e24ef 100644 --- a/Changes +++ b/Changes @@ -2020,3 +2020,6 @@ seen. gmtime warning still there - Fixed opermode bug which could cause the ircd to crash a while later (#0000823). - Changed throttling errormsg so mIRC recognizes it and waits a while. - Added SSL quit error messages +- Fixed an SQLINE bug with sqlines without a reason +- Fixed a bug effecting additions/deletions of SQLINES and deletions of SVSNLINES (may be + the cause of #0000866) diff --git a/src/modules/m_sqline.c b/src/modules/m_sqline.c index 3144b7688..feedcf11b 100644 --- a/src/modules/m_sqline.c +++ b/src/modules/m_sqline.c @@ -134,10 +134,17 @@ DLLFUNC int m_sqline(aClient *cptr, aClient *sptr, int parc, char *parv[]) "%s", parv[1]); /* Only replaces AKILL (global ban nick)'s */ - if ((bconf = Find_banEx(parv[1], CONF_BAN_NICK, CONF_BAN_TYPE_AKILL))) + for (bconf = conf_ban; bconf; bconf = (ConfigItem_ban *)bconf->next) + { + if (bconf->flag.type != CONF_BAN_NICK) + continue; + if (bconf->flag.type2 != CONF_BAN_TYPE_AKILL) + continue; + if (!stricmp(bconf->mask, parv[1])) + break; + } + if (bconf) { - if (bconf->mask) - MyFree(bconf->mask); if (bconf->reason) MyFree(bconf->reason); bconf->mask = NULL; @@ -147,12 +154,12 @@ DLLFUNC int m_sqline(aClient *cptr, aClient *sptr, int parc, char *parv[]) else { bconf = (ConfigItem_ban *) MyMallocEx(sizeof(ConfigItem_ban)); + if (parv[1]) + DupString(bconf->mask, parv[1]); addit = 1; } if (parv[2]) DupString(bconf->reason, parv[2]); - if (parv[1]) - DupString(bconf->mask, parv[1]); /* CONF_BAN_NICK && CONF_BAN_TYPE_AKILL == SQLINE */ bconf->flag.type = CONF_BAN_NICK; diff --git a/src/modules/m_svsnline.c b/src/modules/m_svsnline.c index afd5152a9..222eedc88 100644 --- a/src/modules/m_svsnline.c +++ b/src/modules/m_svsnline.c @@ -188,7 +188,16 @@ DLLFUNC int m_svsnline(aClient *cptr, aClient *sptr, int parc, char *parv[]) if (parc < 3) return 0; - if ((bconf = Find_banEx(parv[3], CONF_BAN_REALNAME, CONF_BAN_TYPE_AKILL))) + for (bconf = conf_ban; bconf; bconf = (ConfigItem_ban *)bconf->next) + { + if (bconf->flag.type != CONF_BAN_REALNAME) + continue; + if (bconf->flag.type2 != CONF_BAN_TYPE_AKILL) + continue; + if (!stricmp(bconf->mask, parv[3])) + break; + } + if (bconf) { DelListItem(bconf, conf_ban); diff --git a/src/modules/m_unsqline.c b/src/modules/m_unsqline.c index c7d96e648..dcb13e568 100644 --- a/src/modules/m_unsqline.c +++ b/src/modules/m_unsqline.c @@ -123,7 +123,16 @@ DLLFUNC int m_unsqline(aClient *cptr, aClient *sptr, int parc, char *parv[]) sendto_serv_butone_token(cptr, parv[0], MSG_UNSQLINE, TOK_UNSQLINE, "%s", parv[1]); - if ((bconf = Find_banEx(parv[1], CONF_BAN_NICK, CONF_BAN_TYPE_AKILL))) + for (bconf = conf_ban; bconf; bconf = (ConfigItem_ban *)bconf->next) + { + if (bconf->flag.type != CONF_BAN_NICK) + continue; + if (bconf->flag.type2 != CONF_BAN_TYPE_AKILL) + continue; + if (!stricmp(parv[1], bconf->mask)) + break; + } + if (bconf) { DelListItem(bconf, conf_ban); if (bconf->mask) diff --git a/src/s_serv.c b/src/s_serv.c index 87d210a57..5f67089bd 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -1381,7 +1381,6 @@ int m_server_synch(aClient *cptr, long numeric, ConfigItem_link *aconf) sendto_one(cptr, "%s%s %s %s", ns ? "@" : ":", ns ? ns : me.name, - me.name, (IsToken(cptr) ? TOK_SQLINE : MSG_SQLINE), bconf->mask); }