GNOME Bugzilla – Bug 607094
Nag users when they try to log in as root
Last modified: 2013-05-31 16:41:22 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.
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.
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
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.
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
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)
We should perhaps get this in for 3.2 ?
so actually we should this in gnome-shell i think. Let's consolidate this bug with 701212
*** This bug has been marked as a duplicate of bug 701212 ***