diff options
author | Rechi <Rechi@users.noreply.github.com> | 2018-02-27 20:00:00 +0100 |
---|---|---|
committer | Rechi <Rechi@users.noreply.github.com> | 2018-02-27 20:00:00 +0100 |
commit | 52e1e4a430d08d1ba07b2815faebf8a3e1af8dbc (patch) | |
tree | 65f48ddad48146413489bdf2a2de3a7bd86723c4 | |
parent | 1b5fa88e0771a3fa89b3f67bf1e50eb5f6d1a6eb (diff) |
[cleanup] drop support for libssh lower than 0.6
-rw-r--r-- | cmake/modules/FindSSH.cmake | 2 | ||||
-rw-r--r-- | xbmc/filesystem/SFTPFile.cpp | 36 | ||||
-rw-r--r-- | xbmc/filesystem/SFTPFile.h | 12 |
3 files changed, 1 insertions, 49 deletions
diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake index ee65210606..bf3837e01c 100644 --- a/cmake/modules/FindSSH.cmake +++ b/cmake/modules/FindSSH.cmake @@ -15,7 +15,7 @@ # SSH::SSH - The SSH library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_SSH libssh QUIET) + pkg_check_modules(PC_SSH libssh>=0.6 QUIET) endif() find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h diff --git a/xbmc/filesystem/SFTPFile.cpp b/xbmc/filesystem/SFTPFile.cpp index afa7bac43e..2c22d82c08 100644 --- a/xbmc/filesystem/SFTPFile.cpp +++ b/xbmc/filesystem/SFTPFile.cpp @@ -360,7 +360,6 @@ bool CSFTPSession::Connect(const std::string &host, unsigned int port, const std return false; } -#if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0,4,0) if (ssh_options_set(m_session, SSH_OPTIONS_USER, username.c_str()) < 0) { CLog::Log(LOGERROR, "SFTPSession: Failed to set username '%s' for session", username.c_str()); @@ -389,33 +388,6 @@ bool CSFTPSession::Connect(const std::string &host, unsigned int port, const std #endif ssh_options_set(m_session, SSH_OPTIONS_LOG_VERBOSITY, 0); ssh_options_set(m_session, SSH_OPTIONS_TIMEOUT, &timeout); -#else - SSH_OPTIONS* options = ssh_options_new(); - - if (ssh_options_set_username(options, username.c_str()) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set username '%s' for session", username.c_str()); - return false; - } - - if (ssh_options_set_host(options, host.c_str()) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set host '%s' for session", host.c_str()); - return false; - } - - if (ssh_options_set_port(options, port) < 0) - { - CLog::Log(LOGERROR, "SFTPSession: Failed to set port '%d' for session", port); - return false; - } - - ssh_options_set_timeout(options, timeout, 0); - - ssh_options_set_log_verbosity(options, 0); - - ssh_set_options(m_session, options); -#endif if(ssh_connect(m_session)) { @@ -437,19 +409,11 @@ bool CSFTPSession::Connect(const std::string &host, unsigned int port, const std return false; } -#if LIBSSH_VERSION_MINOR >= 6 int method = ssh_userauth_list(m_session, NULL); -#else - int method = ssh_auth_list(m_session); -#endif // Try to authenticate with public key first int publicKeyAuth = SSH_AUTH_DENIED; -#if LIBSSH_VERSION_MINOR >= 6 if (method & SSH_AUTH_METHOD_PUBLICKEY && (publicKeyAuth = ssh_userauth_publickey_auto(m_session, NULL, NULL)) == SSH_AUTH_ERROR) -#else - if (method & SSH_AUTH_METHOD_PUBLICKEY && (publicKeyAuth = ssh_userauth_autopubkey(m_session, NULL)) == SSH_AUTH_ERROR) -#endif { CLog::Log(LOGERROR, "SFTPSession: Failed to authenticate via publickey '%s'", ssh_get_error(m_session)); return false; diff --git a/xbmc/filesystem/SFTPFile.h b/xbmc/filesystem/SFTPFile.h index ed2c83243b..9584f72706 100644 --- a/xbmc/filesystem/SFTPFile.h +++ b/xbmc/filesystem/SFTPFile.h @@ -37,18 +37,6 @@ class CURL; -#if LIBSSH_VERSION_INT < SSH_VERSION_INT(0,3,2) -#define ssh_session SSH_SESSION -#endif - -#if LIBSSH_VERSION_INT < SSH_VERSION_INT(0,4,0) -#define sftp_file SFTP_FILE* -#define sftp_session SFTP_SESSION* -#define sftp_attributes SFTP_ATTRIBUTES* -#define sftp_dir SFTP_DIR* -#define ssh_session ssh_session* -#endif - //five secs timeout for SFTP #define SFTP_TIMEOUT 5 |