diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-09-11 18:06:27 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-09-11 18:06:27 +0000 |
commit | 78030c9c0ab2aa692b7af5aaabf763397914c23c (patch) | |
tree | ae5c190be1cf5f8f9fc5f1628364dbc2ffb81f14 | |
parent | 46c42cbee471e7fef117881c0b9d62056e8efe67 (diff) |
BUILD : 1.7.10 (881) BUGS : NOTES : Added a NickLen directive to make sure bot nicks are not longer than the nets
git-svn-id: svn://svn.anope.org/anope/trunk@881 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@628 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | Changes.conf | 8 | ||||
-rw-r--r-- | data/example.conf | 8 | ||||
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | src/config.c | 12 | ||||
-rw-r--r-- | src/core/bs_bot.c | 7 | ||||
-rw-r--r-- | version.log | 6 |
7 files changed, 33 insertions, 10 deletions
@@ -8,6 +8,7 @@ Provided by Anope Dev. <dev@anope.org> - 2005 07/01 A Events for channel access/xop updates. [ #00] 06/26 A New module pack module: hs_request. [ #00] 06/03 A Protocol files can now fill mod_current_buffer with custom code. [#389] +09/11 F Disallow botnicks longer than the net's max nick length. [ #00] 09/09 F Giving some more error output when opening a database fails. [ #00] 09/04 F Protocol module for plexus called wrong UNSGLINE function. [ #00] 08/31 F Help for /os modlist had faulty 'limited to' information. [ #00] diff --git a/Changes.conf b/Changes.conf index db8d7905b..a079bec4b 100644 --- a/Changes.conf +++ b/Changes.conf @@ -2,6 +2,14 @@ Anope Version S V N -------------------- ** ADDED CONFIGURATION DIRECTIVES ** +# NickLen [REQUIRED] +# Set this to the maximum allowed nick length on your network. Anope does +# not support values larger than 31, so setting them makes no sense. Be +# sure to set this correctly, as setting this wrong can result in services +# being disconnected from the network. + +NickLen 31 + ** MODIFIED CONFIGURATION DIRECTIVES ** # UserKey1|2|3 <value> [RECOMMENDED] # diff --git a/data/example.conf b/data/example.conf index 1163cc34c..5d004f5fd 100644 --- a/data/example.conf +++ b/data/example.conf @@ -321,6 +321,14 @@ NetworkName "LocalNet" #Numeric "3AX" #Numeric "4" +# NickLen [REQUIRED] +# Set this to the maximum allowed nick length on your network. Anope does +# not support values larger than 31, so setting them makes no sense. Be +# sure to set this correctly, as setting this wrong can result in services +# being disconnected from the network. + +NickLen 31 + ########################################################################### # # Basic functionality diff --git a/include/extern.h b/include/extern.h index 8a60a5897..acc735590 100644 --- a/include/extern.h +++ b/include/extern.h @@ -255,6 +255,7 @@ E char *ServiceHost; E char *HelpChannel; E char *LogChannel; E char *NetworkName; +E int NickLen; E char *s_NickServ; E char *s_ChanServ; diff --git a/src/config.c b/src/config.c index 3abdc46bd..5f956b229 100644 --- a/src/config.c +++ b/src/config.c @@ -44,6 +44,7 @@ static char *temp_userhost; char *HelpChannel; char *LogChannel; char *NetworkName; +int NickLen; char *s_NickServ; char *s_ChanServ; @@ -517,6 +518,7 @@ Directive directives[] = { {"NetworkName", {{PARAM_STRING, PARAM_RELOAD, &NetworkName}}}, {"NewsCount", {{PARAM_POSINT, PARAM_RELOAD, &NewsCount}}}, {"NewsDB", {{PARAM_STRING, PARAM_RELOAD, &NewsDBName}}}, + {"NickLen", {{PARAM_POSINT, 0, &NickLen}}}, {"NickservDB", {{PARAM_STRING, PARAM_RELOAD, &NickDBName}}}, {"Numeric", {{PARAM_STRING, PARAM_RELOAD, &Numeric}}}, {"PreNickServDB", {{PARAM_STRING, PARAM_RELOAD, &PreNickDBName}}}, @@ -945,12 +947,11 @@ int read_config(int reload) CHECK(RemoteServer); CHECK(ServerName); CHECK(ServerDesc); - } - if (!reload) { + CHECK(NickLen); + if (RemoteServer3) CHECK(RemoteServer2); - } - if (!reload) { + if (LocalHost && RemoteServer) { if ((!stricmp(LocalHost, RemoteServer)) && LocalPort == RemotePort) { @@ -962,6 +963,9 @@ int read_config(int reload) retval = 0; } } + + if (NickLen >= NICKMAX) + NickLen = NICKMAX - 1; } CHECK(IRCDModule); diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index af4a587d9..cd826d39d 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -84,7 +84,6 @@ int do_bot(User * u) BotInfo *bi; char *cmd = strtok(NULL, " "); char *ch = NULL; - int len; if (!cmd) syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX); @@ -100,9 +99,8 @@ int do_bot(User * u) notice_lang(s_BotServ, u, BOT_BOT_READONLY); else if (findbot(nick)) notice_lang(s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick); - else if((len=strlen(nick))>NICKMAX) { + else if (strlen(nick) > NickLen) notice_lang(s_BotServ, u, BOT_BAD_NICK); - } else { NickAlias *na; @@ -195,9 +193,8 @@ int do_bot(User * u) notice_lang(s_BotServ, u, BOT_BOT_READONLY); else if (!(bi = findbot(oldnick))) notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick); - else if((len=strlen(nick))>NICKMAX) { + else if (strlen(nick) > NickLen) notice_lang(s_BotServ, u, BOT_BAD_NICK); - } else { NickAlias *na; diff --git a/version.log b/version.log index 57666e6f6..61fb13fda 100644 --- a/version.log +++ b/version.log @@ -8,10 +8,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="10" -VERSION_BUILD="880" +VERSION_BUILD="881" # $Log$ # +# BUILD : 1.7.10 (881) +# BUGS : +# NOTES : Added a NickLen directive to make sure bot nicks are not longer than the net's allowed niclen, and thus we can't be yelled at because of that +# # BUILD : 1.7.10 (880) # BUGS : n/a # NOTES : Version 0.2 for db-merge fixing corruptions. By Certus. |