Bug 15866

Summary: "ConsoleKit.Manager.GetCurrentSession" can't work in some cases
Product: ConsoleKit Reporter: simon zheng <simon.zheng>
Component: DaemonAssignee: william.jon.mccann
Status: NEW --- QA Contact:
Severity: major    
Priority: high CC: brian.cameron, halton.huo, jw+debian, reidr
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: A possible fix

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
Hi,

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.
https://bugs.launchpad.net/bugs/210897.

Thanks,

James
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
#gdmflexiserver

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.