From 2f5e1e8c32f8c8dc4b1ece9299f05b5bfe931246 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 8 Apr 2021 18:24:21 +0200 Subject: [PATCH] rec: Be more straightforward in rec_control for 'hash-password' --- pdns/rec_control.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pdns/rec_control.cc b/pdns/rec_control.cc index 77bdfe789c..6e61171eef 100644 --- a/pdns/rec_control.cc +++ b/pdns/rec_control.cc @@ -109,7 +109,6 @@ int main(int argc, char** argv) const vector&commands=arg().getCommands(); string command; - string password; int fd = -1; unsigned int i = 0; while (i < commands.size()) { @@ -145,7 +144,9 @@ int main(int argc, char** argv) else if (commands.at(i) == "hash-password") { if (commands.size() > (i + 1)) { ++i; - password = commands.at(i); + auto password = commands.at(i); + cout << hashPassword(password) << endl; + return 0; } else { throw PDNSException("Command needs a password argument"); @@ -154,11 +155,6 @@ int main(int argc, char** argv) ++i; } - if (!password.empty()) { - cout << hashPassword(password) << endl; - return 0; - } - auto timeout = arg().asNum("timeout"); RecursorControlChannel rccS; rccS.connect(arg()["socket-dir"], sockname); -- 2.47.2