diff options
Diffstat (limited to 'zen/sys_info.cpp')
-rw-r--r-- | zen/sys_info.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/zen/sys_info.cpp b/zen/sys_info.cpp index 2a32d247..c3680ec7 100644 --- a/zen/sys_info.cpp +++ b/zen/sys_info.cpp @@ -207,7 +207,7 @@ std::wstring zen::getOsDescription() //throw FileError -Zstring zen::getRealProcessPath() //throw FileError +Zstring zen::getProcessPath() //throw FileError { try { @@ -284,3 +284,13 @@ Zstring zen::getUserDownloadsPath() //throw FileError } catch (const SysError& e) { throw FileError(_("Cannot get process information."), e.toString()); } } + + +bool zen::runningElevated() //throw FileError +{ + if (::geteuid() != 0) //nofail; non-root + return false; + + return getLoginUser() != "root"; //throw FileError + //consider "root login" like "UAC disabled" on Windows +} |