diff options
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; } |