From e3c4e755a7e13d4223f8de98a68c8b4af031c013 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Mon, 4 Mar 2024 21:06:30 +0300 Subject: tdeioslave/sftp: make source c++11-compatible Signed-off-by: Alexander Golubev (cherry picked from commit 0e615e5c9090c5a0477865db0e687849a04aa5a2) --- tdeioslave/sftp/tdeio_sftp.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tdeioslave/sftp') diff --git a/tdeioslave/sftp/tdeio_sftp.cpp b/tdeioslave/sftp/tdeio_sftp.cpp index 19b28bdab..0abcd6238 100644 --- a/tdeioslave/sftp/tdeio_sftp.cpp +++ b/tdeioslave/sftp/tdeio_sftp.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -1136,16 +1137,16 @@ void sftpProtocol::openConnection() { // Preinit the list of supported auth methods static const auto authMethodsNormal = [](){ std::vector> rv; - rv.emplace_back(std::make_unique()); - rv.emplace_back(std::make_unique()); - rv.emplace_back(std::make_unique()); + rv.emplace_back(std::unique_ptr(new PublicKeyAuth)); + rv.emplace_back(std::unique_ptr(new KeyboardInteractiveAuth)); + rv.emplace_back(std::unique_ptr(new PasswordAuth)); return rv; }(); const static int supportedMethods = std::accumulate( authMethodsNormal.begin(), authMethodsNormal.end(), SSH_AUTH_METHOD_NONE, //< none is supported by default - [](int acc, const auto &m){ return acc |= m->flag(); }); + [](int acc, const std::unique_ptr &m){ return acc |= m->flag(); }); unsigned attemptedMethods = 0; @@ -1184,8 +1185,10 @@ void sftpProtocol::openConnection() { if(!mPassword.isEmpty()) { static const auto authMethodsWithPassword = []() { std::vector> rv; - rv.emplace_back(std::make_unique(/* noPasswordQuery = */true)); - rv.emplace_back(std::make_unique(/* noPasswordQuery = */true)); + rv.emplace_back(std::unique_ptr( + new KeyboardInteractiveAuth(/* noPasswordQuery = */true) ) ); + rv.emplace_back(std::unique_ptr( + new PasswordAuth(/* noPasswordQuery = */true) ) ); for (const auto &m: authMethodsNormal) { rv.emplace_back(m->clone()); } return rv; }(); -- cgit v1.2.1