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 /tdecore/kdesktopfile.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 'tdecore/kdesktopfile.cpp')
-rw-r--r-- | tdecore/kdesktopfile.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tdecore/kdesktopfile.cpp b/tdecore/kdesktopfile.cpp index b385eeb18..9798a1ff2 100644 --- a/tdecore/kdesktopfile.cpp +++ b/tdecore/kdesktopfile.cpp @@ -310,7 +310,7 @@ bool KDesktopFile::tryExec() const return false; } } - + // See also KService::username() bool su = readBoolEntry("X-TDE-SubstituteUID"); if (su) @@ -323,7 +323,21 @@ bool KDesktopFile::tryExec() const if (!kapp->authorize("user/"+user)) return false; } - + else { + // Respect KDE su request if present + su = readBoolEntry("X-KDE-SubstituteUID"); + if (su) + { + TQString user = readEntry("X-KDE-Username"); + if (user.isEmpty()) + user = ::getenv("ADMIN_ACCOUNT"); + if (user.isEmpty()) + user = "root"; + if (!kapp->authorize("user/"+user)) + return false; + } + } + return true; } |