summaryrefslogtreecommitdiffstats
path: root/src/input/pvsCheckPrivileges.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/pvsCheckPrivileges.cpp')
-rw-r--r--src/input/pvsCheckPrivileges.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/input/pvsCheckPrivileges.cpp b/src/input/pvsCheckPrivileges.cpp
index 57b5d8b..f9a8851 100644
--- a/src/input/pvsCheckPrivileges.cpp
+++ b/src/input/pvsCheckPrivileges.cpp
@@ -211,6 +211,7 @@ PVSCheckPrivileges::UserPrivilege PVSCheckPrivileges::getUserPrivilege(CachedInp
}
// User is not trivially privileged, so try to check with PolicyKit.
+#ifdef HAVE_POLKIT // but only if it is present
// For PolKit, we need the start-time of the process.
// On Linux, we can get it from /proc:
QString procStat = QString("/proc/%1/stat").arg(sender.pid);
@@ -257,6 +258,9 @@ PVSCheckPrivileges::UserPrivilege PVSCheckPrivileges::getUserPrivilege(CachedInp
return USER_LOOKUP_FAILURE;
}
return reply.value().isAuthorized ? USER_PRIVILEGED : USER_UNPRIVILEGED;
+#else
+ return USER_UNPRIVILEGED;
+#endif
}
QString PVSCheckPrivileges::getX11SessionName(CachedInputContext const& sender)