summaryrefslogtreecommitdiff
path: root/zen/sys_info.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-06-20 07:46:53 -0400
committerB. Stack <bgstack15@gmail.com>2023-06-20 07:46:53 -0400
commitf76994f1fb3e25c4563c9d8afce6bbc86701d1d2 (patch)
treeb39389163603195a0169af57712eb0765e5c11f4 /zen/sys_info.cpp
parentadd upstream 12.3 (diff)
downloadFreeFileSync-12.4.tar.gz
FreeFileSync-12.4.tar.bz2
FreeFileSync-12.4.zip
add upstream 12.412.4
Diffstat (limited to 'zen/sys_info.cpp')
-rw-r--r--zen/sys_info.cpp12
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
+}
bgstack15