diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-04-06 02:34:39 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-04-06 02:34:39 -0500 |
commit | 06b65e787b816b67624d435a1d7e7d443e8a6233 (patch) | |
tree | b8182ab627bc457e1dcd6e3e26e5773e01d1b701 /tdeio/tdeio/kservice.cpp | |
parent | 658707d49e5359eaf9dfa4c398ee492e90f8f1aa (diff) | |
download | tdelibs-06b65e787b816b67624d435a1d7e7d443e8a6233.tar.gz tdelibs-06b65e787b816b67624d435a1d7e7d443e8a6233.zip |
Honor application suid requests even if they are directed at KDE
Diffstat (limited to 'tdeio/tdeio/kservice.cpp')
-rw-r--r-- | tdeio/tdeio/kservice.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tdeio/tdeio/kservice.cpp b/tdeio/tdeio/kservice.cpp index 5ccb9f33c..14eb172d5 100644 --- a/tdeio/tdeio/kservice.cpp +++ b/tdeio/tdeio/kservice.cpp @@ -206,7 +206,7 @@ KService::init( KDesktopFile *config ) m_strExec = config->readPathEntry( "Exec" ); if (kde4application && !m_strExec.startsWith("/")) { m_strExec = "XDG_DATA_DIRS=" + kde4applicationprefix + "/share XDG_CONFIG_DIRS=/etc/xdg/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$PATH "+m_strExec; - } else if (config->readBoolEntry("X-TDE-SubstituteUID")) { + } else if (config->readBoolEntry("X-TDE-SubstituteUID") || config->readBoolEntry("X-KDE-SubstituteUID")) { int space = m_strExec.find(" "); if (space==-1) m_strExec = TDEStandardDirs::findExe(m_strExec); @@ -710,8 +710,17 @@ KService::List KService::allInitServices() } bool KService::substituteUid() const { - TQVariant v = property("X-TDE-SubstituteUID", TQVariant::Bool); - return v.isValid() && v.toBool(); + bool suid = false; + TQVariant v; + v = property("X-TDE-SubstituteUID", TQVariant::Bool); + if (v.isValid()) { + if (v.toBool()) suid = true; + } + v = property("X-KDE-SubstituteUID", TQVariant::Bool); + if (v.isValid()) { + if (v.toBool()) suid = true; + } + return suid; } TQString KService::username() const { |