After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607094 - Nag users when they try to log in as root
Nag users when they try to log in as root
Status: RESOLVED DUPLICATE of bug 701212
Product: gnome-session
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-15 18:02 UTC by Ray Strode [halfline]
Modified: 2013-05-31 16:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Nag users when they try to log in as root (7.52 KB, patch)
2010-01-15 18:02 UTC, Ray Strode [halfline]
needs-work Details | Review
Nag users when they try to log in as root (6.90 KB, patch)
2010-01-15 18:10 UTC, Ray Strode [halfline]
reviewed Details | Review

Description Ray Strode [halfline] 2010-01-15 18:02:39 UTC
In GDM, we currently don't allow root logins because root logins
don't work very well.  This has worked out pretty well, but
there are still cases where a user manages to log in as root.
Some users use startx, or reconfigure GDM to allow root login.

It would be good to pop up a dialog when a user tries to log in
as root to warn them that there session isn't going to work very
well.

A better long-term solution would be to launch a special
administration console or something, but a warning is a better
near-term solution.
Comment 1 Ray Strode [halfline] 2010-01-15 18:02:40 UTC
Created attachment 151487 [details] [review]
Nag users when they try to log in as root

Root login does not work very well, in general.
PolicyKit, IRC, and other random things just don't
function right when run as root.  This commit adds
a nag screen to warn the user that they might not
have a good experience.
Comment 2 Ray Strode [halfline] 2010-01-15 18:05:43 UTC
Review of attachment 151487 [details] [review]:

::: gnome-session/main.c
@@ +49,2 @@
 #include "gsm-store.h"
+#define GSM_GCONF_ROOT_WARNING_KEY              "/apps/gnome-session/options/show_root_warning"

This is a stray commit, I'll drop that hunk and re git-bz the patch
Comment 3 Ray Strode [halfline] 2010-01-15 18:10:21 UTC
Created attachment 151489 [details] [review]
Nag users when they try to log in as root

Nag users when they try to log in as root.

Root login does not work very well, in general.  PolicyKit, IRC,
and other random things just don't function right when run as
root.  This commit adds a nag screen to warn the user that they
might not have a good experience.
Comment 4 Ray Strode [halfline] 2010-01-15 18:19:37 UTC
git-bz managled my message a bit.  If it's not clear, attachment 151489 [details] [review] is the same as attachment 151487 [details] [review] but without the spurious hunk
Comment 5 Vincent Untz 2010-01-15 18:48:46 UTC
Review of attachment 151489 [details] [review]:

We used to have this in the old gnome-session, and I think it makes sense. There are other checks that we might want to import again (like "your clock is probably wrong, it says 1984!")

I didn't look closely at the code, but here's a first review.

::: data/gnome-session.schemas.in.in
@@ +11,3 @@
+         <locale name="C">
+            <short>Warn user against running gnome-session from root account</short>
+            <long>If a user tries to login as root, show a dialog telling them it's a bad idea</long>

Change the long description to something like:

"If a user tries to log in as root, show a dialog explaining this should not be done unless strictly necessary."

::: gnome-session/gsm-manager.c
@@ +477,3 @@
+         * covering it up, etc.
+         */
+        if (manager->priv->phase + 1 == GSM_MANAGER_PHASE_APPLICATION) {

Hrm, I would think we want to do this once we have the WM. That's when we should be ready to display dialogs (and font settings should be loaded already).

::: gnome-session/gsm-util.c
@@ +404,3 @@
+        client = gconf_client_get_default ();
+        should_nag = gconf_client_get_bool (client, key, NULL);
+

Maybe add some "if (key)" check here and below (I'll add a comment).

@@ +413,3 @@
+        va_end (args);
+
+        dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,

GTK_MESSAGE_ERROR sounds wrong. Maybe WARNING? Or actually, maybe it should be an argument of gsm_util_nag_message(), since I imagine it depends on the text.

@@ +427,3 @@
+
+        gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
+        gtk_dialog_run (GTK_DIALOG (dialog));

Hrm, please, no gtk_dialog_run(). I understand we want to not enter the next phase, but the panel will be running and the user can click "Log out" there. And it won't work if we're in gtk_dialog_run().

@@ +430,3 @@
+
+        should_nag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_button)) == FALSE;
+        gconf_client_set_bool (client, key, should_nag != FALSE, NULL);

if (key)
Comment 6 Matthias Clasen 2011-08-27 04:27:41 UTC
We should perhaps get this in for 3.2 ?
Comment 7 Ray Strode [halfline] 2013-05-31 16:39:27 UTC
so actually we should this in gnome-shell i think. Let's consolidate this bug with 701212
Comment 8 Ray Strode [halfline] 2013-05-31 16:41:22 UTC

*** This bug has been marked as a duplicate of bug 701212 ***