[gnome-shell/wip/rstrode/rhel-7.9: 39/86] main: Show a warning when running as root




commit 72e7db128afff334a2e7c6f9977791d3f93f8b10
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 d86cf9e812..00e8db54d0 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -246,6 +246,12 @@ function _initializeUI() {
             Shell.Global.log_structured('GNOME Shell started at ' + _startDate,
                                         ['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.'));
+        }
     });
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]