diff options
author | certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-06-06 18:16:08 +0000 |
---|---|---|
committer | certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-06-06 18:16:08 +0000 |
commit | 1c908480b6599e4fec49eeb57d1a6e1fe2d40de0 (patch) | |
tree | 1de0ae8f46224306f360bfe963c44dbb5ee8d553 | |
parent | 019521bc0938a1b1517b01500923589a4a11e698 (diff) |
BUILD : 1.7.3 (171) BUGS : NOTES : Fixed big with long NSGuestNickPrefixes. We just used them in a snprintf without checking their size. Fixed a second guestnick bug as well: if compiled for hybrid guestnum was increased, tho it was never used.
git-svn-id: svn://svn.anope.org/anope/trunk@171 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@119 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | config.c | 7 | ||||
-rw-r--r-- | extern.h | 2 | ||||
-rw-r--r-- | hostserv.c | 4 | ||||
-rw-r--r-- | nickserv.c | 9 | ||||
-rw-r--r-- | version.log | 7 |
6 files changed, 20 insertions, 10 deletions
@@ -6,6 +6,7 @@ Provided by Anope Dev. <dev@anope.org> - 2004 05/24 A New NSNickTracking directive to provide nick tracking. [ #71] 05/21 A Auto enforce upon AKICK addition. [ #63] 05/21 A New file docs/OLDCHANGES contains all change history. [ #65] +06/06 F Fixed a bug with long NSGuestNickPrefixes. [ #00] 06/04 F Buffer initialization for encrypted MySQL passwords. [ #86] 06/04 F Rewrite of del_exception() fixing segfault and memory leak. [ #78] 06/04 F MemoServ send limit does no longer apply for services operators. [ #84] @@ -1029,7 +1029,12 @@ int read_config(int reload) NSDefFlags |= NI_MEMO_RECEIVE; } - CHECK(NSGuestNickPrefix); + CHECK(NSGuestNickPrefix); /* Add safety check */ + if (NSGuestNickPrefix && (strlen(NSGuestNickPrefix) > 21)) { + error(0, "Value of NSGuestNickPrefix must be between 1 and 21"); + retval = 0; + } + CHECK(NSDefLanguage); if (NSDefLanguage) { NSDefLanguage--; @@ -634,7 +634,7 @@ E NickAlias *nalists[1024]; E NickCore *nclists[1024]; E NickRequest *nrlists[1024]; -E int guestnum; +E unsigned int guestnum; E void insert_requestnick(NickRequest * nr); E void alpha_insert_alias(NickAlias * na); diff --git a/hostserv.c b/hostserv.c index 933509e97..7c2945683 100644 --- a/hostserv.c +++ b/hostserv.c @@ -23,7 +23,6 @@ void load_hs_dbase_v1(dbFILE * f); void load_hs_dbase_v2(dbFILE * f); void load_hs_dbase_v3(dbFILE * f); -static int guestnum; /* Current guest number */ HostCore *head = NULL; /* head of the HostCore list */ HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, char *vHost, char *creator, int32 tmp_time); @@ -94,9 +93,6 @@ void moduleAddHostServCmds(void) void hostserv_init(void) { moduleAddHostServCmds(); - guestnum = time(NULL); - while (guestnum > 9999999) - guestnum -= 10000000; } /*************************************************************************/ diff --git a/nickserv.c b/nickserv.c index 4a5986170..26a906880 100644 --- a/nickserv.c +++ b/nickserv.c @@ -23,7 +23,7 @@ NickAlias *nalists[1024]; NickCore *nclists[1024]; NickRequest *nrlists[1024]; -int guestnum; /* Current guest number */ +unsigned int guestnum; /* Current guest number */ #define TO_COLLIDE 0 /* Collide the user with this nick */ #define TO_RELEASE 1 /* Release a collided nick */ @@ -1660,12 +1660,15 @@ static void collide(NickAlias * na, int from_timeout) * per second. So let use another safer method. * --lara */ + /* So you should check the length of NSGuestNickPrefix, eh Lara? + * --Certus + */ - snprintf(guestnick, sizeof(guestnick), "%s%d", NSGuestNickPrefix, - guestnum++); #ifdef IRC_HYBRID kill_user(s_NickServ, na->nick, "Services nickname-enforcer kill"); #else + snprintf(guestnick, sizeof(guestnick), "%s%d", NSGuestNickPrefix, + guestnum++); notice_lang(s_NickServ, na->u, FORCENICKCHANGE_CHANGING, guestnick); send_cmd(NULL, "SVSNICK %s %s :%ld", na->nick, guestnick, time(NULL)); na->status |= NS_GUESTED; diff --git a/version.log b/version.log index d4e33518a..dbbd79a76 100644 --- a/version.log +++ b/version.log @@ -8,10 +8,15 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="3" -VERSION_BUILD="170" +VERSION_BUILD="171" # $Log$ # +# BUILD : 1.7.3 (171) +# BUGS : +# NOTES : Fixed big with long NSGuestNickPrefixes. We just used them in a snprintf without checking their size. Fixed a second +# guestnick bug as well: if compiled for hybrid guestnum was increased, tho it was never used. +# # BUILD : 1.7.3 (170) # BUGS : 86 # NOTES : Buffer initialization for encrypted MySQL passwords. |