summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-06-22 18:02:40 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-06-22 18:04:48 +0200
commitacb38a412f395eb4019394f704921a152ca6e55b (patch)
treeaa6a2528a1c0dbef408e2780751d4298b422938f /gui
parent9f1807c2c053e3b57881d42ebf58ec26dfee1b1d (diff)
[feat] don't drink and root
Diffstat (limited to 'gui')
-rw-r--r--gui/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gui/main.cpp b/gui/main.cpp
index 1efa332..a172766 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -1,4 +1,5 @@
#include <csignal>
+#include <unistd.h>
#include <QApplication>
#include <QTimer>
#include <QTranslator>
@@ -146,6 +147,11 @@ int main(int argc, char **argv) {
exit(0);
}
+ if (getuid() == 0) {
+ qDebug() << "Please don't run as root. Aborting.";
+ exit(0);
+ }
+
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
qDebug() << "No systray icon available.";
availableSystray = false;