GNOME Bugzilla – Bug 701212
[RFE] Notify user that some functionality is unavailable when not using GDM or when logging in as root
Last modified: 2021-07-05 14:28:57 UTC
Some people choose to dabble with GNOME/GNOME Classic from other installed desktop environments. If those desktop environments were installed with their own display manager (e.g. KDM, XDM, lightdm, etc.), when booting into GNOME, screen-locking and user switching do not work. (In the case of user switching, an option appears in the user menu but does nothing when clicked on). From the perspective of a new user, this would appear to be a regression in functionality (and even a security issue, considering the lack of a screen-lock). It would be beneficial if the user was presented with a screen similar to that seen when logging in as 'root'. This screen could inform the user that some functionality such as screen-locking and fast-user-switching will be unavailable due to their reliance on GDM. This would present a better initial experience of the desktop to prospective converts.
I went looking, and we don't actually have any warning when logging in as root anymore. It got lost somewhere along the way.
guess it never landed upstream bug 607094
So the more i think about it, showing a dialog at start up is sort of icky. we should do this in gnome-shell via a notification or something less gross. Also, we should fix 607094 and this one at the same time, in a similar way, so if the user is coming from KDM and logging in as root we don't end up with a barrage of "your session won't work" nags, but just have one nag.
*** Bug 607094 has been marked as a duplicate of this bug. ***
Alright, I talked to #gnome-design about this. Both Allan and Lapo agree a notification with a checkbox for "don't show this again" is probably the right away to go.
so re comment 3, the concensus on #gnome-design is that there should just be separate notifications in the rare corner case that both non-GDM-login and login-as-root are true.
Ray, were you working on a patch for this ?
Created attachment 246321 [details] [review] root warning
Created attachment 246322 [details] [review] gdm warning
Review of attachment 246321 [details] [review]: ::: js/ui/main.js @@ +203,3 @@ + let userManager = AccountsService.UserManager.get_default(); + let user = userManager.get_user(GLib.get_user_name()); + if (user.get_uid() == 0) { You don't really need to ask AccountsService for the UID, you can just build a GCredentials. In particular, this can be a problem if the user is not loaded by the time we reach this code.
Review of attachment 246322 [details] [review]: ::: js/ui/main.js @@ +207,3 @@ _("Running a session as a privileged user should be avoided for security reasons. If possible, you should log in as a normal user.")); } + if (!LoginManager.canLock()) { This causes a sync DBus call, check for screenShield != null instead.
(In reply to comment #10) > Review of attachment 246321 [details] [review]: > > ::: js/ui/main.js > @@ +203,3 @@ > + let userManager = > AccountsService.UserManager.get_default(); > + let user = > userManager.get_user(GLib.get_user_name()); > + if (user.get_uid() == 0) { > > You don't really need to ask AccountsService for the UID, you can just build a > GCredentials. > In particular, this can be a problem if the user is not loaded by the time we > reach this code. I spent some time looking for a way to call geteuid() from js and gave up... thanks for the tip
> } > + if (!LoginManager.canLock()) { > > This causes a sync DBus call, check for screenShield != null instead. Ok. But I realized that we only ever want to show this warning in a regular session (not on the login screen, eg). So there needs to be an additional check for the session mode, I guess.
Created attachment 246355 [details] [review] 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.
Created attachment 246356 [details] [review] Show a warning when gdm is missing If we are not running under gdm, some functionaliy (such as the lock screen) does not work, and we should inform the user about this.
Created attachment 298477 [details] [review] Show a warning when running as root Rebased to master
Created attachment 298478 [details] [review] Show a warning when gdm is missing Rebased to master
Review of attachment 298477 [details] [review]: ::: js/ui/main.js @@ +229,3 @@ + + let credentials = Gio.Credentials.new(); + if (sessionMode.currentMode == 'user' && That check is outdated, we'd want the same in the classic session nowadays. Not sure what's the best way to replace it though to be honest - (!sessionMode.isGreeter && sessionMode.hasNotifications)? Just shoehorn into the block above that uses (currentMode != 'gdm' && currentMode != 'initialSetup')?
Review of attachment 298478 [details] [review]: Same issue as the other patch with regard to classic mode
*** Bug 685794 has been marked as a duplicate of this bug. ***
(In reply to Florian Müllner from comment #18) > Review of attachment 298477 [details] [review] [review]: > > ::: js/ui/main.js > @@ +229,3 @@ > + > + let credentials = Gio.Credentials.new(); > + if (sessionMode.currentMode == 'user' && > > That check is outdated, we'd want the same in the classic session nowadays. > Not sure what's the best way to replace it though to be honest - > (!sessionMode.isGreeter && sessionMode.hasNotifications)? Just shoehorn into > the block above that uses (currentMode != 'gdm' && currentMode != > 'initialSetup')? I think for the root check we can just do it unconditionally for the root user regardless of session mode since there are no cases where gnome-shell should be running as root. Both in gdm and g-i-s' cases, special non-root users are used.
(In reply to Florian Müllner from comment #19) > Review of attachment 298478 [details] [review] [review]: > > Same issue as the other patch with regard to classic mode (currentMode != 'gdm' && currentMode != 'initialSetup' && screenShield == null) sounds good to me
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.