Public bug reported:

Binary package hint: consolekit

Using consolekit 0.3.1-0ubuntu2 in Karmic.

If I login to a text console, a ConsoleKit session is created for that 
terminal.  If I then run 'startx' (if I'm not running GDM, or 'startx :1' if I 
am running GDM), I do not have my normal permissions, because my session is not 
marked 'active', because my session has not been populated with the appropriate 
X device information.  Running 'ck-list-sessions' from within X shows:
Session1:
        unix-user = '1000'
        realname = 'Paul Donohue'
        seat = 'Seat1'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = '/dev/tty2'
        remote-host-name = ''
        is-local = TRUE
        on-since = '2009-11-14T22:10:24.941984Z'
        login-session-id = '4294967295'
        idle-since-hint = '2009-11-14T22:10:55.016849Z'

I expect to have the same permissions whether I login via GDM, or login
via a text console, then run 'startx'.

I believe the simplest solution is to replace the current
/etc/X11/Xsession.d/90consolekit with something like the following:

CK_GET_X11_DISPLAY_DEVICE=/usr/lib/ConsoleKit/ck-get-x11-display-device
CK_LIST_SESSIONS=/usr/bin/ck-list-sessions
CK_LAUNCH_SESSION=/usr/bin/ck-launch-session

if [ -x "$CK_GET_X11_DISPLAY_DEVICE" -a -x "$CK_LIST_SESSIONS" -a -x 
"$CK_LAUNCH_SESSION" ] ; then
    if [ "$($CK_LIST_SESSIONS | grep "$($CK_GET_X11_DISPLAY_DEVICE)")" == "" ] 
; then
        STARTUP="$CK_LAUNCH_SESSION $STARTUP"
    fi
fi

This script checks for an existing CK session that is populated with an
appropriate x11-display-device, and if one is not present, it creates a
new session.  This will prevent a duplicate CK session from being
created when logging in via GDM (which already creates an appropriately
populated CK session), but allows an additional CK session to be created
when 'startx' is run from a text console (with a CK session that is not
appropriately populated).

Using this script, I get my expected permissions, and 'ck-list-sessions' shows:
Session1:
        unix-user = '1000'
        realname = 'Paul Donohue'
        seat = 'Seat1'
        session-type = ''
        active = FALSE
        x11-display = ''
        x11-display-device = ''
        display-device = '/dev/tty2'
        remote-host-name = ''
        is-local = TRUE
        on-since = '2009-11-14T22:10:24.941984Z'
        login-session-id = '4294967295'
        idle-since-hint = '2009-11-14T22:10:55.016849Z'
Session2:
        unix-user = '1000'
        realname = 'Paul Donohue'
        seat = 'Seat1'
        session-type = ''
        active = TRUE
        x11-display = ':1'
        x11-display-device = '/dev/tty8'
        display-device = '/dev/tty2'
        remote-host-name = ''
        is-local = TRUE
        on-since = '2009-11-14T22:10:32.525471Z'
        login-session-id = '4294967295'

Another (less trivial) solution would be to patch ck-launch-session to
allow updating the existing session with the appropriate X display
information, then always run ck-launch-session from 90consolekit to
perform this update.  (See Bug #319396)

** Affects: consolekit (Ubuntu)
     Importance: Undecided
         Status: New

-- 
If 'startx' is run from within a text console, ConsoleKit session is not marked 
'active'
https://bugs.launchpad.net/bugs/483130
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to