From 6f56cb0c1fc8e22b394b3d33100a4a83c412b7ffb9af0551fba9916bc2c638a7 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Tue, 20 Jun 2023 17:31:36 +0000 Subject: [PATCH] Accepting request 1094137 from home:Vogtinator:branches:KDE:Frameworks5 - Add patch to fix crash on thumbnail generation (kde#470845): * 0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch OBS-URL: https://build.opensuse.org/request/show/1094137 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=388 --- ...-whether-thumbRootDevice-is-valid-be.patch | 32 +++++++++++++++++++ kio.changes | 6 ++++ kio.spec | 6 ++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch diff --git a/0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch b/0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch new file mode 100644 index 0000000..30ce3a8 --- /dev/null +++ b/0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch @@ -0,0 +1,32 @@ +From daa0b06ae8621f731327b547f268bddc9784001b Mon Sep 17 00:00:00 2001 +From: Nicolas Fella +Date: Sat, 10 Jun 2023 14:49:30 +0200 +Subject: [PATCH] [previewjob] Check whether thumbRootDevice is valid before + access + +storageAccessFromPath may return an invalid device, e.g. because the thumbnail directory doesn't exist yet + +In that case we must not use the device + +BUG: 470845 +(cherry picked from commit 3fdcb7bcdae3a3dc95ce5b3d15740802450b129e) +--- + src/widgets/previewjob.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp +index cffdce302..214e3b3b3 100644 +--- a/src/widgets/previewjob.cpp ++++ b/src/widgets/previewjob.cpp +@@ -829,7 +829,7 @@ PreviewJobPrivate::CachePolicy PreviewJobPrivate::canBeCached(const QString &pat + // Or, if the checked device is unencrypted, allow thumbnailing. + if (device.as()->isEncrypted()) { + const Solid::Device thumbRootDevice = Solid::Device::storageAccessFromPath(thumbRoot); +- shouldAllow = thumbRootDevice.as()->isEncrypted(); ++ shouldAllow = thumbRootDevice.isValid() && thumbRootDevice.as()->isEncrypted(); + } else { + shouldAllow = true; + } +-- +2.41.0 + diff --git a/kio.changes b/kio.changes index 20986bd..4bbafe6 100644 --- a/kio.changes +++ b/kio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 20 17:17:11 UTC 2023 - Fabian Vogt + +- Add patch to fix crash on thumbnail generation (kde#470845): + * 0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch + ------------------------------------------------------------------- Mon Jun 5 07:44:02 UTC 2023 - Christophe Marin diff --git a/kio.spec b/kio.spec index c6dd01d..67c6a9d 100644 --- a/kio.spec +++ b/kio.spec @@ -1,7 +1,7 @@ # # spec file for package kio # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -35,12 +35,14 @@ Source2: frameworks.keyring %endif # PATCH-FIX-OPENSUSE kio_help-fallback-to-kde4-docs.patch -- allow kio_help to see into kde4 documentation, needed especially for khelpcenter5 Patch0: kio_help-fallback-to-kde4-docs.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-previewjob-Check-whether-thumbRootDevice-is-valid-be.patch BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes # gcc7 is too old for std::transform_reduce %if 0%{?suse_version} == 1500 -BuildRequires: gcc10-c++ BuildRequires: gcc10-PIE +BuildRequires: gcc10-c++ %endif BuildRequires: kf5-filesystem BuildRequires: krb5-devel