[gnome-shell/wip/rstrode/login-screen-extensions: 83/134] main: Show a warning when running as root
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/login-screen-extensions: 83/134] main: Show a warning when running as root
- Date: Thu, 26 Aug 2021 19:31:00 +0000 (UTC)
commit c8331c995afc57a86b75287b699737fbf719d6b5
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 8 13:32:35 2013 -0400
main: Show a warning when running as root
gnome-session used to show a dialog in this case, but a
notification is more natural nowadays. Doing it in gnome-shell
avoids complicated synchronization between gnome-session and
gnome-shell.
https://bugzilla.gnome.org/show_bug.cgi?id=701212
js/ui/main.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 729063f19f..52bd44c56f 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -235,6 +235,12 @@ function _initializeUI() {
['MESSAGE_ID=' + GNOMESHELL_STARTED_MESSAGE_ID]);
}
+ let credentials = new Gio.Credentials();
+ if (credentials.get_unix_user() === 0) {
+ notify(_('Logged in as a privileged user'),
+ _('Running a session as a privileged user should be avoided for security reasons. If
possible, you should log in as a normal user.'));
+ }
+
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
if (perfModuleName) {
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]