Bug 27337 - ck-collect-session-info fails for remote sessions
Summary: ck-collect-session-info fails for remote sessions
Status: NEW
Alias: None
Product: ConsoleKit
Classification: Unclassified
Component: Daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: william.jon.mccann
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-26 19:10 UTC by Brian Cameron
Modified: 2010-06-11 12:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Cameron 2010-03-26 19:10:51 UTC
Currently ConsoleKit calls ck-collect-session-info --uid 0 --pid # when it is creating a session.  This program calls ck-get-x11-server-pid, which only works properly if it can connect to the Xserver via XOpenSession().  So if you connect remotely via XDMCP, then you get these errors in the syslog:

   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: Executing 
                            /usr/lib/ck-collect-session-info --uid 0 --pid 2614
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: command error 
                            output:
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: command error 
                            output: ** (ck-collect-session-info:2618): 
                            WARNING **:
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: command error 
                            output: ** (process:2621): WARNING **: Failed to 
                            getpeerucred() credentials: Invalid argument
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: command error 
                            output:
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: Job status: 0
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: Job output: 
                            unix-user = 0

   [...]
   console-kit-daemon[473]: [ID 702911 daemon.warning] DEBUG: Skipping unknown 
                            parameter: session

This fails on XDMCP since the root does not have an xauth key to access the remote Xserver and because ConsoleKit is not run with XAUTHORITY set to the key associated with any specific display.  

In talking with Ray Strode, he seemed to suggest that the call to
ck-collect-session-info is not needed for remote displays.  It is true that
XDMCP seems to work reasonably even with the above errors.  If it is not needed, can the call be avoided in situations where it will just put errors in the syslog?

I notice in the ConsoleKit code that the call to ck-collect-session-info is in src/ck-session-leader.c in the function ck-session_leader_collect_parameters().  This is called by generate_session_for_leader which is called by open_session_for_sender which is called by ck_manager_open_session() in ck_manager.c.
Comment 1 Thiago Macieira 2010-03-27 00:09:38 UTC
This is not the bug-tracker for consolekit.

Is there something you need in D-Bus core?
Comment 2 Brian Cameron 2010-03-27 09:00:11 UTC
Sorry, misfiled.  Changeing to ConsoleKit.
Comment 3 Halton Huo 2010-03-30 03:33:18 UTC
With my testing, this error only happens for XDMCP which Xserver is really remote. For the case XDMCP+Xvnc, this error won't be present in the syslog.

Take pid 25465 is local session, pid 25875 is the Xvnc+XDMCP session, pid 25537 is remote XDMCP client session from a cde-login.

As Ray and Brian agree there is no harm for remote sessions if not calling ck-collect-session-info, I'll go ahead to work out patch like that.

$/usr/lib/ck-collect-session-info --uid 0 --pid 25465
unix-user = 0
x11-display = :0
x11-display-device = /dev/vt/2
display-device =    ?   
is-local = true
$
$/usr/lib/ck-collect-session-info --uid 0 --pid 25875
unix-user = 0
x11-display = ::ffff:127.0.0.1:1
x11-display-device =    ?   
display-device =    ?   
is-local = true
$
$/usr/lib/ck-collect-session-info --uid 0 --pid 25537

** (ck-collect-session-info:25928): WARNING **: 
** (process:25931): WARNING **: Failed to getpeerucred() credentials: Invalid argument


unix-user = 0
x11-display = ::ffff:129.158.217.159:0
display-device =    ?   
is-local = false


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.