Package: kde4libs / 4:4.14.38-3

kfileshare_kdesu_fileshareset.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Date: Wed, 13 Apr 2016 16:40:34 +0200
Subject: kfileshare_kdesu_fileshareset

---
 kio/kio/kfileshare.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kio/kio/kfileshare.cpp b/kio/kio/kfileshare.cpp
index 82915a386e..4f01556f92 100644
--- a/kio/kio/kfileshare.cpp
+++ b/kio/kio/kfileshare.cpp
@@ -239,17 +239,19 @@ bool KFileShare::setShared( const QString& path, bool shared )
        return false;
 
     kDebug(7000) << path << "," << shared;
+    QString kdesu = ::findExe("kdesu");
     QString exe = ::findExe( "fileshareset" );
-    if (exe.isEmpty())
+    if (kdesu.isEmpty() || exe.isEmpty())
         return false;
 
     QStringList args;
+    args << "--" << exe;
     if ( shared )
         args << "--add";
     else
         args << "--remove";
     args << path ;
-    int ec = QProcess::execute( exe, args ); // should be ok, the perl script terminates fast
+    int ec = QProcess::execute( kdesu, args ); // should be ok, the perl script terminates fast
     kDebug(7000) << "exitCode=" << ec;
     bool ok = !ec;
     switch (ec) {