blob: f6c9993a121f4716d739502a7390d223983600df (
plain)
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) {
|