From 0a67b8861adfca7b09e59d9639e26b6bf71859a5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 11 Mar 2020 14:32:46 +0000 Subject: Warn if the server config contains an unhashed password. This will be made a hard failure in v4. --- src/modules/m_vhost.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modules/m_vhost.cpp') diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index 573b9b31a..43d732ef9 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -103,13 +103,21 @@ class ModuleVHost : public Module std::string mask = tag->getString("host"); if (mask.empty()) throw ModuleException(" is empty! at " + tag->getTagLocation()); + std::string username = tag->getString("user"); if (username.empty()) throw ModuleException(" is empty! at " + tag->getTagLocation()); + std::string pass = tag->getString("pass"); if (pass.empty()) throw ModuleException(" is empty! at " + tag->getTagLocation()); - std::string hash = tag->getString("hash"); + + const std::string hash = tag->getString("hash", "plaintext", 1); + if (stdalgo::string::equalsci(hash, "plaintext")) + { + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, " tag for %s at %s contains an plain text password, this is insecure!", + username.c_str(), tag->getTagLocation().c_str()); + } CustomVhost vhost(username, pass, hash, mask); newhosts.insert(std::make_pair(username, vhost)); -- cgit v1.3.1-10-gc9f91