From 63c639e108a00d7dbb0d7ac9891684fc83a3b207 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 Apr 2012 05:07:06 -0400 Subject: [PATCH] Fixed hashm checking in db_old and loading 1.9.1 databases --- modules/database/db_old.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index 7e173526a..c455aa265 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -620,7 +620,9 @@ static void LoadBots() READ(read_int32(&created, f)); READ(read_int16(&chancount, f)); - BotInfo *bi = new BotInfo(nick, user, host, real); + BotInfo *bi = findbot(nick); + if (!bi) + bi = new BotInfo(nick, user, host, real); bi->created = created; if (flags & OLD_BI_PRIVATE) @@ -1005,7 +1007,7 @@ class DBOld : public Module ConfigReader conf; hashm = conf.ReadValue("db_old", "hash", "", 0); - if (hashm != "md5" && hashm != "oldmd5" && hashm == "sha1" && hashm == "plain") + if (hashm != "md5" && hashm != "oldmd5" && hashm != "sha1" && hashm != "plain" && hashm != "sha256") throw ModuleException("Invalid hash method"); }