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 701212 - [RFE] Notify user that some functionality is unavailable when not using GDM or when logging in as root
[RFE] Notify user that some functionality is unavailable when not using GDM o...
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 607094 685794 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-05-29 17:57 UTC by Stephen Gallagher
Modified: 2021-07-05 14:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
root warning (1.70 KB, patch)
2013-06-08 17:37 UTC, Matthias Clasen
reviewed Details | Review
gdm warning (1.14 KB, patch)
2013-06-08 17:38 UTC, Matthias Clasen
reviewed Details | Review
Show a warning when running as root (1.34 KB, patch)
2013-06-09 14:49 UTC, Matthias Clasen
none Details | Review
Show a warning when gdm is missing (1.25 KB, patch)
2013-06-09 14:49 UTC, Matthias Clasen
none Details | Review
Show a warning when running as root (1.23 KB, patch)
2015-03-03 20:09 UTC, Florian Müllner
needs-work Details | Review
Show a warning when gdm is missing (1.06 KB, patch)
2015-03-03 20:10 UTC, Florian Müllner
needs-work Details | Review

Description Stephen Gallagher 2013-05-29 17:57:02 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.
Comment 1 Matthias Clasen 2013-05-31 11:15:14 UTC
I went looking, and we don't actually have any warning when logging in as root anymore. It got lost somewhere along the way.
Comment 2 Ray Strode [halfline] 2013-05-31 16:02:38 UTC
guess it never landed upstream bug 607094
Comment 3 Ray Strode [halfline] 2013-05-31 16:41:06 UTC
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.
Comment 4 Ray Strode [halfline] 2013-05-31 16:41:22 UTC
*** Bug 607094 has been marked as a duplicate of this bug. ***
Comment 5 Ray Strode [halfline] 2013-05-31 16:49:35 UTC
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.
Comment 6 Ray Strode [halfline] 2013-05-31 17:19:25 UTC
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.
Comment 7 Matthias Clasen 2013-06-07 11:05:30 UTC
Ray, were you working on a patch for this ?
Comment 8 Matthias Clasen 2013-06-08 17:37:39 UTC
Created attachment 246321 [details] [review]
root warning
Comment 9 Matthias Clasen 2013-06-08 17:38:00 UTC
Created attachment 246322 [details] [review]
gdm warning
Comment 10 Giovanni Campagna 2013-06-08 23:46:01 UTC
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.
Comment 11 Giovanni Campagna 2013-06-08 23:47:42 UTC
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.
Comment 12 Matthias Clasen 2013-06-09 13:34:27 UTC
(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
Comment 13 Matthias Clasen 2013-06-09 13:35:57 UTC
>                                }
> +                              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.
Comment 14 Matthias Clasen 2013-06-09 14:49:27 UTC
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.
Comment 15 Matthias Clasen 2013-06-09 14:49:35 UTC
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.
Comment 16 Florian Müllner 2015-03-03 20:09:59 UTC
Created attachment 298477 [details] [review]
Show a warning when running as root

Rebased to master
Comment 17 Florian Müllner 2015-03-03 20:10:13 UTC
Created attachment 298478 [details] [review]
Show a warning when gdm is missing

Rebased to master
Comment 18 Florian Müllner 2015-03-03 20:16:52 UTC
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')?
Comment 19 Florian Müllner 2015-03-03 20:17:16 UTC
Review of attachment 298478 [details] [review]:

Same issue as the other patch with regard to classic mode
Comment 20 Florian Müllner 2015-03-07 09:49:52 UTC
*** Bug 685794 has been marked as a duplicate of this bug. ***
Comment 21 Rui Matos 2015-05-12 15:45:29 UTC
(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.
Comment 22 Rui Matos 2015-05-12 15:46:58 UTC
(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
Comment 23 GNOME Infrastructure Team 2021-07-05 14:28:57 UTC
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.