Package: kde4libs / 4:4.14.2-5+deb8u2

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
Description: run libexec/fileshareset with kdesu rather than setuid
 Run fileshareset with kdesu rather than rely on it to be setuid. filesharelist
 should not need root permissions on standard debian install.
Author: Modestas Vainius <modax@debian.org>
Forwarded: no
Origin: vendor
Last-Update: 2010-05-31


--- a/kio/kio/kfileshare.cpp
+++ b/kio/kio/kfileshare.cpp
@@ -239,17 +239,19 @@ bool KFileShare::setShared( const QStrin
        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) {