From b02588b210e5fb961cf72d4d7d47165d54198697be62f54ff25b6d90d14bc1ba Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Wed, 5 Jan 2022 23:34:53 +0000 Subject: [PATCH] Accepting request 944119 from home:Vogtinator:boo1192731 - Add patch to fix sftp connection if the server requires compression (boo#1192731): * 0001-sftp-Allow-compression-if-necessary.patch OBS-URL: https://build.opensuse.org/request/show/944119 OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/kio-extras5?expand=0&rev=167 --- ...-sftp-Allow-compression-if-necessary.patch | 43 +++++++++++++++++++ kio-extras5.changes | 7 +++ kio-extras5.spec | 2 + 3 files changed, 52 insertions(+) create mode 100644 0001-sftp-Allow-compression-if-necessary.patch diff --git a/0001-sftp-Allow-compression-if-necessary.patch b/0001-sftp-Allow-compression-if-necessary.patch new file mode 100644 index 0000000..110185f --- /dev/null +++ b/0001-sftp-Allow-compression-if-necessary.patch @@ -0,0 +1,43 @@ +From f3ad370f237c69c018c968bab6f79b16c27edbba Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Tue, 16 Nov 2021 08:35:45 +0100 +Subject: [PATCH] sftp: Allow compression if necessary + +Specifying only "none" as compression method causes the exchange to fail if +the server doesn't support "none". + +Use the same options as OpenSSH does by default. The Compression=yes/no option +in the config file overrides them if specified. + +Setting the options explicitly can be dropped in the future after libssh +adjusts its built-in defaults. + +(cherry picked from commit c5a9722de86f111ded36488e9bb676a70e80aea0) +--- + sftp/kio_sftp.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sftp/kio_sftp.cpp b/sftp/kio_sftp.cpp +index 1afc51f5..c90aab76 100644 +--- a/sftp/kio_sftp.cpp ++++ b/sftp/kio_sftp.cpp +@@ -592,13 +592,13 @@ Result SFTPInternal::sftpOpenConnection(const AuthInfo &info) + return Result::fail(KIO::ERR_INTERNAL, i18n("Could not disable Nagle's Algorithm.")); + } + +- // Don't use any compression +- rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_C_S, "none"); ++ // Prefer not to use compression ++ rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_C_S, "none,zlib@openssh.com,zlib"); + if (rc < 0) { + return Result::fail(KIO::ERR_INTERNAL, i18n("Could not set compression.")); + } + +- rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_S_C, "none"); ++ rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_S_C, "none,zlib@openssh.com,zlib"); + if (rc < 0) { + return Result::fail(KIO::ERR_INTERNAL, i18n("Could not set compression.")); + } +-- +2.33.1 + diff --git a/kio-extras5.changes b/kio-extras5.changes index b53232f..d6b997b 100644 --- a/kio-extras5.changes +++ b/kio-extras5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 5 13:50:36 UTC 2022 - Fabian Vogt + +- Add patch to fix sftp connection if the server requires compression + (boo#1192731): + * 0001-sftp-Allow-compression-if-necessary.patch + ------------------------------------------------------------------- Fri Dec 3 19:22:06 UTC 2021 - Christophe Giboudeaux diff --git a/kio-extras5.spec b/kio-extras5.spec index a65a20e..4fb40d4 100644 --- a/kio-extras5.spec +++ b/kio-extras5.spec @@ -33,6 +33,8 @@ Source1: https://download.kde.org/stable/release-service/%{version}/src/% Source2: applications.keyring %endif Source99: %{name}-rpmlintrc +# PATCH-FIX-UPSTREAM +Patch1: 0001-sftp-Allow-compression-if-necessary.patch # openEXR causes build issues for Leap 15.2 & 15.3 %if 0%{?suse_version} > 1500 BuildRequires: OpenEXR-devel