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 580259 - Shutdown/Reboot incorrectly detects multiple sessions
Shutdown/Reboot incorrectly detects multiple sessions
Status: RESOLVED NOTGNOME
Product: gnome-session
Classification: Core
Component: gnome-session
2.26.x
Other All
: Normal minor
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-26 07:38 UTC by Jason Leach
Modified: 2009-04-26 13:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
git diff (971 bytes, patch)
2009-04-26 07:39 UTC, Jason Leach
none Details | Review

Description Jason Leach 2009-04-26 07:38:38 UTC
Please describe the problem:
When a single non-root user attempts to do a System->Reboot (or shutdown), the admin authorization dialog comes up based on the fact that the org.freedesktop.hal.power-management.reboot-multiple-sessions is being queried for active console authorization (which defaults to "Admin Authentication"), when instead it should be querying org.freedesktop.hal.power-management.reboot (which defaults to "Yes").

The error is born from gsm_consolekit_is_single_user() of gnome-session/gsm-consolekit.c, where it will always throw out a g_warning ("Unable to list sessions...") and return FALSE after the "if (!res)" around line 1066. The reason why is because the g_proxy_new call is hitting the ConsoleKit.Manager interface, which by a policy defined in ConsoleKit.conf is not available for default (non-root) access. GetSessions is however accessible from a ConsoleKit.Seat interface... so the solution is simply to change the calling code to this type.

Steps to reproduce:
1. Login as a non-root user. 
2. Verify only one user is logged in via a 'who' or 'ck-list-sessions' in a console.
3. Go to System->Shut down...
4. Click the Reboot button



Actual results:
A dialog pops up asking for the root password.

Expected results:
The computer should actually reboot.

Does this happen every time?
Yes.

Other information:
Patch attached.
Comment 1 Jason Leach 2009-04-26 07:39:58 UTC
Created attachment 133308 [details] [review]
git diff
Comment 2 Jason Leach 2009-04-26 07:54:52 UTC
Discussion about this issue started at http://bbs.archlinux.org/viewtopic.php?id=70803
Comment 3 Jason Leach 2009-04-26 13:24:58 UTC
The other solution is for ConsoleKit to enable policy access to the Manager.GetSessions method in the default ConsoleKit.conf 

See https://bugs.freedesktop.org/show_bug.cgi?id=20471
Comment 4 Vincent Untz 2009-04-26 13:45:41 UTC
This is mentioned in the NEWS file:

====
Depending on how D-Bus and ConsoleKit are configured on your system, you might
need the patch from https://bugs.freedesktop.org/show_bug.cgi?id=20471 for your
ConsoleKit configuration. This is required so it's possible for applications to
be able to know if there are more than one user logged in on the machine.
====

Your patch won't work for systems with multiple seats.

It's really a ConsoleKit bug, and it was documented => NOTGNOME.