summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-10-16 20:36:54 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-10-16 20:36:54 +0000
commitf3a1ab41ad410cfec7bb695880286315f1c66efd (patch)
treebec83630e13770d6d4075598ef4b3897a3ac162a
parent0700ca7742602013a1e17c57cceff453a52d67fd (diff)
BUILD : 1.7.5 (407) BUGS : 185, 190 NOTES : TTB work again, and RestrictOperNicks is no longer case sensitive
git-svn-id: svn://svn.anope.org/anope/trunk@407 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@271 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes10
-rw-r--r--src/botserv.c62
-rw-r--r--src/nickserv.c12
-rw-r--r--version.log6
4 files changed, 70 insertions, 20 deletions
diff --git a/Changes b/Changes
index 3a4671afc..bfd692aa9 100644
--- a/Changes
+++ b/Changes
@@ -31,10 +31,12 @@ Provided by Trystan <trystan@nomadirc.net> - 2004
09/07 A Ircd CHANMODE now trapped and stored. [ #00]
08/23 A New protocol independent design (aka anope-capab). [ #00]
08/28 A New IRCD document for adding new ircd support to new design. [ #00]
-10/16 F Fixed tsbuf not being sent on registration [#180]
-10/15 F Fixed OS JUPE [#147]
-10/14 F Fixed NickServ Logout [#180]
-10/14 F Fixed HelpChannel with Unreal [#180]
+10/16 F Fixed BS TTB. [#185]
+10/16 F RestrictOperNicks is no longer case sensitive. [#190]
+10/16 F Fixed tsbuf not being sent on registration. [#180]
+10/15 F Fixed OS JUPE. [#147]
+10/14 F Fixed NickServ Logout. [#180]
+10/14 F Fixed HelpChannel with Unreal. [#180]
10/09 F Bug in MySQL debug, possibly causing segfaults. [#149]
10/09 F Lots of code clean up to prevent segfaults [ #00]
10/07 F Fixed TSMODE ircds that don't stay this in their CAPAB [ #00]
diff --git a/src/botserv.c b/src/botserv.c
index 5531084e8..fdee40b6f 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -1893,12 +1893,21 @@ static int do_kickcmd(User * u)
if (ttb) {
ci->ttb[TTB_BADWORDS] =
strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ /* Only error if errno returns ERANGE or EINVAL or we are less then 0 - TSL */
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_BADWORDS] < 0) {
+ /* leaving the debug behind since we might want to know what these are */
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BADWORDS]);
+ }
+ /* reset the value back to 0 - TSL */
+ ci->ttb[TTB_BADWORDS] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
- } else
+ } else {
ci->ttb[TTB_BADWORDS] = 0;
+ }
ci->botflags |= BS_KICK_BADWORDS;
if (ci->ttb[TTB_BADWORDS])
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN,
@@ -1913,7 +1922,12 @@ static int do_kickcmd(User * u)
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_BOLDS] = strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_BOLDS] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BOLDS]);
+ }
+ ci->ttb[TTB_BOLDS] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1936,7 +1950,12 @@ static int do_kickcmd(User * u)
if (ttb) {
ci->ttb[TTB_CAPS] = strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_CAPS] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_CAPS]);
+ }
+ ci->ttb[TTB_CAPS] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1973,7 +1992,12 @@ static int do_kickcmd(User * u)
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_COLORS] = strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_COLORS] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_COLORS]);
+ }
+ ci->ttb[TTB_COLORS] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1996,7 +2020,12 @@ static int do_kickcmd(User * u)
if (ttb) {
ci->ttb[TTB_FLOOD] = strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_FLOOD] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_FLOOD]);
+ }
+ ci->ttb[TTB_FLOOD] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -2035,7 +2064,12 @@ static int do_kickcmd(User * u)
if (ttb) {
ci->ttb[TTB_REPEAT] = strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_REPEAT] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REPEAT]);
+ }
+ ci->ttb[TTB_REPEAT] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -2065,7 +2099,12 @@ static int do_kickcmd(User * u)
if (ttb) {
ci->ttb[TTB_REVERSES] =
strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_REVERSES] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REVERSES]);
+ }
+ ci->ttb[TTB_REVERSES] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -2086,7 +2125,12 @@ static int do_kickcmd(User * u)
if (ttb) {
ci->ttb[TTB_UNDERLINES] =
strtol(ttb, (char **) NULL, 10);
- if (errno) {
+ if (errno == ERANGE || errno == EINVAL
+ || ci->ttb[TTB_UNDERLINES] < 0) {
+ if (debug) {
+ alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_UNDERLINES]);
+ }
+ ci->ttb[TTB_UNDERLINES] = 0;
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
diff --git a/src/nickserv.c b/src/nickserv.c
index b6becd218..6c9a5fd45 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -2022,21 +2022,21 @@ static int do_register(User * u)
if (RestrictOperNicks) {
for (i = 0; i < RootNumber; i++) {
- if (strstr(u->nick, ServicesRoots[i]) && !is_oper(u)) {
+ if (stristr(u->nick, ServicesRoots[i]) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
}
}
for (i = 0; i < servadmins.count && (nc = servadmins.list[i]); i++) {
- if (strstr(u->nick, nc->display) && !is_oper(u)) {
+ if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
}
}
for (i = 0; i < servopers.count && (nc = servopers.list[i]); i++) {
- if (strstr(u->nick, nc->display) && !is_oper(u)) {
+ if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
@@ -2342,21 +2342,21 @@ static int do_group(User * u)
if (RestrictOperNicks) {
for (i = 0; i < RootNumber; i++) {
- if (strstr(u->nick, ServicesRoots[i]) && !is_oper(u)) {
+ if (stristr(u->nick, ServicesRoots[i]) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
}
}
for (i = 0; i < servadmins.count && (nc = servadmins.list[i]); i++) {
- if (strstr(u->nick, nc->display) && !is_oper(u)) {
+ if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
}
}
for (i = 0; i < servopers.count && (nc = servopers.list[i]); i++) {
- if (strstr(u->nick, nc->display) && !is_oper(u)) {
+ if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
diff --git a/version.log b/version.log
index 49d4c44da..8d30bac22 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="5"
-VERSION_BUILD="406"
+VERSION_BUILD="407"
# $Log$
#
+# BUILD : 1.7.5 (407)
+# BUGS : 185, 190
+# NOTES : TTB work again, and RestrictOperNicks is no longer case sensitive
+#
# BUILD : 1.7.5 (406)
# BUGS : N/A
# NOTES : Forgot the changes file