mirror of
https://github.com/anope/anope.git
synced 2026-06-12 19:14:47 +02:00
Do not allow invalid nicknames to be forbidden in ns_forbid
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Anope Version 1.8 - GIT
|
||||
-----------------------
|
||||
01/29 F Fixed user modes on BotServ bots on Unreal3.2.10 [#1474]
|
||||
02/13 F Do not allow invalid nicknames to be forbidden in ns_forbid [ #00]
|
||||
|
||||
Provided by Anope Dev. <team@anope.org> - 2012
|
||||
02/22 F Fixed several grammar errors in docs/ (patch provided by Simba) [ #00]
|
||||
|
||||
@@ -73,6 +73,7 @@ static int do_forbid(User * u)
|
||||
NickAlias *na;
|
||||
char *nick = strtok(NULL, " ");
|
||||
char *reason = strtok(NULL, "");
|
||||
char *ch;
|
||||
|
||||
/* Assumes that permission checking has already been done. */
|
||||
if (!nick || (ForceForbidReason && !reason)) {
|
||||
@@ -88,6 +89,21 @@ static int do_forbid(User * u)
|
||||
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (isdigit(nick[0]) || nick[0] == '-' || strlen(nick) > NICKMAX - 1)
|
||||
{
|
||||
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
for (ch = nick; *ch; ch++)
|
||||
{
|
||||
if (!isvalidnick(*ch))
|
||||
{
|
||||
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((na = findnick(nick)) != NULL) {
|
||||
if (NSSecureAdmins && nick_is_services_admin(na->nc)
|
||||
&& !is_services_root(u)) {
|
||||
|
||||
+2
-1
@@ -8,9 +8,10 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="8"
|
||||
VERSION_PATCH="8"
|
||||
VERSION_EXTRA="-git"
|
||||
VERSION_BUILD="3108"
|
||||
VERSION_BUILD="3109"
|
||||
|
||||
# Changes since 1.8.7 Release
|
||||
#Revision 3109 - Do not allow invalid nicknames to be forbidden in ns_forbid
|
||||
#Revision 3108 - Bug #1474 - Fixed setting umodes on BotServ bots on Unreal3.2.10
|
||||
#Revision 3106 - Replaced experimental Hybrid 7.0 support by Hybrid 8.0 support. (Patch provided by Hybrid Development Team)
|
||||
#Revision 3105 - Added french language support to some modules (patch provided by Coolsmile)
|
||||
|
||||
Reference in New Issue
Block a user