summaryrefslogtreecommitdiff
path: root/kde-frameworks/kcoreaddons/files/kcoreaddons-5.108.0-kurlmimedata-dont-portal-symlinks.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kde-frameworks/kcoreaddons/files/kcoreaddons-5.108.0-kurlmimedata-dont-portal-symlinks.patch')
-rw-r--r--kde-frameworks/kcoreaddons/files/kcoreaddons-5.108.0-kurlmimedata-dont-portal-symlinks.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/kde-frameworks/kcoreaddons/files/kcoreaddons-5.108.0-kurlmimedata-dont-portal-symlinks.patch b/kde-frameworks/kcoreaddons/files/kcoreaddons-5.108.0-kurlmimedata-dont-portal-symlinks.patch
new file mode 100644
index 000000000000..0d5e6767c46f
--- /dev/null
+++ b/kde-frameworks/kcoreaddons/files/kcoreaddons-5.108.0-kurlmimedata-dont-portal-symlinks.patch
@@ -0,0 +1,46 @@
+From 2ec1a017b4cd0c56318b38ccd92b523ad21a1a08 Mon Sep 17 00:00:00 2001
+From: Harald Sitter <sitter@kde.org>
+Date: Thu, 29 Jun 2023 12:43:14 +0200
+Subject: [PATCH] kurlmimedata: don't portal symlinks
+
+they are not really supported. from testing it seems that opening
+O_NOFOLLOW results in the portal not being able to use the fd so
+ultimately we have no way to copy a symlink (instead of the file it
+points to)
+
+BUG: 464225
+
+
+(cherry picked from commit 14e954248e365098e4b98cfd7c76e5ea1defb8a7)
+---
+ src/lib/io/kurlmimedata.cpp | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/src/lib/io/kurlmimedata.cpp b/src/lib/io/kurlmimedata.cpp
+index 6b62232c1..fe18717c6 100644
+--- a/src/lib/io/kurlmimedata.cpp
++++ b/src/lib/io/kurlmimedata.cpp
+@@ -275,9 +275,17 @@ bool KUrlMimeData::exportUrlsToPortal(QMimeData *mimeData)
+ qWarning() << "kio-fuse is missing";
+ return false;
+ }
+- } else if (isLocal && QFileInfo(url.toLocalFile()).isDir()) {
+- // XDG Document Portal doesn't support directories and silently drops them.
+- return false;
++ } else {
++ const QFileInfo info(url.toLocalFile());
++ if (info.isDir()) {
++ // XDG Document Portal doesn't support directories and silently drops them.
++ return false;
++ }
++ if (info.isSymbolicLink()) {
++ // XDG Document Portal also doesn't support symlinks since it doesn't let us open the fd O_NOFOLLOW.
++ // https://github.com/flatpak/xdg-desktop-portal/issues/961#issuecomment-1573646299
++ return false;
++ }
+ }
+ }
+
+--
+GitLab
+