Accepting request 517001 from home:wolfi323:test
- Add fix-applying-special-file-attributes.patch to fix modifying advanced permissions in the file/folder properties dialog (boo#978935, kde#365795) OBS-URL: https://build.opensuse.org/request/show/517001 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=193
This commit is contained in:
parent
6cae453044
commit
f5bbe32071
81
fix-applying-special-file-attributes.patch
Normal file
81
fix-applying-special-file-attributes.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From 9ac7832b859bfcbc88448c4ae0f6dc14b2d54a06 Mon Sep 17 00:00:00 2001
|
||||
From: Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
Date: Tue, 15 Aug 2017 14:41:36 +0200
|
||||
Subject: [File KIO slave] Fix applying special file attributes
|
||||
|
||||
QFile does not support special attributes like sticky. This would cause us to always discard them.
|
||||
|
||||
BUG: 365795
|
||||
|
||||
Differential Revision: https://phabricator.kde.org/D7326
|
||||
---
|
||||
autotests/jobtest.cpp | 20 ++++++++++++++++++++
|
||||
autotests/jobtest.h | 3 +++
|
||||
src/ioslaves/file/file.cpp | 5 +++++
|
||||
3 files changed, 28 insertions(+)
|
||||
|
||||
diff --git a/autotests/jobtest.cpp b/autotests/jobtest.cpp
|
||||
index 80a8921..557d1b5 100644
|
||||
--- a/autotests/jobtest.cpp
|
||||
+++ b/autotests/jobtest.cpp
|
||||
@@ -1473,6 +1473,26 @@ void JobTest::chmodFile()
|
||||
QFile::remove(filePath);
|
||||
}
|
||||
|
||||
+#ifdef Q_OS_UNIX
|
||||
+void JobTest::chmodSticky()
|
||||
+{
|
||||
+ const QString filePath = homeTmpDir() + "fileForChmodSticky";
|
||||
+ createTestFile(filePath);
|
||||
+ KFileItem item(QUrl::fromLocalFile(filePath));
|
||||
+ const mode_t origPerm = item.permissions();
|
||||
+ mode_t newPerm = origPerm ^ S_ISVTX;
|
||||
+ QVERIFY(newPerm != origPerm);
|
||||
+ KFileItemList items({item});
|
||||
+ KIO::Job *job = KIO::chmod(items, newPerm, S_ISVTX, QString(), QString(), false, KIO::HideProgressInfo);
|
||||
+ job->setUiDelegate(nullptr);
|
||||
+ QVERIFY(job->exec());
|
||||
+
|
||||
+ KFileItem newItem(QUrl::fromLocalFile(filePath));
|
||||
+ QCOMPARE(QString::number(newItem.permissions(), 8), QString::number(newPerm, 8));
|
||||
+ QFile::remove(filePath);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
void JobTest::chmodFileError()
|
||||
{
|
||||
// chown(root) should fail
|
||||
diff --git a/autotests/jobtest.h b/autotests/jobtest.h
|
||||
index 96b4264..e3d800a 100644
|
||||
--- a/autotests/jobtest.h
|
||||
+++ b/autotests/jobtest.h
|
||||
@@ -84,6 +84,9 @@ private Q_SLOTS:
|
||||
#endif
|
||||
void mostLocalUrl();
|
||||
void chmodFile();
|
||||
+#ifdef Q_OS_UNIX
|
||||
+ void chmodSticky();
|
||||
+#endif
|
||||
void chmodFileError();
|
||||
void mimeType();
|
||||
void mimeTypeError();
|
||||
diff --git a/src/ioslaves/file/file.cpp b/src/ioslaves/file/file.cpp
|
||||
index 47fb0a5..a7f1a47 100644
|
||||
--- a/src/ioslaves/file/file.cpp
|
||||
+++ b/src/ioslaves/file/file.cpp
|
||||
@@ -225,7 +225,12 @@ void FileProtocol::chmod(const QUrl &url, int permissions)
|
||||
const QString path(url.toLocalFile());
|
||||
const QByteArray _path(QFile::encodeName(path));
|
||||
/* FIXME: Should be atomic */
|
||||
+#ifdef Q_OS_UNIX
|
||||
+ // QFile::Permissions does not support special attributes like sticky
|
||||
+ if (::chmod(QFile::encodeName(path).constData(), permissions) == -1 ||
|
||||
+#else
|
||||
if (!QFile::setPermissions(path, modeToQFilePermissions(permissions)) ||
|
||||
+#endif
|
||||
(setACL(_path.data(), permissions, false) == -1) ||
|
||||
/* if not a directory, cannot set default ACLs */
|
||||
(setACL(_path.data(), permissions, true) == -1 && errno != ENOTDIR)) {
|
||||
--
|
||||
cgit v0.11.2
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 15 12:49:25 UTC 2017 - wbauer@tmo.at
|
||||
|
||||
- Add fix-applying-special-file-attributes.patch to fix modifying
|
||||
advanced permissions in the file/folder properties dialog
|
||||
(boo#978935, kde#365795)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 12 09:23:30 UTC 2017 - christophe@krop.fr
|
||||
|
||||
|
3
kio.spec
3
kio.spec
@ -75,6 +75,8 @@ Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%
|
||||
Source1: baselibs.conf
|
||||
# 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: fix-applying-special-file-attributes.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -121,6 +123,7 @@ Development files.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
%cmake_kf5 -d build
|
||||
|
Loading…
Reference in New Issue
Block a user