From 8608e864a382aeb931618f84c44c1b1c0ab6dc92 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 17 Oct 2018 07:21:03 -0500 Subject: [PATCH] pull in upstream crash fix, use %make_build --- ...h-by-not-checking-free-space-for-smb.patch | 37 +++++++++++++++++++ kio-extras.spec | 11 ++++-- 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 0001-Avoid-crash-by-not-checking-free-space-for-smb.patch diff --git a/0001-Avoid-crash-by-not-checking-free-space-for-smb.patch b/0001-Avoid-crash-by-not-checking-free-space-for-smb.patch new file mode 100644 index 0000000..3b674f2 --- /dev/null +++ b/0001-Avoid-crash-by-not-checking-free-space-for-smb.patch @@ -0,0 +1,37 @@ +From 767415da97a7fae3c5578b9a4fb17a7be041d8ae Mon Sep 17 00:00:00 2001 +From: Kai Uwe Broulik +Date: Fri, 31 Aug 2018 09:17:17 +0200 +Subject: [PATCH] Avoid crash by not checking free space for smb:// + +This isn't a real location but the overview of all found hosts. +smbc_opendir would succeed but then crash in smbc_fstatvfs + +Differential Revision: https://phabricator.kde.org/D15142 + +(cherry picked from commit 000b1d910b71b491621c7cdbd934c277171c20bf) +--- + smb/kio_smb_browse.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp +index 47b2b328..1fa0e6fb 100644 +--- a/smb/kio_smb_browse.cpp ++++ b/smb/kio_smb_browse.cpp +@@ -492,6 +492,14 @@ void SMBSlave::fileSystemFreeSpace(const QUrl& url) + { + qCDebug(KIO_SMB) << url; + ++ // Avoid crashing in smbc_fstatvfs below when ++ // requesting free space for smb:// which doesn't ++ // make sense to do to begin with ++ if (url.host().isEmpty()) { ++ error(KIO::ERR_COULD_NOT_STAT, url.url()); ++ return; ++ } ++ + SMBUrl smbcUrl = url; + int handle = smbc_opendir(smbcUrl.toSmbcUrl()); + if (handle < 0) { +-- +2.17.2 + diff --git a/kio-extras.spec b/kio-extras.spec index 96cf554..3728e2b 100644 --- a/kio-extras.spec +++ b/kio-extras.spec @@ -8,7 +8,7 @@ Name: kio-extras Version: 18.08.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Additional components to increase the functionality of KIO Framework License: GPLv2+ @@ -22,12 +22,14 @@ URL: https://cgit.kde.org/%{name}.git %endif Source0: http://download.kde.org/%{stable}/applications/%{version}/src/%{name}-%{version}.tar.xz +## upstramable patches # patch to use libtirpc for RPC, from Cygwin Ports # should be upstreamable, considering that glibc's builtin RPC is obsolete # https://github.com/cygwinports/kf5-kio-extras/blob/master/16.08.3-nfs-libtirpc.patch -Patch0: kio-extras-17.12.0-nfs-libtirpc.patch +Patch1000: kio-extras-17.12.0-nfs-libtirpc.patch ## upstream patches +Patch1: 0001-Avoid-crash-by-not-checking-free-space-for-smb.patch # filter plugin provides %global __provides_exclude_from ^(%{_kf5_qtplugindir}/.*\\.so)$ @@ -128,7 +130,7 @@ pushd %{_target_platform} %{?tests:-DBUILD_TESTING:BOOL=ON} popd -make %{?_smp_mflags} -C %{_target_platform} +%make_build -C %{_target_platform} %install @@ -224,6 +226,9 @@ time make test -C %{_target_platform} ARGS="--output-on-failure --timeout 10" || %changelog +* Wed Oct 17 2018 Rex Dieter - 18.08.2-2 +- pull in upstream crash fix, use %%make_build + * Wed Oct 10 2018 Rex Dieter - 18.08.2-1 - 18.08.2