Bug 15866 - "ConsoleKit.Manager.GetCurrentSession" can't work in some cases
Summary: "ConsoleKit.Manager.GetCurrentSession" can't work in some cases
Status: NEW
Alias: None
Product: ConsoleKit
Classification: Unclassified
Component: Daemon (show other bugs)
Version: unspecified
Hardware: All All
: high major
Assignee: william.jon.mccann
QA Contact:
Depends on:
Reported: 2008-05-08 02:50 UTC by simon zheng
Modified: 2009-07-20 13:47 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:

A possible fix (958 bytes, patch)
2008-05-08 02:53 UTC, simon zheng
Details | Splinter Review

Description simon zheng 2008-05-08 02:50:49 UTC
When I run gdmflexiserver from gnome-terminal on Solaris, it fails and shows me error.

"Unable to determine session: Unable to lookup information about calling process 110051"

Root cause is envrionment variable "XDG_SESSION_COOKIE" of my bash process is lost due to using custom ~/.bashrc. That results in ConsoleKit unable to return correct session id from "org.freedesktop.ConsoleKit.Manager.GetCurrentSession"
Comment 1 simon zheng 2008-05-08 02:53:19 UTC
Created attachment 16426 [details] [review]
A possible fix

Check"XDG_SESSION_COOKIE" in not only current process but also its parent process .
Comment 2 James Westby 2008-09-25 06:03:19 UTC

Do you have a comment on this issue and the proposed patch? It would
seem as though this would also allow policykit-using tools to work
under sudo, which there have been bug reports about in Ubuntu, e.g.


Comment 3 Halton Huo 2008-10-28 02:18:33 UTC
Check with the Ubuntu bug, it guess it is similar with the following case in Solaris:
$su -
<input your root password>
#env|grep XDG

If we use "su" instead of "su -" in upper case, the XDG_SESSION_COOKIE is retained. So gdmflexiserver can start without error.

If you have unset XDG_SESSION_COOKIE in your ~/.bashrc explicitly, that is user mistake. I'd say this is not a bug.
Comment 4 Ray Strode 2009-07-20 13:47:55 UTC
The thing is, in the gdmflexiserver case and the su case, they really are separate sessions, so piggy backing off the other parent session isn't right.

Right now ConsoleKit doesn't have great support for nested sessions, but that's really what we need I think.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.