From 46badeeeae678d507b9d3beaff893c12f0cc91f9b32295518871d8af99783f2f Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Thu, 21 Jul 2022 07:21:53 +0000 Subject: [PATCH] Accepting request 990490 from home:Vogtinator:boo1201737 - Add preliminary patch to fix smb connections with samba >= 4.16 (boo#1201737, kde#453090): * 0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch OBS-URL: https://build.opensuse.org/request/show/990490 OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/kio-extras5?expand=0&rev=180 --- ...se-Check-error-code-EINVAL-to-prompt.patch | 35 +++++++++++++++++++ kio-extras5.changes | 7 ++++ kio-extras5.spec | 2 ++ 3 files changed, 44 insertions(+) create mode 100644 0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch diff --git a/0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch b/0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch new file mode 100644 index 0000000..94017af --- /dev/null +++ b/0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch @@ -0,0 +1,35 @@ +From 546c2b06e27f0e8460f5ddf1347d28aa0ec22979 Mon Sep 17 00:00:00 2001 +From: Anthony Hung +Date: Wed, 22 Jun 2022 17:37:51 +0800 +Subject: [PATCH] smb/kio_smb_browse: Check error code `EINVAL` to prompt the + password dialog + +With `samba-libs` >= 4.16, when user connect to the windows file sharing with incorrect user credential, the error code is `EINVAL`. + +The user should get the password dialog to enter username and password if the error code is `EINVAL`. + +Reference URL: +https://bugzilla.samba.org/show_bug.cgi?id=14983 +https://gitlab.gnome.org/GNOME/gvfs/-/issues/611 + +BUG: 453090 +--- + smb/kio_smb_browse.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp +index 3bc25d83..a773befa 100644 +--- a/smb/kio_smb_browse.cpp ++++ b/smb/kio_smb_browse.cpp +@@ -452,7 +452,7 @@ WorkerResult SMBWorker::listDir(const QUrl &kurl) + if (m_current_url.getType() != SMBURLTYPE_ENTIRE_NETWORK && smbc->error() != 0) { + // not smb:// and had an error -> handle it + const int err = smbc->error(); +- if (err == EPERM || err == EACCES || workaroundEEXIST(err)) { ++ if (err == EPERM || err == EACCES || err == EINVAL || workaroundEEXIST(err)) { + qCDebug(KIO_SMB_LOG) << "trying checkPassword"; + const int passwordError = checkPassword(m_current_url); + if (passwordError == KJob::NoError) { +-- +2.36.1 + diff --git a/kio-extras5.changes b/kio-extras5.changes index 9f330ca..c5dd4a3 100644 --- a/kio-extras5.changes +++ b/kio-extras5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jul 21 06:33:22 UTC 2022 - Fabian Vogt + +- Add preliminary patch to fix smb connections with samba >= 4.16 + (boo#1201737, kde#453090): + * 0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch + ------------------------------------------------------------------- Tue Jul 5 17:03:20 UTC 2022 - Christophe Giboudeaux diff --git a/kio-extras5.spec b/kio-extras5.spec index 096a40e..3540b05 100644 --- a/kio-extras5.spec +++ b/kio-extras5.spec @@ -32,6 +32,8 @@ Source: https://download.kde.org/stable/release-service/%{version}/src/% Source1: https://download.kde.org/stable/release-service/%{version}/src/%{rname}-%{version}.tar.xz.sig Source2: applications.keyring %endif +# PATCH-FIX-UPSTREAM https://invent.kde.org/network/kio-extras/-/merge_requests/165 +Patch1: 0001-smb-kio_smb_browse-Check-error-code-EINVAL-to-prompt.patch # openEXR causes build issues for Leap 15.2 & 15.3 %if 0%{?suse_version} > 1500 BuildRequires: OpenEXR-devel