summaryrefslogtreecommitdiff
blob: bd6e2ab0d81540e78feb2d8ec1de44673fe15893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 621cd24acfec8cbed19e9aa6ff8650cd6f38f809 Mon Sep 17 00:00:00 2001
From: Nathaniel Graham <nate@kde.org>
Date: Sun, 6 May 2018 17:48:54 -0600
Subject: Show a warning when running as the root user

Summary: Now that Dolphin can be run as the root user again, let's show a warning.

Test Plan:
When run with the root user account:
{F5882057}

Reviewers: #dolphin, markg, elvisangelaccio

Reviewed By: markg, elvisangelaccio

Subscribers: acooligan, anthonyfieroni, chinmoyr, kfm-devel, rikmills, emmanuelp, zzag, nicolasfella, elvisangelaccio, Fuchs, mmustac, markg

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D12732
---
 src/dolphinviewcontainer.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index bf8ac88..7b99595 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -108,6 +108,14 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     m_messageWidget->setCloseButtonVisible(true);
     m_messageWidget->hide();
 
+#ifndef Q_OS_WIN
+    if (getuid() == 0) {
+
+        // We must be logged in as the root user; show a big scary warning
+        showMessage(i18n("Running Dolphin as root can be dangerous. Please be careful."), Warning);
+    }
+#endif
+
     m_view = new DolphinView(url, this);
     connect(m_view, &DolphinView::urlChanged,
             m_urlNavigator, &KUrlNavigator::setLocationUrl);
-- 
cgit v0.11.2