diff options
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp index 8a67ddf13..e8a2b7a42 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1294,8 +1294,9 @@ void OperType::MergeTag(const std::shared_ptr<ConfigTag>& tag) OperAccount::OperAccount(const std::string& n, const std::shared_ptr<OperType>& o, const std::shared_ptr<ConfigTag>& t) : OperType(n, nullptr) - , password(t->getString("password")) - , passwordhash(t->getString("hash", "plaintext", 1)) + , nopassword(t->getBool("nopassword")) + , password(nopassword ? "" : t->getString("password")) + , passwordhash(nopassword ? "" : t->getString("hash", "plaintext", 1)) , type(o ? o->GetName() : n) { autologin = t->getEnum("autologin", AutoLogin::NEVER, { @@ -1336,5 +1337,8 @@ bool OperAccount::CanAutoLogin(LocalUser* user) const bool OperAccount::CheckPassword(const std::string& pw) const { - return InspIRCd::CheckPassword(password, passwordhash, pw); + if (nopassword) + return true; // <oper nopassword="yes"> + + return !password.empty() && InspIRCd::CheckPassword(password, passwordhash, pw); } |
