]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Warn if the server config contains an unhashed password.
[user/henk/code/inspircd.git] / src / configreader.cpp
index 51f846f705f82ced7c90ea1064a8cd95bd88fe51..a43a9d78cd2f8a4e8c7ede9a13ac208d873dcb9d 100644 (file)
@@ -304,6 +304,14 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
                        me->maxconnwarn = tag->getBool("maxconnwarn", me->maxconnwarn);
                        me->limit = tag->getUInt("limit", me->limit);
                        me->resolvehostnames = tag->getBool("resolvehostnames", me->resolvehostnames);
+                       me->password = tag->getString("password", me->password);
+
+                       me->passwordhash = tag->getString("hash", me->passwordhash);
+                       if (!me->password.empty() && (me->passwordhash.empty() || stdalgo::string::equalsci(me->passwordhash, "plaintext")))
+                       {
+                               ServerInstance->Logs->Log("CONNECTCLASS", LOG_DEFAULT, "<connect> tag '%s' at %s contains an plain text password, this is insecure!",
+                                       name.c_str(), tag->getTagLocation().c_str());
+                       }
 
                        std::string ports = tag->getString("port");
                        if (!ports.empty())