Carsten Grzemba
2023-11-28 b85198a0a36716d150bb6009fe31ec436b439361
consolekit: update 0.4.6, patch 01 from freedesktop.org

5 files deleted
7 files modified
1132 ■■■■ changed files
components/library/ConsoleKit/Makefile 17 ●●●● patch | view | raw | blame | history
components/library/ConsoleKit/consolekit.p5m 10 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/manifests/sample-manifest.p5m 18 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/pam-consolekit.p5m 1 ●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/01-ck-dynamic.patch 796 ●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/04-sol-tty.patch 38 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/05-sol-sigpoll.patch 20 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/07-sol-vt-major.patch 48 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/08-can-stop.patch 84 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/11-sol-vtdaemon.patch 80 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/patches/12-cores-srss.patch 16 ●●●●● patch | view | raw | blame | history
components/library/ConsoleKit/pkg5 4 ●●●● patch | view | raw | blame | history
components/library/ConsoleKit/Makefile
@@ -13,18 +13,18 @@
#
BUILD_STYLE=configure
BUILD_BITS=32
BUILD_BITS=64_and_32
include ../../../make-rules/shared-macros.mk
COMPONENT_NAME=         ConsoleKit
COMPONENT_VERSION=      0.4.1
COMPONENT_REVISION=     4
COMPONENT_VERSION=      0.4.6
COMPONENT_REVISION=     0
COMPONENT_PROJECT_URL=  http://www.freedesktop.org/wiki/Software/ConsoleKit
COMPONENT_SUMMARY=      Framework for tracking users, login sessions, and seats
COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.bz2
COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.xz
COMPONENT_ARCHIVE_HASH= \
    sha256:f032adc6146d745034315054c5822a7a09f30e20a40d6e802221fa977354403e
    sha256:b41d17e06f80059589fbeefe96ad07bcc564c49e65516da1caf975146475565c
COMPONENT_ARCHIVE_URL=  http://www.freedesktop.org/software/ConsoleKit/dist/$(COMPONENT_ARCHIVE)
COMPONENT_LICENSE_FILE= COPYING
COMPONENT_LICENSE=      GPLv2
@@ -46,12 +46,13 @@
# Missing files in build dir without this.
COMPONENT_PRE_CONFIGURE_ACTION =        ($(CLONEY) $(SOURCE_DIR) $(@D))
MACHBITS=$(patsubst /i86,,/$(MACH$(BITS)))
CONFIGURE_OPTIONS+=    --sysconfdir=/etc
CONFIGURE_OPTIONS+=    --libexecdir=/usr/lib
CONFIGURE_OPTIONS+=    --libexecdir=/usr/lib$(MACHBITS)
CONFIGURE_OPTIONS+=    --localstatedir=/var
CONFIGURE_OPTIONS+=    --enable-pam-module
CONFIGURE_OPTIONS+=    --with-pam-module-dir=/usr/lib/security
CONFIGURE_OPTIONS+=    --with-pam-module-dir=/usr/lib/security
CONFIGURE_OPTIONS+=    --with-pam-module-dir=/usr/lib/security$(MACHBITS)
CONFIGURE_OPTIONS+=    --enable-rbac-shutdown=solaris.system.shutdown
# Build dependencies
components/library/ConsoleKit/consolekit.p5m
@@ -70,7 +70,17 @@
link path=usr/lib/libck-connector.so target=libck-connector.so.0.0.0
link path=usr/lib/libck-connector.so.0 target=libck-connector.so.0.0.0
file path=usr/lib/libck-connector.so.0.0.0
file path=usr/lib/$(MACH64)/ck-collect-session-info mode=0555
file path=usr/lib/$(MACH64)/ck-get-x11-display-device mode=0555
file path=usr/lib/$(MACH64)/ck-get-x11-server-pid mode=0555
link path=usr/lib/$(MACH64)/libck-connector.so target=libck-connector.so.0.0.0
link path=usr/lib/$(MACH64)/libck-connector.so.0 target=libck-connector.so.0.0.0
file path=usr/lib/$(MACH64)/libck-connector.so.0.0.0
file path=usr/lib/$(MACH64)/pkgconfig/ck-connector.pc
file path=usr/lib/pkgconfig/ck-connector.pc
file path=usr/sbin/ck-log-system-restart
file path=usr/sbin/ck-log-system-start
file path=usr/sbin/ck-log-system-stop
file path=usr/sbin/ck-seat-tool
file path=usr/sbin/console-kit-daemon
file path=usr/share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Manager.xml
components/library/ConsoleKit/manifests/sample-manifest.p5m
@@ -10,7 +10,7 @@
#
#
# Copyright 2022 <contributor>
# Copyright 2023 <contributor>
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -40,10 +40,20 @@
file path=etc/ConsoleKit/sessions.d/MultiDCU3.session
file path=etc/ConsoleKit/sessions.d/Remote.session
file path=etc/dbus-1/system.d/ConsoleKit.conf
file path=usr/bin/$(MACH32)/ck-history
file path=usr/bin/$(MACH32)/ck-launch-session
file path=usr/bin/$(MACH32)/ck-list-sessions
file path=usr/bin/ck-history
file path=usr/bin/ck-launch-session
file path=usr/bin/ck-list-sessions
file path=usr/include/ConsoleKit/ck-connector/ck-connector.h
file path=usr/lib/$(MACH64)/ck-collect-session-info
file path=usr/lib/$(MACH64)/ck-get-x11-display-device
file path=usr/lib/$(MACH64)/ck-get-x11-server-pid
link path=usr/lib/$(MACH64)/libck-connector.so target=libck-connector.so.0.0.0
link path=usr/lib/$(MACH64)/libck-connector.so.0 target=libck-connector.so.0.0.0
file path=usr/lib/$(MACH64)/libck-connector.so.0.0.0
file path=usr/lib/$(MACH64)/pkgconfig/ck-connector.pc
file path=usr/lib/ConsoleKit/scripts/ck-system-hibernate
file path=usr/lib/ConsoleKit/scripts/ck-system-hybridsleep
file path=usr/lib/ConsoleKit/scripts/ck-system-restart
@@ -56,7 +66,13 @@
link path=usr/lib/libck-connector.so.0 target=libck-connector.so.0.0.0
file path=usr/lib/libck-connector.so.0.0.0
file path=usr/lib/pkgconfig/ck-connector.pc
file path=usr/lib/security/$(MACH64)/pam_ck_connector.so
file path=usr/lib/security/pam_ck_connector.so
file path=usr/sbin/$(MACH32)/ck-log-system-restart
file path=usr/sbin/$(MACH32)/ck-log-system-start
file path=usr/sbin/$(MACH32)/ck-log-system-stop
file path=usr/sbin/$(MACH32)/ck-seat-tool
file path=usr/sbin/$(MACH32)/console-kit-daemon
file path=usr/sbin/ck-log-system-restart
file path=usr/sbin/ck-log-system-start
file path=usr/sbin/ck-log-system-stop
components/library/ConsoleKit/pam-consolekit.p5m
@@ -23,3 +23,4 @@
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
file path=usr/lib/security/pam_ck_connector.so
file path=usr/lib/security/$(MACH64)/pam_ck_connector.so
components/library/ConsoleKit/patches/01-ck-dynamic.patch
@@ -806,7 +806,7 @@
index 66f439c..d13a0f8 100644
--- a/src/ck-log-event.c
+++ b/src/ck-log-event.c
@@ -79,6 +79,8 @@ event_seat_session_added_free (CkLogSeatSessionAddedEvent *event)
@@ -79,6 +79,8 @@ event_seat_session_added_free (CkLogSeat
         event->session_id = NULL;
         g_free (event->session_type);
         event->session_type = NULL;
@@ -815,7 +815,7 @@
         g_free (event->session_x11_display);
         event->session_x11_display = NULL;
         g_free (event->session_x11_display_device);
@@ -103,6 +105,8 @@ event_seat_session_removed_free (CkLogSeatSessionRemovedEvent *event)
@@ -103,6 +105,8 @@ event_seat_session_removed_free (CkLogSe
         event->session_id = NULL;
         g_free (event->session_type);
         event->session_type = NULL;
@@ -824,7 +824,7 @@
         g_free (event->session_x11_display);
         event->session_x11_display = NULL;
         g_free (event->session_x11_display_device);
@@ -213,6 +217,7 @@ event_seat_session_added_copy (CkLogSeatSessionAddedEvent *event,
@@ -213,6 +217,7 @@ event_seat_session_added_copy (CkLogSeat
         event_copy->seat_id = g_strdup (event->seat_id);
         event_copy->session_id = g_strdup (event->session_id);
         event_copy->session_type = g_strdup (event->session_type);
@@ -832,7 +832,7 @@
         event_copy->session_x11_display = g_strdup (event->session_x11_display);
         event_copy->session_x11_display_device = g_strdup (event->session_x11_display_device);
         event_copy->session_display_device = g_strdup (event->session_display_device);
@@ -232,6 +237,7 @@ event_seat_session_removed_copy (CkLogSeatSessionRemovedEvent *event,
@@ -232,6 +237,7 @@ event_seat_session_removed_copy (CkLogSe
         event_copy->seat_id = g_strdup (event->seat_id);
         event_copy->session_id = g_strdup (event->session_id);
         event_copy->session_type = g_strdup (event->session_type);
@@ -840,7 +840,7 @@
         event_copy->session_x11_display = g_strdup (event->session_x11_display);
         event_copy->session_x11_display_device = g_strdup (event->session_x11_display_device);
         event_copy->session_display_device = g_strdup (event->session_display_device);
@@ -415,10 +421,11 @@ add_log_for_seat_session_added (GString    *str,
@@ -415,10 +421,11 @@ add_log_for_seat_session_added (GString
 
         e = (CkLogSeatSessionAddedEvent *)event;
         g_string_append_printf (str,
@@ -853,7 +853,7 @@
                                 e->session_x11_display ? e->session_x11_display : "",
                                 e->session_x11_display_device ? e->session_x11_display_device : "",
                                 e->session_display_device ? e->session_display_device : "",
@@ -436,10 +443,11 @@ add_log_for_seat_session_removed (GString    *str,
@@ -436,10 +443,11 @@ add_log_for_seat_session_removed (GStrin
 
         e = (CkLogSeatSessionRemovedEvent *)event;
         g_string_append_printf (str,
@@ -866,46 +866,16 @@
                                 e->session_x11_display ? e->session_x11_display : "",
                                 e->session_x11_display_device ? e->session_x11_display_device : "",
                                 e->session_display_device ? e->session_display_device : "",
@@ -721,7 +729,7 @@ parse_log_for_seat_added (const GString *str,
         error = NULL;
         re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' seat-kind=(?P<sessionid>[0-9]*)", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 goto out;
         }
@@ -781,7 +789,7 @@ parse_log_for_seat_removed (const GString *str,
         error = NULL;
         re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' seat-kind=(?P<sessionid>[0-9]*)", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 goto out;
         }
@@ -887,7 +895,7 @@ parse_log_for_system_start (const GString *str,
         error = NULL;
         re = g_regex_new ("(kernel-release='(?P<release>[^']+)')?[ ]?(boot-arguments='(?P<arguments>.*)')?", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 goto out;
         }
@@ -939,9 +947,9 @@ parse_log_for_seat_session_added (const GString *str,
@@ -939,7 +947,7 @@ parse_log_for_seat_session_added (const
         }
 
         error = NULL;
-        re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' session-id='(?P<sessionid>[a-zA-Z0-9/]+)' session-type='(?P<sessiontype>[a-zA-Z0-9 ]*)' session-x11-display='(?P<sessionx11display>[0-9a-zA-Z.:]*)' session-x11-display-device='(?P<sessionx11displaydevice>[^']*)' session-display-device='(?P<sessiondisplaydevice>[^']*)' session-remote-host-name='(?P<sessionremovehostname>[^']*)' session-is-local=(?P<sessionislocal>[a-zA-Z]*) session-unix-user=(?P<sessionunixuser>[0-9]*) session-creation-time='(?P<sessioncreationtime>[^']*)'", 0, 0, &error);
+        re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' session-id='(?P<sessionid>[a-zA-Z0-9/]+)' session-type='(?P<sessiontype>[a-zA-Z0-9 ]*)' display-type='(?P<displaytype>[a-zA-Z0-9 ]*)' session-x11-display='(?P<sessionx11display>[0-9a-zA-Z.:]*)' session-x11-display-device='(?P<sessionx11displaydevice>[^']*)' session-display-device='(?P<sessiondisplaydevice>[^']*)' session-remote-host-name='(?P<sessionremovehostname>[^']*)' session-is-local=(?P<sessionislocal>[a-zA-Z]*) session-unix-user=(?P<sessionunixuser>[0-9]*) session-creation-time='(?P<sessioncreationtime>[^']*)'", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 g_warning ("%s", error->message);
                 goto out;
         }
@@ -957,6 +965,7 @@ parse_log_for_seat_session_added (const GString *str,
@@ -957,6 +965,7 @@ parse_log_for_seat_session_added (const
         e->seat_id = g_match_info_fetch_named (match_info, "seatid");
         e->session_id = g_match_info_fetch_named (match_info, "sessionid");
         e->session_type = g_match_info_fetch_named (match_info, "sessiontype");
@@ -913,19 +883,16 @@
         e->session_x11_display = g_match_info_fetch_named (match_info, "sessionx11display");
         e->session_x11_display_device = g_match_info_fetch_named (match_info, "sessionx11displaydevice");
         e->session_display_device = g_match_info_fetch_named (match_info, "sessiondisplaydevice");
@@ -1014,9 +1023,9 @@ parse_log_for_seat_session_removed (const GString *str,
@@ -1014,7 +1023,7 @@ parse_log_for_seat_session_removed (cons
         }
 
         error = NULL;
-        re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' session-id='(?P<sessionid>[a-zA-Z0-9/]+)' session-type='(?P<sessiontype>[a-zA-Z0-9 ]*)' session-x11-display='(?P<sessionx11display>[0-9a-zA-Z.:]*)' session-x11-display-device='(?P<sessionx11displaydevice>[^']*)' session-display-device='(?P<sessiondisplaydevice>[^']*)' session-remote-host-name='(?P<sessionremovehostname>[^']*)' session-is-local=(?P<sessionislocal>[a-zA-Z]*) session-unix-user=(?P<sessionunixuser>[0-9]*) session-creation-time='(?P<sessioncreationtime>[^']*)'", 0, 0, &error);
+        re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' session-id='(?P<sessionid>[a-zA-Z0-9/]+)' session-type='(?P<sessiontype>[a-zA-Z0-9 ]*)' display-type='(?P<displaytype>[a-zA-Z0-9 ]*)' session-x11-display='(?P<sessionx11display>[0-9a-zA-Z.:]*)' session-x11-display-device='(?P<sessionx11displaydevice>[^']*)' session-display-device='(?P<sessiondisplaydevice>[^']*)' session-remote-host-name='(?P<sessionremovehostname>[^']*)' session-is-local=(?P<sessionislocal>[a-zA-Z]*) session-unix-user=(?P<sessionunixuser>[0-9]*) session-creation-time='(?P<sessioncreationtime>[^']*)'", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 g_warning ("%s", error->message);
                 goto out;
         }
@@ -1032,6 +1041,7 @@ parse_log_for_seat_session_removed (const GString *str,
@@ -1032,6 +1041,7 @@ parse_log_for_seat_session_removed (cons
         e->seat_id = g_match_info_fetch_named (match_info, "seatid");
         e->session_id = g_match_info_fetch_named (match_info, "sessionid");
         e->session_type = g_match_info_fetch_named (match_info, "sessiontype");
@@ -933,33 +900,6 @@
         e->session_x11_display = g_match_info_fetch_named (match_info, "sessionx11display");
         e->session_x11_display_device = g_match_info_fetch_named (match_info, "sessionx11displaydevice");
         e->session_display_device = g_match_info_fetch_named (match_info, "sessiondisplaydevice");
@@ -1090,7 +1100,7 @@ parse_log_for_seat_active_session_changed (const GString *str,
         error = NULL;
         re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' session-id='(?P<sessionid>[a-zA-Z0-9/]*)'", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 goto out;
         }
@@ -1142,7 +1152,7 @@ parse_log_for_seat_device_added (const GString *str,
         error = NULL;
         re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' device-id='(?P<deviceid>[^']+)' device-type='(?P<devicetype>[^']+)'", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 goto out;
         }
@@ -1195,7 +1205,7 @@ parse_log_for_seat_device_removed (const GString *str,
         error = NULL;
         re = g_regex_new ("seat-id='(?P<seatid>[a-zA-Z0-9/]+)' device-id='(?P<deviceid>[^']+)' device-type='(?P<devicetype>[^']+)'", 0, 0, &error);
         if (re == NULL) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 goto out;
         }
diff --git a/src/ck-log-event.h b/src/ck-log-event.h
index 65571f0..2d4ed4e 100644
--- a/src/ck-log-event.h
@@ -1002,7 +942,7 @@
 } CkLogSeatSessionRemovedEvent;
--- ConsoleKit-0.4.1/src/ck-manager.c.1    2010-09-06 17:41:32.942210394 +0800
+++ ConsoleKit-0.4.1/src/ck-manager.c    2010-09-06 17:41:56.671280731 +0800
@@ -46,9 +46,14 @@
@@ -45,9 +45,14 @@
 #include <secdb.h>
 #endif
 
@@ -1017,7 +957,7 @@
 #include "ck-session-leader.h"
 #include "ck-session.h"
 #include "ck-marshal.h"
@@ -58,12 +63,19 @@
@@ -57,12 +62,19 @@
 
 #define CK_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CK_TYPE_MANAGER, CkManagerPrivate))
 
@@ -1037,7 +977,7 @@
 struct CkManagerPrivate
 {
 #ifdef HAVE_POLKIT
@@ -392,6 +404,7 @@
@@ -391,6 +403,7 @@ log_seat_added_event (CkManager  *manage
         GError            *error;
         char              *sid;
         CkSeatKind         seat_kind;
@@ -1045,7 +985,7 @@
 
         memset (&event, 0, sizeof (CkLogEvent));
 
@@ -401,9 +414,11 @@
@@ -400,9 +413,11 @@ log_seat_added_event (CkManager  *manage
         sid = NULL;
         ck_seat_get_id (seat, &sid, NULL);
         ck_seat_get_kind (seat, &seat_kind, NULL);
@@ -1057,7 +997,7 @@
 
         error = NULL;
         res = ck_event_logger_queue_event (manager->priv->logger, &event, &error);
@@ -413,6 +428,7 @@
@@ -412,6 +427,7 @@ log_seat_added_event (CkManager  *manage
         }
 
         g_free (sid);
@@ -1065,7 +1005,7 @@
 }
 
 static void
@@ -517,6 +533,7 @@
@@ -516,6 +532,7 @@ log_seat_session_added_event (CkManager
         if (session != NULL) {
                 g_object_get (session,
                               "session-type", &event.event.seat_session_added.session_type,
@@ -1073,7 +1013,7 @@
                               "x11-display", &event.event.seat_session_added.session_x11_display,
                               "x11-display-device", &event.event.seat_session_added.session_x11_display_device,
                               "display-device", &event.event.seat_session_added.session_display_device,
@@ -572,6 +589,7 @@
@@ -571,6 +588,7 @@ log_seat_session_removed_event (CkManage
         if (session != NULL) {
                 g_object_get (session,
                               "session-type", &event.event.seat_session_removed.session_type,
@@ -1081,7 +1021,72 @@
                               "x11-display", &event.event.seat_session_removed.session_x11_display,
                               "x11-display-device", &event.event.seat_session_removed.session_x11_display_device,
                               "display-device", &event.event.seat_session_removed.session_display_device,
@@ -1311,15 +1329,21 @@
@@ -844,6 +862,8 @@ ready_cb (PolkitAuthority *authority,
         PolkitAuthorizationResult *ret;
         GError *error;
+        g_debug ("CkManager: Ready.");
+
         error = NULL;
         ret = polkit_authority_check_authorization_finish (authority, res, &error);
         if (error != NULL) {
@@ -974,6 +994,7 @@ session_is_real_user (CkSession *session
         /* filter out GDM user */
         if (username != NULL && strcmp (username, "gdm") == 0) {
+                g_debug ("CkManager: Session is not real user");
                 ret = FALSE;
                 goto out;
         }
@@ -982,6 +1003,7 @@ session_is_real_user (CkSession *session
                 *userp = g_strdup (username);
         }
+        g_debug ("CkManager: Session is real user");
         ret = TRUE;
  out:
@@ -1242,6 +1264,7 @@ on_seat_active_session_changed_full (CkS
 {
         char *ssid = NULL;
+        g_debug ("CkManager: Active session changed.");
         if (session != NULL) {
                 ck_session_get_id (session, &ssid, NULL);
         }
@@ -1261,6 +1284,7 @@ on_seat_session_added_full (CkSeat     *
 {
         char *ssid = NULL;
+        g_debug ("CkManager: Session added.");
         ck_session_get_id (session, &ssid, NULL);
         ck_manager_dump (manager);
@@ -1278,6 +1302,7 @@ on_seat_session_removed_full (CkSeat
 {
         char *ssid = NULL;
+        g_debug ("CkManager: Seat Session removed.");
         ck_session_get_id (session, &ssid, NULL);
         ck_manager_dump (manager);
@@ -1293,6 +1318,7 @@ on_seat_device_added (CkSeat      *seat,
                       GValueArray *device,
                       CkManager   *manager)
 {
+        g_debug ("CkManager: Seat device added.");
         ck_manager_dump (manager);
         log_seat_device_added_event (manager, seat, device);
 }
@@ -1302,6 +1328,7 @@ on_seat_device_removed (CkSeat      *sea
                         GValueArray *device,
                         CkManager   *manager)
 {
+        g_debug ("CkManager: Seat device removed.");
         ck_manager_dump (manager);
         log_seat_device_removed_event (manager, seat, device);
 }
@@ -1329,15 +1356,23 @@ disconnect_seat_signals (CkManager *mana
 }
 
 static CkSeat *
@@ -1101,13 +1106,15 @@
+        } else {
+                sid = generate_seat_id (manager);
+        }
+
+        g_debug ("CkManager: Add new seat '%s'.", sid);
 
-        seat = ck_seat_new (sid, kind);
+        seat = ck_seat_new (sid, kind, type);
 
         /* First we connect our own signals to the seat, followed by
          * the D-Bus signal hookup to make sure we can first dump the
@@ -1344,7 +1368,7 @@
@@ -1362,7 +1397,7 @@ add_new_seat (CkManager *manager,
         ck_seat_run_programs (seat, NULL, NULL, "seat_added");
 
         g_debug ("Emitting seat-added: %s", sid);
@@ -1116,7 +1123,16 @@
 
         log_seat_added_event (manager, seat);
 
@@ -1402,64 +1426,22 @@
@@ -1381,6 +1416,8 @@ remove_seat (CkManager *manager,
         sid = NULL;
         ck_seat_get_id (seat, &sid, NULL);
+        g_debug ("CkManager: Remove seat '%s'", sid);
+
         /* Need to get the original key/value */
         res = g_hash_table_lookup_extended (manager->priv->seats,
                                             sid,
@@ -1420,64 +1457,22 @@ remove_seat (CkManager *manager,
         g_free (sid);
 }
 
@@ -1187,13 +1203,14 @@
         return seat;
 }
 
@@ -1594,36 +1576,49 @@
@@ -1612,36 +1607,52 @@ open_session_for_leader (CkManager
         CkSession   *session;
         CkSeat      *seat;
         const char  *ssid;
+        char        *sid;
         const char  *cookie;
 
+        g_debug ("CkManager: Open session for leader.");
         ssid = ck_session_leader_peek_session_id (leader);
         cookie = ck_session_leader_peek_cookie (leader);
 
@@ -1210,19 +1227,20 @@
-                                     "Unable to create new session");
-                dbus_g_method_return_error (context, error);
-                g_error_free (error);
+                g_debug ("CkManager: Creating new session.");
+                session = ck_session_new_with_parameters (ssid,
+                                                          parameters);
-                return;
+
+                if (session == NULL) {
+                        GError *error;
+                        g_debug ("Unable to create new session");
+                        g_debug ("CkManager: Unable to create new session");
+                        error = g_error_new (CK_MANAGER_ERROR,
+                                             CK_MANAGER_ERROR_GENERAL,
+                                             "Unable to create new session");
+                        dbus_g_method_return_error (context, error);
+                        g_error_free (error);
+
-                return;
+                        return;
+                }
+
@@ -1231,6 +1249,7 @@
+                                     g_object_ref (session));
+
+        } else {
+                g_debug ("CkManager: Using found session.");
+                ck_session_set_parameters (session, parameters);
         }
 
@@ -1252,7 +1271,15 @@
         }
 
         ck_seat_add_session (seat, session, NULL);
@@ -1697,11 +1692,57 @@
@@ -1863,6 +1874,7 @@ generate_session_for_leader (CkManager
 {
         gboolean res;
+        g_debug ("CkManager: Generate session for leader.");
         res = ck_session_leader_collect_parameters (leader,
                                                     context,
                                                     (CkSessionLeaderDoneFunc)collect_parameters_cb,
@@ -1877,11 +1889,57 @@ generate_session_for_leader (CkManager
         }
 }
 
@@ -1277,7 +1304,7 @@
+                                              0, &prop_name,
+                                              G_MAXUINT);
+                if (! res) {
+                        g_debug ("Unable to read parameter name");
+                        g_debug ("CkManager: Unable to read parameter name");
+                        continue;
+                }
+
@@ -1289,7 +1316,7 @@
+                        res = dbus_g_type_struct_get_member (&val_struct, 1, &prop_val);
+
+                        if (! res) {
+                                g_debug ("Unable to read parameter value");
+                                g_debug ("CkManager: Unable to read parameter value");
+                                continue;
+                        }
+
@@ -1314,7 +1341,7 @@
 {
         pid_t           pid;
         uid_t           uid;
@@ -1709,6 +1750,7 @@
@@ -1889,6 +1947,7 @@ create_session_for_sender (CkManager
         char            *cookie;
         char            *ssid;
         CkSessionLeader *leader;
@@ -1322,7 +1349,7 @@
 
         g_debug ("CkManager: create session for sender: %s", sender);
 
@@ -1727,9 +1769,21 @@
@@ -1907,9 +1966,21 @@ create_session_for_sender (CkManager
         }
 
         cookie = generate_session_cookie (manager);
@@ -1337,16 +1364,16 @@
+                /* FIXME: Need to verify that the session belongs to a seat
+                 * managed by the sender
+                 */
+                g_debug ("Managing existing session ssid: %s", ssid);
+                g_debug ("CkManager: Managing existing session ssid: %s", ssid);
+        } else {
+                ssid = generate_session_id (manager);
+                session = NULL;
+                g_debug ("Creating new session ssid: %s", ssid);
+                g_debug ("CkManager: Creating new session ssid: %s", ssid);
+        }
 
         leader = ck_session_leader_new ();
         ck_session_leader_set_uid (leader, uid);
@@ -1967,7 +2021,7 @@
@@ -2148,7 +2219,7 @@ ck_manager_open_session (CkManager
         gboolean ret;
 
         sender = dbus_g_method_get_sender (context);
@@ -1355,7 +1382,7 @@
         g_free (sender);
 
         return ret;
@@ -1982,7 +2036,7 @@
@@ -2163,7 +2234,7 @@ ck_manager_open_session_with_parameters
         gboolean ret;
 
         sender = dbus_g_method_get_sender (context);
@@ -1364,7 +1391,7 @@
         g_free (sender);
 
         return ret;
@@ -1999,10 +2053,12 @@
@@ -2180,10 +2251,12 @@ remove_session_for_cookie (CkManager  *m
         char            *sid;
         gboolean         res;
         gboolean         ret;
@@ -1377,7 +1404,7 @@
 
         g_debug ("Removing session for cookie: %s", cookie);
 
@@ -2029,6 +2085,17 @@
@@ -2210,6 +2283,17 @@ remove_session_for_cookie (CkManager  *m
                 goto out;
         }
 
@@ -1395,7 +1422,7 @@
         /* Must keep a reference to the session in the manager until
          * all events for seats are cleared.  So don't remove
          * or steal the session from the master list until
@@ -2036,31 +2103,32 @@
@@ -2217,31 +2301,33 @@ remove_session_for_cookie (CkManager  *m
          * for seat removals doesn't work.
          */
 
@@ -1419,6 +1446,7 @@
+
+        if (should_remove_session) {
+                /* remove from seat */
+                g_debug ("CkManager: Should remove session");
+                sid = NULL;
+                ck_session_get_seat_id (orig_session, &sid, NULL);
+                if (sid != NULL) {
@@ -1450,7 +1478,7 @@
 
         ck_manager_dump (manager);
 
@@ -2068,11 +2136,13 @@
@@ -2249,11 +2335,13 @@ remove_session_for_cookie (CkManager  *m
 
         ret = TRUE;
  out:
@@ -1468,7 +1496,33 @@
         return ret;
 }
 
@@ -2290,9 +2360,11 @@
@@ -2374,6 +2462,7 @@ remove_leader_for_connection (const char
         g_assert (leader != NULL);
         g_assert (data->service_name != NULL);
+        g_debug ("CkManager: Remove leader for connection");
         name = ck_session_leader_peek_service_name (leader);
         if (strcmp (name, data->service_name) == 0) {
                 remove_session_for_cookie (data->manager, cookie, NULL);
@@ -2391,6 +2480,8 @@ remove_sessions_for_connection (CkManage
         guint            n_removed;
         RemoveLeaderData data;
+        g_debug ("CkManager: Remove sessions for connection");
+
         data.service_name = service_name;
         data.manager = manager;
@@ -2426,6 +2517,8 @@ register_manager (CkManager *manager)
         manager->priv->pol_ctx = polkit_authority_get ();
 #endif
+        g_debug ("CkManager: Registering manager");
+
         error = NULL;
         manager->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
         if (manager->priv->connection == NULL) {
@@ -2471,9 +2564,11 @@ ck_manager_class_init (CkManagerClass *k
                               G_STRUCT_OFFSET (CkManagerClass, seat_added),
                               NULL,
                               NULL,
@@ -1482,7 +1536,7 @@
         signals [SEAT_REMOVED] =
                 g_signal_new ("seat-removed",
                               G_TYPE_FROM_CLASS (object_class),
@@ -2399,6 +2471,43 @@
@@ -2580,6 +2675,43 @@ ck_manager_get_seats (CkManager  *manage
 }
 
 static void
@@ -1526,7 +1580,7 @@
 listify_session_ids (char       *id,
                      CkSession  *session,
                      GPtrArray **array)
@@ -2423,16 +2532,315 @@
@@ -2604,16 +2736,321 @@ ck_manager_get_sessions (CkManager  *man
         return TRUE;
 }
 
@@ -1545,6 +1599,7 @@
+{
+        CkSeat    *seat;
+                
+        g_debug ("CkManager: Add seat '%s'.", *sid);
+        g_return_val_if_fail (CK_IS_MANAGER (manager), FALSE);
+
+        seat = add_new_seat (manager, NULL, CK_SEAT_KIND_DYNAMIC, type);
@@ -1595,6 +1650,7 @@
+        CkSeat     *seat = NULL;
+        CkSeatKind kind;
+
+        g_debug ("CkManager: Remove seat '%s'.", sid);
+        g_return_val_if_fail (CK_IS_MANAGER (manager), FALSE);
+
+        seat = g_hash_table_lookup (manager->priv->seats, sid);
@@ -1660,6 +1716,7 @@
+        CkSession *session;
+        char      *ssid;
+
+        g_debug ("CkManager: Add session");
+        seat = g_hash_table_lookup (manager->priv->seats, sid);
+
+        if (seat == NULL) {
@@ -1730,6 +1787,7 @@
+        char *sid;
+        gboolean is_open;
+
+        g_debug ("CkManager: Remove session.");
+        session = g_hash_table_lookup (manager->priv->sessions, ssid);
+
+        if (session == NULL) {
@@ -1792,6 +1850,7 @@
+        GPtrArray *sessions;
+        int i;
+
+        g_debug ("CkManager: Add session from seat.");
+        ck_seat_get_sessions (seat, &sessions, NULL);
+
+        for (i = 0; i < sessions->len; i++) {
@@ -1817,11 +1876,11 @@
+        char   *orig_sid;
         CkSeat *seat;
 
+        g_debug ("CkManager: Add seat for file.");
         sid = generate_seat_id (manager);
+        orig_sid = g_strdup (sid);
+        seat = ck_seat_new_from_file (&sid, filename);
-        seat = ck_seat_new_from_file (sid, filename);
+
+        if (seat == NULL) {
+                /* returns null if connection to bus fails */
+                g_free (sid);
@@ -1834,16 +1893,17 @@
+                manager->priv->seat_serial--;
+        }
+        g_free (orig_sid);
+
-        seat = ck_seat_new_from_file (sid, filename);
+        add_sessions_from_seat (manager, seat);
+
+        if (seat == NULL) {
+                return;
+        }
 
         connect_seat_signals (manager, seat);
         if (!ck_seat_register (seat)) {
@@ -2451,7 +2859,7 @@
         if (seat == NULL) {
                 return;
@@ -2636,7 +3073,7 @@ add_seat_for_file (CkManager  *manager,
         ck_seat_run_programs (seat, NULL, NULL, "seat_added");
 
         g_debug ("Emitting seat-added: %s", sid);
@@ -1852,7 +1912,7 @@
 
         log_seat_added_event (manager, seat);
 }
@@ -2462,6 +2870,7 @@
@@ -2647,6 +3084,7 @@ load_seats_from_dir (CkManager *manager)
         GDir       *d;
         GError     *error;
         const char *file;
@@ -1860,36 +1920,37 @@
 
         error = NULL;
         d = g_dir_open (CK_SEAT_DIR,
@@ -2473,15 +2882,26 @@
@@ -2658,17 +3096,26 @@ load_seats_from_dir (CkManager *manager)
                 return FALSE;
         }
 
+        g_queue_init (&seat_queue);
         while ((file = g_dir_read_name (d)) != NULL) {
                 char *path;
                 path = g_build_filename (CK_SEAT_DIR, file, NULL);
+                g_queue_push_tail (&seat_queue, path);
+        }
+        g_dir_close (d);
+
                 if (g_str_has_suffix (file, ".seat")) {
                         char *path;
                         path = g_build_filename (CK_SEAT_DIR, file, NULL);
-                        add_seat_for_file (manager, path);
-                        g_free (path);
+                        g_queue_push_tail (&seat_queue, path);
                 }
         }
-
         g_dir_close (d);
+        g_queue_sort (&seat_queue, (GCompareDataFunc) strverscmp, NULL);
+
+        while (!g_queue_is_empty (&seat_queue)) {
+                char *path;
+
+                path = g_queue_pop_head (&seat_queue);
+                add_seat_for_file (manager, path);
+                g_free (path);
+        }
+
                 add_seat_for_file (manager, path);
+
                 g_free (path);
         }
-        g_dir_close (d);
-
         return TRUE;
 }
 
@@ -2517,8 +2937,6 @@
@@ -2704,8 +3151,6 @@ ck_manager_init (CkManager *manager)
                                                         (GDestroyNotify) g_object_unref);
 
         manager->priv->logger = ck_event_logger_new (LOG_FILE);
@@ -1898,7 +1959,7 @@
 }
 
 static void
@@ -2563,6 +2981,8 @@
@@ -2750,7 +3195,48 @@ ck_manager_new (void)
                         g_object_unref (manager_object);
                         return NULL;
                 }
@@ -1907,6 +1968,46 @@
         }
 
         return CK_MANAGER (manager_object);
 }
+
+gboolean
+ck_manager_will_not_respawn (CkManager             *manager,
+                             const char            *ssid,
+                             DBusGMethodInvocation *context)
+{
+        GError *error;
+        CkSeat *seat;
+        CkSession *session;
+        char *sid;
+
+        g_debug ("CkManager: Will not respawn: '%s'.", ssid);
+        session = g_hash_table_lookup (manager->priv->sessions, ssid);
+
+        if (session == NULL) {
+                GError *error;
+
+                error = g_error_new (CK_SEAT_ERROR,
+                                     CK_SEAT_ERROR_GENERAL,
+                                     _("Session '%s' doesn't exist"),
+                                     ssid);
+
+                dbus_g_method_return_error (context, error);
+                g_error_free (error);
+
+                return FALSE;
+        }
+
+        session_set_remove_on_close (session, FALSE, NULL);
+        ck_session_get_seat_id (session, &sid, NULL);
+        seat = g_hash_table_lookup (manager->priv->seats, sid);
+        g_free (sid);
+
+        ck_seat_no_respawn (seat, session, &error);
+
+        dbus_g_method_return (context);
+        return TRUE;
+}
+
diff --git a/src/ck-manager.h b/src/ck-manager.h
index 4bd56e8..4304e71 100644
--- a/src/ck-manager.h
@@ -1921,7 +2022,7 @@
         void          (* seat_removed)             (CkManager  *manager,
                                                     const char *sid);
         void          (* system_idle_hint_changed) (CkManager  *manager,
@@ -96,6 +97,9 @@ gboolean            ck_manager_get_sessions                   (CkManager
@@ -96,6 +97,9 @@ gboolean            ck_manager_get_sessi
 gboolean            ck_manager_get_seats                      (CkManager             *manager,
                                                                GPtrArray            **seats,
                                                                GError               **error);
@@ -1931,7 +2032,7 @@
 gboolean            ck_manager_close_session                  (CkManager             *manager,
                                                                const char            *cookie,
                                                                DBusGMethodInvocation *context);
@@ -128,6 +132,28 @@ gboolean            ck_manager_open_session_with_parameters   (CkManager
@@ -128,6 +132,31 @@ gboolean            ck_manager_open_sess
                                                                const GPtrArray       *parameters,
                                                                DBusGMethodInvocation *context);
 
@@ -1956,6 +2057,9 @@
+gboolean            ck_manager_remove_session                  (CkManager             *manager,
+                                                                const char            *ssid,
+                                                                DBusGMethodInvocation *context);
+gboolean            ck_manager_will_not_respawn               (CkManager             *manager,
+                                                               const char            *cookie,
+                                                               DBusGMethodInvocation *context);
+
 G_END_DECLS
 
@@ -1964,17 +2068,18 @@
index 7f60efc..f8029a6 100644
--- a/src/ck-marshal.list
+++ b/src/ck-marshal.list
@@ -1,3 +1,5 @@
@@ -1,3 +1,6 @@
 VOID:UINT,STRING
 BOOLEAN:POINTER
 VOID:OBJECT,OBJECT
+VOID:STRING,STRING
+VOID:STRING,BOOLEAN,STRING,POINTER,STRING,POINTER
 VOID:OBJECT,OBJECT
+VOID:STRING,STRING,STRING,POINTER,STRING,POINTER
diff --git a/src/ck-seat.c b/src/ck-seat.c
index af7db59..dd2a387 100644
--- a/src/ck-seat.c
+++ b/src/ck-seat.c
@@ -40,21 +40,30 @@
@@ -39,21 +39,30 @@
 #include "ck-seat-glue.h"
 #include "ck-marshal.h"
 
@@ -2005,7 +2110,7 @@
         GHashTable      *sessions;
         GPtrArray       *devices;
 
@@ -63,6 +72,8 @@ struct CkSeatPrivate
@@ -62,6 +71,8 @@ struct CkSeatPrivate
         CkVtMonitor     *vt_monitor;
 
         DBusGConnection *connection;
@@ -2014,15 +2119,18 @@
 };
 
 enum {
@@ -74,6 +85,7 @@ enum {
@@ -73,6 +84,10 @@ enum {
         SESSION_REMOVED_FULL,
         DEVICE_ADDED,
         DEVICE_REMOVED,
+        REMOVE_REQUEST,
+        OPEN_SESSION_REQUEST,
+        CLOSE_SESSION_REQUEST,
+        NO_RESPAWN,
         LAST_SIGNAL
 };
 
@@ -81,6 +93,7 @@ enum {
@@ -80,6 +95,7 @@ enum {
         PROP_0,
         PROP_ID,
         PROP_KIND,
@@ -2030,7 +2138,7 @@
 };
 
 static guint signals [LAST_SIGNAL] = { 0, };
@@ -287,6 +300,7 @@ ck_seat_activate_session (CkSeat                *seat,
@@ -286,6 +302,7 @@ ck_seat_activate_session (CkSeat
 {
         CkSession *session;
         gboolean   ret;
@@ -2038,7 +2146,7 @@
 
         g_return_val_if_fail (CK_IS_SEAT (seat), FALSE);
 
@@ -298,12 +312,390 @@ ck_seat_activate_session (CkSeat                *seat,
@@ -297,12 +314,398 @@ ck_seat_activate_session (CkSeat
                 session = g_hash_table_lookup (seat->priv->sessions, ssid);
         }
 
@@ -2060,11 +2168,12 @@
+                       GHashTable       *substitution_variables)
+{
+        char *match;
+        char *value;
+        char *value = NULL;
+
+        match = g_match_info_fetch (match_info, 1);
+
+        value = g_hash_table_lookup (substitution_variables, match);
+        if (substitution_variables != NULL)
+                value = g_hash_table_lookup (substitution_variables, match);
+
+        if (value != NULL) {
+                g_string_append (result, value);
@@ -2138,6 +2247,7 @@
+        CkSeat      *seat = CK_SEAT (user_data);
+        CkSession   *session = (CkSession *) value;
+
+        g_debug ("CkSeat: Request session");
+        ck_session_set_ever_open (session, FALSE, NULL);
+        ck_session_set_under_request (session, FALSE, NULL);
+        ck_seat_request_open_session (seat, session, NULL);
@@ -2295,6 +2405,8 @@
+static void
+on_seat_manager_disappeared (CkSeat *seat)
+{
+        g_debug ("CkSeat: Seat Manager Disappeared.");
+
+        g_signal_handlers_disconnect_by_func (seat->priv->manager_proxy,
+                                              G_CALLBACK (on_seat_manager_disappeared),
+                                              seat);
@@ -2314,6 +2426,7 @@
+{
+        char *sender_name;
+
+        g_debug ("CkSeat: Seat manage.");
+        sender_name = dbus_g_method_get_sender (context);
+
+        if (seat->priv->manager_proxy != NULL) {
@@ -2369,6 +2482,7 @@
+        const char   *existing_manager_name;
+        char *sender_name;
+
+        g_debug ("CkSeat: Seat unmanage.");
+        if (seat->priv->manager_proxy == NULL) {
+                GError *error;
+
@@ -2413,6 +2527,8 @@
+        g_return_if_fail (CK_IS_SEAT (seat));
+        g_return_if_fail (ck_seat_is_managed (seat));
+
+        g_debug ("CkSeat: Seat request removal.");
+
+        message = dbus_message_new_signal (seat->priv->id,
+                                           "org.freedesktop.ConsoleKit.Seat",
+                                           "RemoveRequest");
@@ -2430,7 +2546,37 @@
 match_session_display_device (const char *key,
                               CkSession  *session,
                               const char *display_device)
@@ -526,6 +918,41 @@ change_active_session (CkSeat    *seat,
@@ -313,6 +716,8 @@ match_session_display_device (const char
         device = NULL;
         ret = FALSE;
+        g_debug ("CkSeat: Session display device.");
+
         if (session == NULL) {
                 goto out;
         }
@@ -485,6 +890,8 @@ change_active_session (CkSeat    *seat,
         char      *ssid;
         CkSession *old_session;
+        g_debug ("CkSeat: Change active session.");
+
         if (seat->priv->active_session == session) {
                 return;
         }
@@ -514,7 +921,10 @@ change_active_session (CkSeat    *seat,
          * must be sent when the database dump is finished it is
          * important that the '-full' signalled is emitted first. */
-        g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED_FULL], 0, old_session, session);
+        if (CK_IS_SESSION (old_session)) {
+                g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED_FULL], 0, old_session, session);
+        }
+
         g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED], 0, ssid);
         if (old_session != NULL) {
@@ -525,6 +935,42 @@ change_active_session (CkSeat    *seat,
 }
 
 static void
@@ -2442,6 +2588,7 @@
+        char          *session_type = NULL;
+        CkSession     *login_session = NULL;
+
+        g_debug ("CkSeat: Find possible session to activate");
+        g_hash_table_iter_init (&iter, seat->priv->sessions);
+        while (g_hash_table_iter_next (&iter, &key, &value)) {
+
@@ -2472,7 +2619,7 @@
 update_active_vt (CkSeat *seat,
                   guint   num)
 {
@@ -537,7 +964,12 @@ update_active_vt (CkSeat *seat,
@@ -536,7 +982,12 @@ update_active_vt (CkSeat *seat,
         g_debug ("Active device: %s", device);
 
         session = find_session_for_display_device (seat, device);
@@ -2486,14 +2633,15 @@
 
         g_free (device);
 }
@@ -547,12 +979,18 @@ maybe_update_active_session (CkSeat *seat)
@@ -546,12 +997,20 @@ maybe_update_active_session (CkSeat *sea
 {
         guint num;
 
-        if (seat->priv->kind != CK_SEAT_KIND_STATIC) {
-                return;
-        }
-
+        g_debug ("CkSeat: Check to see if we should update active session");
-        if (ck_vt_monitor_get_active (seat->priv->vt_monitor, &num, NULL)) {
-                update_active_vt (seat, num);
+        switch (seat->priv->kind){
@@ -2511,7 +2659,24 @@
         }
 }
 
@@ -628,18 +1066,77 @@ ck_seat_remove_session (CkSeat         *seat,
@@ -560,6 +1019,7 @@ session_activate (CkSession
                   DBusGMethodInvocation *context,
                   CkSeat                *seat)
 {
+        g_debug ("CkSeat: Session activate.");
         _seat_activate_session (seat, session, context);
         /* always return TRUE to indicate that the signal was handled */
@@ -583,6 +1043,8 @@ ck_seat_remove_session (CkSeat         *
         ssid = NULL;
         ck_session_get_id (session, &ssid, NULL);
+        g_debug ("CkSeat: Removing session '%s'", ssid);
+
         /* Need to get the original key/value */
         res = g_hash_table_lookup_extended (seat->priv->sessions,
                                             ssid,
@@ -627,18 +1089,118 @@ ck_seat_remove_session (CkSeat         *
         return ret;
 }
 
@@ -2522,6 +2687,8 @@
+        DBusMessage    *message;
+        DBusConnection *connection;
+        DBusMessageIter iter;
+
+        g_debug ("CkSeat: Emit Session Close request");
+
+        message = dbus_message_new_signal (seat->priv->id,
+                                           "org.freedesktop.ConsoleKit.Seat",
@@ -2550,9 +2717,47 @@
+        g_return_val_if_fail (CK_IS_SESSION (session), FALSE);
+        g_return_val_if_fail (ck_seat_is_managed (seat), FALSE);
+
+        g_debug ("CkSeat: Request close session.");
+        ck_session_get_id (session, &ssid, NULL);
+
+        emit_session_close_request (seat, ssid);
+
+        g_free (ssid);
+
+        return FALSE;
+}
+
+gboolean
+ck_seat_no_respawn (CkSeat                *seat,
+                    CkSession             *session,
+                    GError               **error)
+{
+        DBusMessage    *message;
+        DBusConnection *connection;
+        DBusMessageIter iter;
+        char           *ssid;
+
+        g_return_val_if_fail (CK_IS_SEAT (seat), FALSE);
+        g_return_val_if_fail (CK_IS_SESSION (session), FALSE);
+        g_return_val_if_fail (ck_seat_is_managed (seat), FALSE);
+
+        g_debug ("CkSeat: No Respawn.");
+        ck_session_get_id (session, &ssid, NULL);
+
+        message = dbus_message_new_signal (seat->priv->id,
+                                           "org.freedesktop.ConsoleKit.Seat",
+                                           "NoRespawn");
+
+        dbus_message_set_destination (message,
+                                      dbus_g_proxy_get_bus_name (seat->priv->manager_proxy));
+
+        dbus_message_iter_init_append (message, &iter);
+        dbus_message_iter_append_basic (&iter, DBUS_TYPE_OBJECT_PATH, &ssid);
+
+        connection = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
+        dbus_connection_send (connection, message, NULL);
+        dbus_connection_unref (connection);
+        dbus_message_unref (message);
+
+        g_free (ssid);
+
@@ -2571,6 +2776,7 @@
 
         g_return_val_if_fail (CK_IS_SEAT (seat), FALSE);
 
+        g_debug ("CkSeat: Add session.");
         ck_session_get_id (session, &ssid, NULL);
 
-        g_hash_table_insert (seat->priv->sessions, g_strdup (ssid), g_object_ref (session));
@@ -2590,7 +2796,7 @@
 
         ck_session_set_seat_id (session, seat->priv->id, NULL);
 
@@ -656,6 +1153,10 @@ ck_seat_add_session (CkSeat         *seat,
@@ -655,6 +1217,10 @@ ck_seat_add_session (CkSeat         *sea
 
         maybe_update_active_session (seat);
 
@@ -2601,7 +2807,7 @@
         g_free (ssid);
 
         return TRUE;
@@ -742,6 +1243,20 @@ ck_seat_get_kind (CkSeat        *seat,
@@ -741,6 +1307,20 @@ ck_seat_get_kind (CkSeat        *seat,
 }
 
 gboolean
@@ -2622,7 +2828,15 @@
 ck_seat_get_id (CkSeat         *seat,
                 char          **id,
                 GError        **error)
@@ -858,6 +1373,14 @@ _ck_seat_set_kind (CkSeat    *seat,
@@ -772,6 +1352,7 @@ ck_seat_register (CkSeat *seat)
         g_return_val_if_fail (CK_IS_SEAT (seat), FALSE);
         error = NULL;
+        g_debug ("CkSeat: Register seat.");
         seat->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
         if (seat->priv->connection == NULL) {
                 if (error != NULL) {
@@ -859,6 +1440,14 @@ _ck_seat_set_kind (CkSeat    *seat,
 }
 
 static void
@@ -2637,7 +2851,7 @@
 ck_seat_set_property (GObject            *object,
                       guint               prop_id,
                       const GValue       *value,
@@ -874,6 +1397,9 @@ ck_seat_set_property (GObject            *object,
@@ -875,6 +1464,9 @@ ck_seat_set_property (GObject
         case PROP_KIND:
                 _ck_seat_set_kind (self, g_value_get_enum (value));
                 break;
@@ -2647,7 +2861,7 @@
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                 break;
@@ -895,7 +1421,10 @@ ck_seat_get_property (GObject    *object,
@@ -896,7 +1488,10 @@ ck_seat_get_property (GObject    *object
                 g_value_set_string (value, self->priv->id);
                 break;
         case PROP_KIND:
@@ -2659,10 +2873,10 @@
                 break;
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1008,6 +1537,15 @@ ck_seat_class_init (CkSeatClass *klass)
@@ -1008,6 +1603,48 @@ ck_seat_class_init (CkSeatClass *klass)
                                                  g_cclosure_marshal_VOID__BOXED,
                                                  G_TYPE_NONE,
                                                  1, CK_TYPE_DEVICE);
+        signals [REMOVE_REQUEST] = g_signal_new ("remove-request",
+                                                  G_TYPE_FROM_CLASS (object_class),
+                                                  G_SIGNAL_RUN_LAST,
@@ -2671,11 +2885,44 @@
+                                                  NULL,
+                                                  g_cclosure_marshal_VOID__VOID,
+                                                  G_TYPE_NONE, 0);
+
+        signals [OPEN_SESSION_REQUEST] = g_signal_new ("open-session-request",
+                                                 G_TYPE_FROM_CLASS (object_class),
+                                                 G_SIGNAL_RUN_LAST,
+                                                 G_STRUCT_OFFSET (CkSeatClass, open_session_request),
+                                                 NULL,
+                                                 NULL,
+                                                 ck_marshal_VOID__STRING_STRING_STRING_POINTER_STRING_POINTER,
+                                                 G_TYPE_NONE,
+                                                 6,
+                                                 DBUS_TYPE_G_OBJECT_PATH,
+                                                 G_TYPE_STRING,
+                                                 G_TYPE_STRING,
+                                                 CK_DBUS_TYPE_G_STRING_STRING_HASHTABLE,
+                                                 G_TYPE_STRING,
+                                                 CK_DBUS_TYPE_G_STRING_STRING_HASHTABLE,
+                                                 G_TYPE_INVALID);
+        signals [CLOSE_SESSION_REQUEST] = g_signal_new ("close-session-request",
+                                                  G_TYPE_FROM_CLASS (object_class),
+                                                  G_SIGNAL_RUN_LAST,
+                                                  G_STRUCT_OFFSET (CkSeatClass, close_session_request),
+                                                  NULL,
+                                                  NULL,
+                                                  g_cclosure_marshal_VOID__VOID,
+                                                  G_TYPE_NONE,
+                                                  1, DBUS_TYPE_G_OBJECT_PATH);
+        signals [NO_RESPAWN] = g_signal_new ("no-respawn",
+                                                  G_TYPE_FROM_CLASS (object_class),
+                                                  G_SIGNAL_RUN_LAST,
+                                                  G_STRUCT_OFFSET (CkSeatClass, no_respawn),
+                                                  NULL,
+                                                  NULL,
+                                                  g_cclosure_marshal_VOID__VOID,
+                                                  G_TYPE_NONE, 0);
+/* HERE */
         g_object_class_install_property (object_class,
                                          PROP_ID,
                                          g_param_spec_string ("id",
@@ -1024,6 +1562,13 @@ ck_seat_class_init (CkSeatClass *klass)
@@ -1025,6 +1662,13 @@ ck_seat_class_init (CkSeatClass *klass)
                                                             CK_SEAT_KIND_DYNAMIC,
                                                             G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
@@ -2689,7 +2936,7 @@
         g_type_class_add_private (klass, sizeof (CkSeatPrivate));
 
         dbus_g_object_type_install_info (CK_TYPE_SEAT, &dbus_glib_ck_seat_object_info);
@@ -1039,6 +1584,7 @@ ck_seat_init (CkSeat *seat)
@@ -1040,6 +1684,7 @@ ck_seat_init (CkSeat *seat)
                                                       g_free,
                                                       (GDestroyNotify) g_object_unref);
         seat->priv->devices = g_ptr_array_new ();
@@ -2697,7 +2944,7 @@
 }
 
 static void
@@ -1064,28 +1610,32 @@ ck_seat_finalize (GObject *object)
@@ -1065,28 +1710,32 @@ ck_seat_finalize (GObject *object)
         g_ptr_array_free (seat->priv->devices, TRUE);
         g_hash_table_destroy (seat->priv->sessions);
         g_free (seat->priv->id);
@@ -2734,7 +2981,7 @@
 {
         GObject *object;
         int      i;
@@ -1100,24 +1650,57 @@ ck_seat_new_with_devices (const char *sid,
@@ -1101,27 +1750,62 @@ ck_seat_new_with_devices (const char *si
                         ck_seat_add_device (CK_SEAT (object), g_ptr_array_index (devices, i), NULL);
                 }
         }
@@ -2803,7 +3050,12 @@
 
         seat = NULL;
 
@@ -1145,6 +1728,49 @@ ck_seat_new_from_file (const char *sid,
+        g_debug ("CkSeat: New seat from file.");
+
         key_file = g_key_file_new ();
         error = NULL;
         res = g_key_file_load_from_file (key_file,
@@ -1146,9 +1830,52 @@ ck_seat_new_from_file (const char *sid,
                 goto out;
         }
 
@@ -2852,8 +3104,12 @@
+
         device_list = g_key_file_get_string_list (key_file, group, "Devices", &ndevices, NULL);
 
         g_debug ("Creating seat %s with %zd devices", sid, ndevices);
@@ -1176,11 +1802,12 @@ ck_seat_new_from_file (const char *sid,
-        g_debug ("Creating seat %s with %zd devices", sid, ndevices);
+        g_debug ("CkSeat: Creating seat %s with %zd devices", *sid, ndevices);
         devices = g_ptr_array_sized_new (ndevices);
@@ -1177,11 +1904,12 @@ ck_seat_new_from_file (const char *sid,
                 g_strfreev (split);
         }
         g_strfreev (device_list);
@@ -2868,7 +3124,7 @@
 out:
 
         g_key_file_free (key_file);
@@ -1355,10 +1982,15 @@ ck_seat_dump (CkSeat   *seat,
@@ -1356,10 +2084,15 @@ ck_seat_dump (CkSeat   *seat,
 
                 error = NULL;
                 if (! ck_session_get_id (seat->priv->active_session, &session_id, &error)) {
@@ -2888,7 +3144,7 @@
                 } else {
                         g_key_file_set_string (key_file,
                                                group_name,
@@ -1370,3 +2002,24 @@ ck_seat_dump (CkSeat   *seat,
@@ -1371,3 +2104,24 @@ ck_seat_dump (CkSeat   *seat,
 
         g_free (group_name);
 }
@@ -2917,15 +3173,26 @@
index fb9a955..6276021 100644
--- a/src/ck-seat.h
+++ b/src/ck-seat.h
@@ -47,6 +47,7 @@ typedef struct
@@ -47,6 +47,18 @@ typedef struct
 {
         GObjectClass   parent_class;
 
+        void          (* remove_request)         (CkSeat      *seat);
+        void          (* open_session_request)   (CkSeat      *seat,
+                                                  const char  *ssid,
+                                                  const char  *session_type,
+                                                  const char  *display_template_name,
+                                                  GHashTable  *display_variables,
+                                                  const char  *display_type,
+                                                  GHashTable  *parameters);
+        void          (* close_session_request)  (CkSeat      *seat,
+                                                  const char  *ssid);
+        void          (* no_respawn)             (CkSeat      *seat,
+                                                  const char  *ssid);
         void          (* active_session_changed) (CkSeat      *seat,
                                                   const char  *ssid);
         void          (* session_added)          (CkSeat      *seat,
@@ -57,6 +58,11 @@ typedef struct
@@ -57,6 +69,11 @@ typedef struct
                                                   GValueArray *device);
         void          (* device_removed)         (CkSeat      *seat,
                                                   GValueArray *device);
@@ -2937,7 +3204,7 @@
 } CkSeatClass;
 
 typedef enum
@@ -84,12 +90,14 @@ typedef enum
@@ -84,12 +101,14 @@ typedef enum
 GQuark              ck_seat_error_quark         (void);
 GType               ck_seat_get_type            (void);
 CkSeat            * ck_seat_new                 (const char            *sid,
@@ -2957,7 +3224,7 @@
 
 gboolean            ck_seat_register            (CkSeat                *seat);
 
@@ -104,18 +112,31 @@ void                ck_seat_dump                (CkSeat                *seat,
@@ -104,18 +123,31 @@ void                ck_seat_dump
 gboolean            ck_seat_get_kind            (CkSeat                *seat,
                                                  CkSeatKind            *kind,
                                                  GError               **error);
@@ -2989,7 +3256,7 @@
 
 /* exported methods */
 gboolean            ck_seat_get_id                (CkSeat                *seat,
@@ -137,6 +158,10 @@ gboolean            ck_seat_can_activate_sessions (CkSeat                *seat,
@@ -137,6 +169,14 @@ gboolean            ck_seat_can_activate
 gboolean            ck_seat_activate_session      (CkSeat                *seat,
                                                    const char            *ssid,
                                                    DBusGMethodInvocation *context);
@@ -2997,6 +3264,10 @@
+                                                   DBusGMethodInvocation *context);
+gboolean            ck_seat_unmanage              (CkSeat                *seat,
+                                                   DBusGMethodInvocation *context);
+
+gboolean            ck_seat_no_respawn            (CkSeat                *seat,
+                                                   CkSession             *session,
+                                                   GError               **error);
 
 G_END_DECLS
 
@@ -3016,7 +3287,7 @@
index d8db9dd..0354dd5 100644
--- a/src/ck-session.c
+++ b/src/ck-session.c
@@ -41,6 +41,7 @@
@@ -40,6 +40,7 @@
 #include "ck-session-glue.h"
 #include "ck-marshal.h"
 #include "ck-run-programs.h"
@@ -3024,7 +3295,7 @@
 
 #define CK_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CK_TYPE_SESSION, CkSessionPrivate))
 
@@ -58,6 +59,7 @@ struct CkSessionPrivate
@@ -57,6 +58,7 @@ struct CkSessionPrivate
         char            *seat_id;
 
         char            *session_type;
@@ -3032,7 +3303,7 @@
         char            *login_session_id;
         char            *display_device;
         char            *x11_display_device;
@@ -65,8 +67,15 @@ struct CkSessionPrivate
@@ -64,8 +66,15 @@ struct CkSessionPrivate
         char            *remote_host_name;
         guint            uid;
 
@@ -3048,7 +3319,7 @@
 
         GTimeVal         creation_time;
 
@@ -75,6 +84,8 @@ struct CkSessionPrivate
@@ -74,6 +83,8 @@ struct CkSessionPrivate
         gboolean         idle_hint;
         GTimeVal         idle_since_hint;
 
@@ -3057,7 +3328,7 @@
         DBusGConnection *connection;
         DBusGProxy      *bus_proxy;
 };
@@ -92,17 +103,24 @@ enum {
@@ -91,17 +102,24 @@ enum {
         PROP_0,
         PROP_ID,
         PROP_COOKIE,
@@ -3082,15 +3353,17 @@
 };
 
 static guint signals [LAST_SIGNAL] = { 0, };
@@ -128,6 +146,7 @@ static gboolean
@@ -127,7 +145,9 @@ static gboolean
 register_session (CkSession *session)
 {
         GError *error = NULL;
+        GObject *existing_session;
 
+        g_debug ("CkSession: Register session.");
         error = NULL;
         session->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
@@ -144,6 +163,15 @@ register_session (CkSession *session)
         if (session->priv->connection == NULL) {
@@ -143,6 +163,15 @@ register_session (CkSession *session)
                                                               DBUS_PATH_DBUS,
                                                               DBUS_INTERFACE_DBUS);
 
@@ -3106,7 +3379,7 @@
         dbus_g_connection_register_g_object (session->priv->connection, session->priv->id, G_OBJECT (session));
 
         return TRUE;
@@ -302,6 +330,35 @@ ck_session_set_idle_hint (CkSession             *session,
@@ -301,6 +330,40 @@ ck_session_set_idle_hint (CkSession
 }
 
 gboolean
@@ -3119,6 +3392,11 @@
+        if (session->priv->remove_on_close != remove_on_close) {
+                session->priv->remove_on_close = remove_on_close;
+        }
+
+        if (session->priv->remove_on_close == TRUE)
+                g_debug ("CkSession: Setting remove on close to true.");
+        else
+                g_debug ("CkSession: Setting remove on close to false.");
+
+        return TRUE;
+}
@@ -3142,7 +3420,24 @@
 ck_session_get_idle_hint (CkSession *session,
                           gboolean  *idle_hint,
                           GError   **error)
@@ -420,6 +477,68 @@ ck_session_set_is_local (CkSession      *session,
@@ -366,6 +429,7 @@ ck_session_activate (CkSession
 {
         gboolean res;
+        g_debug ("CkSession: Session activate.");
         g_return_val_if_fail (CK_IS_SESSION (session), FALSE);
         res = FALSE;
@@ -396,6 +460,8 @@ ck_session_set_active (CkSession      *s
 {
         g_return_val_if_fail (CK_IS_SESSION (session), FALSE);
+        g_debug ("CkSession: Session set active.");
+
         if (session->priv->active != active) {
                 session->priv->active = active;
                 g_signal_emit (session, signals [ACTIVE_CHANGED], 0, active);
@@ -419,6 +485,68 @@ ck_session_set_is_local (CkSession
 }
 
 gboolean
@@ -3182,7 +3477,7 @@
+        session->priv->under_request = FALSE;
+        g_mutex_unlock (session->priv->mutex_under_request);
+
+        g_debug ("timeout for under request of session %s", session->priv->id);
+        g_debug ("CkSession: timeout for under request of session %s", session->priv->id);
+        return FALSE;
+}
+
@@ -3211,7 +3506,7 @@
 ck_session_get_id (CkSession      *session,
                    char          **id,
                    GError        **error)
@@ -555,6 +674,20 @@ ck_session_get_creation_time (CkSession      *session,
@@ -554,6 +682,20 @@ ck_session_get_creation_time (CkSession
 }
 
 gboolean
@@ -3232,7 +3527,7 @@
 ck_session_get_session_type (CkSession      *session,
                              char          **type,
                              GError        **error)
@@ -569,6 +702,20 @@ ck_session_get_session_type (CkSession      *session,
@@ -568,6 +710,20 @@ ck_session_get_session_type (CkSession
 }
 
 gboolean
@@ -3253,7 +3548,7 @@
 ck_session_is_active (CkSession      *session,
                       gboolean       *active,
                       GError        **error)
@@ -597,6 +744,50 @@ ck_session_is_local (CkSession      *session,
@@ -596,6 +752,50 @@ ck_session_is_local (CkSession      *ses
 }
 
 gboolean
@@ -3304,7 +3599,7 @@
 ck_session_set_id (CkSession      *session,
                    const char     *id,
                    GError        **error)
@@ -609,6 +800,21 @@ ck_session_set_id (CkSession      *session,
@@ -608,6 +808,21 @@ ck_session_set_id (CkSession      *sessi
         return TRUE;
 }
 
@@ -3326,7 +3621,7 @@
 gboolean
 ck_session_set_cookie (CkSession      *session,
                        const char     *cookie,
@@ -725,6 +931,54 @@ ck_session_set_session_type (CkSession      *session,
@@ -724,6 +939,54 @@ ck_session_set_session_type (CkSession
         return TRUE;
 }
 
@@ -3381,7 +3676,7 @@
 static void
 ck_session_set_property (GObject            *object,
                          guint               prop_id,
@@ -742,15 +996,33 @@ ck_session_set_property (GObject            *object,
@@ -741,15 +1004,33 @@ ck_session_set_property (GObject
         case PROP_IS_LOCAL:
                 ck_session_set_is_local (self, g_value_get_boolean (value), NULL);
                 break;
@@ -3415,7 +3710,7 @@
         case PROP_X11_DISPLAY:
                 ck_session_set_x11_display (self, g_value_get_string (value), NULL);
                 break;
@@ -775,6 +1047,9 @@ ck_session_set_property (GObject            *object,
@@ -774,6 +1055,9 @@ ck_session_set_property (GObject
         case PROP_IDLE_HINT:
                 session_set_idle_hint_internal (self, g_value_get_boolean (value));
                 break;
@@ -3425,7 +3720,7 @@
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                 break;
@@ -798,15 +1073,33 @@ ck_session_get_property (GObject    *object,
@@ -797,15 +1081,33 @@ ck_session_get_property (GObject    *obj
         case PROP_IS_LOCAL:
                 g_value_set_boolean (value, self->priv->is_local);
                 break;
@@ -3459,7 +3754,7 @@
         case PROP_X11_DISPLAY:
                 g_value_set_string (value, self->priv->x11_display);
                 break;
@@ -831,6 +1124,9 @@ ck_session_get_property (GObject    *object,
@@ -830,6 +1132,9 @@ ck_session_get_property (GObject    *obj
         case PROP_IDLE_HINT:
                 g_value_set_boolean (value, self->priv->idle_hint);
                 break;
@@ -3469,7 +3764,16 @@
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                 break;
@@ -1000,6 +1296,13 @@ ck_session_class_init (CkSessionClass *klass)
@@ -881,6 +1186,8 @@ session_add_activity_watch (CkSession *s
 static void
 session_remove_activity_watch (CkSession *session)
 {
+        g_debug ("CkSession: Remove activity watch.");
+
         if (session->priv->idle_monitor == NULL) {
                 return;
         }
@@ -999,6 +1306,13 @@ ck_session_class_init (CkSessionClass *k
                                                               "cookie",
                                                               NULL,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
@@ -3483,7 +3787,7 @@
 
         g_object_class_install_property (object_class,
                                          PROP_SESSION_TYPE,
@@ -1009,6 +1312,27 @@ ck_session_class_init (CkSessionClass *klass)
@@ -1008,6 +1322,27 @@ ck_session_class_init (CkSessionClass *k
                                                               NULL,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
         g_object_class_install_property (object_class,
@@ -3511,17 +3815,10 @@
                                          PROP_LOGIN_SESSION_ID,
                                          g_param_spec_string ("login-session-id",
                                                               "login-session-id",
@@ -1064,12 +1388,19 @@ ck_session_class_init (CkSessionClass *klass)
                                                             0,
                                                             G_PARAM_READWRITE));
         g_object_class_install_property (object_class,
-                                         PROP_ACTIVE,
+                                         PROP_IDLE_HINT,
                                          g_param_spec_boolean ("idle-hint",
                                                                NULL,
                                                                NULL,
@@ -1070,6 +1405,14 @@ ck_session_class_init (CkSessionClass *k
                                                                FALSE,
                                                                G_PARAM_READWRITE));
+        g_object_class_install_property (object_class,
+                                         PROP_REMOVE_ON_CLOSE,
+                                         g_param_spec_boolean ("remove-on-close",
@@ -3529,10 +3826,11 @@
+                                                               NULL,
+                                                               FALSE,
+                                                               G_PARAM_READWRITE));
+
         g_type_class_add_private (klass, sizeof (CkSessionPrivate));
 
@@ -1081,8 +1412,16 @@ ck_session_init (CkSession *session)
         dbus_g_object_type_install_info (CK_TYPE_SESSION, &dbus_glib_ck_session_object_info);
@@ -1080,8 +1423,16 @@ ck_session_init (CkSession *session)
 {
         session->priv = CK_SESSION_GET_PRIVATE (session);
 
@@ -3549,15 +3847,15 @@
 }
 
 static void
@@ -1105,6 +1444,7 @@ ck_session_finalize (GObject *object)
@@ -1104,6 +1455,7 @@ ck_session_finalize (GObject *object)
         g_free (session->priv->cookie);
         g_free (session->priv->seat_id);
         g_free (session->priv->session_type);
+        g_free (session->priv->display_type);
         g_free (session->priv->x11_display);
         g_free (session->priv->login_session_id);
         g_free (session->priv->display_device);
         g_free (session->priv->x11_display_device);
@@ -1114,16 +1454,135 @@ ck_session_finalize (GObject *object)
@@ -1114,16 +1466,138 @@ ck_session_finalize (GObject *object)
 }
 
 CkSession *
@@ -3576,6 +3874,7 @@
+        GHashTable *display_variables;
+        char     **type_keys;
+
+        g_debug ("CkSession: New session from file.");
+        key_file = g_key_file_new ();
+        error = NULL;
+        res = g_key_file_load_from_file (key_file,
@@ -3600,7 +3899,7 @@
+        hidden = g_key_file_get_boolean (key_file, group, "Hidden", NULL);
+
+        if (hidden) {
+                g_debug ("Session is hidden");
+                g_debug ("CkSession: Session is hidden");
+                g_free (group);
+                g_key_file_free (key_file);
+                return NULL;
@@ -3676,6 +3975,8 @@
         GObject *object;
         gboolean res;
 
+        g_debug ("CkSession: New Session.");
+
+        display_template = ck_display_template_get_from_name (display_template_string);
+
+        if (display_template == NULL) {
@@ -3695,7 +3996,7 @@
         res = register_session (CK_SESSION (object));
         if (! res) {
                 g_object_unref (object);
@@ -1138,9 +1597,80 @@ ck_session_new (const char *ssid,
@@ -1138,9 +1612,80 @@ ck_session_new (const char *ssid,
                                                           G_TYPE_VALUE, \
                                                           G_TYPE_INVALID))
 
@@ -3725,36 +4026,36 @@
+                                              1, &prop_val,
+                                              G_MAXUINT);
+                if (! res) {
+                        g_debug ("Unable to extract parameter input");
+                        g_debug ("CkSession: Unable to extract parameter input");
+                        goto cont;
+                }
+
+                if (prop_name == NULL) {
+                        g_debug ("Skipping NULL parameter");
+                        g_debug ("CkSession: Skipping NULL parameter");
+                        goto cont;
+                }
+
+                if (strcmp (prop_name, "id") == 0
+                    || strcmp (prop_name, "cookie") == 0) {
+                        g_debug ("Skipping restricted parameter: %s", prop_name);
+                        g_debug ("CkSession: Skipping restricted parameter: %s", prop_name);
+                        goto cont;
+                }
+
+                pspec = g_object_class_find_property (class, prop_name);
+                if (! pspec) {
+                        g_debug ("Skipping unknown parameter: %s", prop_name);
+                        g_debug ("CkSession: Skipping unknown parameter: %s", prop_name);
+                        goto cont;
+                }
+
+                if (!(pspec->flags & G_PARAM_WRITABLE)) {
+                        g_debug ("property '%s' is not writable", pspec->name);
+                        g_debug ("CkSession: property '%s' is not writable", pspec->name);
+                        goto cont;
+                }
+
+                g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+                res = g_value_transform (prop_val, &value);
+                if (! res) {
+                        g_debug ("unable to transform property value for '%s'", pspec->name);
+                        g_debug ("CkSession: unable to transform property value for '%s'", pspec->name);
+                        goto cont;
+                }
+
@@ -3777,7 +4078,16 @@
                                 const GPtrArray *parameters)
 {
         GObject      *object;
@@ -1169,12 +1699,6 @@ ck_session_new_with_parameters (const char      *ssid,
@@ -1152,6 +1697,8 @@ ck_session_new_with_parameters (const ch
         GObjectClass *class;
         GType         object_type;
+        g_debug ("CkSession: New session with parameters");
+
         object_type = CK_TYPE_SESSION;
         class = g_type_class_ref (object_type);
@@ -1169,12 +1716,6 @@ ck_session_new_with_parameters (const ch
         g_value_set_string (&params[n_params].value, ssid);
         n_params++;
 
@@ -3790,7 +4100,7 @@
         if (parameters != NULL) {
                 for (i = 0; i < parameters->len; i++) {
                         gboolean    res;
@@ -1259,7 +1783,7 @@ ck_session_run_programs (CkSession  *session,
@@ -1259,7 +1800,7 @@ ck_session_run_programs (CkSession  *ses
                          const char *action)
 {
         int   n;
@@ -3799,7 +4109,7 @@
 
         n = 0;
 
@@ -1267,6 +1791,9 @@ ck_session_run_programs (CkSession  *session,
@@ -1267,6 +1808,9 @@ ck_session_run_programs (CkSession  *ses
         if (session->priv->session_type != NULL) {
                 extra_env[n++] = g_strdup_printf ("CK_SESSION_TYPE=%s", session->priv->session_type);
         }
@@ -3809,7 +4119,7 @@
         extra_env[n++] = g_strdup_printf ("CK_SESSION_SEAT_ID=%s", session->priv->seat_id);
         extra_env[n++] = g_strdup_printf ("CK_SESSION_USER_UID=%d", session->priv->uid);
         if (session->priv->display_device != NULL && strlen (session->priv->display_device) > 0) {
@@ -1301,6 +1828,10 @@ ck_session_dump (CkSession *session,
@@ -1301,6 +1845,10 @@ ck_session_dump (CkSession *session,
         char *s;
         char *group_name;
 
@@ -3820,7 +4130,7 @@
         group_name = g_strdup_printf ("Session %s", session->priv->id);
         g_key_file_set_integer (key_file, group_name, "uid", session->priv->uid);
         g_key_file_set_string (key_file,
@@ -1313,6 +1844,12 @@ ck_session_dump (CkSession *session,
@@ -1313,6 +1861,12 @@ ck_session_dump (CkSession *session,
                                        "type",
                                        NONULL_STRING (session->priv->session_type));
         }
@@ -3942,17 +4252,6 @@
 gboolean            ck_session_activate               (CkSession             *session,
diff --git a/src/main.c b/src/main.c
index b8f698f..f685026 100644
--- a/src/main.c
+++ b/src/main.c
@@ -283,7 +283,7 @@ main (int    argc,
         res = g_option_context_parse (context, &argc, &argv, &error);
         g_option_context_free (context);
         if (! res) {
-                g_warning (error->message);
+                g_warning ("%s", error->message);
                 g_error_free (error);
                 goto out;
         }
diff --git a/src/org.freedesktop.ConsoleKit.Manager.xml b/src/org.freedesktop.ConsoleKit.Manager.xml
index f903b55..34a6d04 100644
--- a/src/org.freedesktop.ConsoleKit.Manager.xml
@@ -3981,7 +4280,30 @@
     <method name="GetSessions">
       <arg name="sessions" direction="out" type="ao">
         <doc:doc>
@@ -310,12 +327,115 @@
@@ -196,6 +213,22 @@
         </doc:description>
       </doc:doc>
     </method>
+
+    <method name="WillNotRespawn">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+      <arg name="ssid" type="o" direction="in">
+        <doc:doc>
+          <doc:summary>The session id of the session</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This may be used to set Remove On Close for a Session.
+          </doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
     <method name="GetSessionForUnixProcess">
       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
       <arg name="pid" direction="in" type="u">
@@ -310,12 +343,115 @@
       </doc:doc>
     </method>
 
@@ -4126,7 +4448,7 @@
     <signal name="ActiveSessionChanged">
       <arg name="ssid" type="o">
         <doc:doc>
@@ -160,5 +178,61 @@ seat at a time.</doc:para>
@@ -160,5 +178,73 @@ seat at a time.</doc:para>
         </doc:description>
       </doc:doc>
     </signal>
@@ -4176,6 +4498,18 @@
+      <doc:doc>
+        <doc:description>
+          <doc:para>Emitted when a session with given display number need to be removed.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </signal>
+    <signal name="NoRespawn">
+      <arg name="ssid" type="o">
+        <doc:doc>
+          <doc:summary>The session id of the session to not respawn</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Emitted when ck-seat-tool indicates a session is to be removed.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </signal>
@@ -4540,7 +4874,7 @@
index 0000000..0879d0d
--- /dev/null
+++ b/tools/ck-seat-tool.c
@@ -0,0 +1,443 @@
@@ -0,0 +1,449 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2009 Sun Microsystems, Inc.
@@ -4897,6 +5231,12 @@
+        sid = find_seat_id_from_session_id (connection, proxy, ssid, &is_last_session);
+
+        dbus_g_proxy_call_no_reply (proxy,
+                                   "WillNotRespawn",
+                                   DBUS_TYPE_G_OBJECT_PATH, ssid,
+                                   G_TYPE_INVALID,
+                                   G_TYPE_INVALID);
+
+        dbus_g_proxy_call_no_reply (proxy,
+                                   "RemoveSession",
+                                   DBUS_TYPE_G_OBJECT_PATH, ssid,
+                                   G_TYPE_INVALID,
components/library/ConsoleKit/patches/04-sol-tty.patch
File was deleted
components/library/ConsoleKit/patches/05-sol-sigpoll.patch
File was deleted
components/library/ConsoleKit/patches/07-sol-vt-major.patch
File was deleted
components/library/ConsoleKit/patches/08-can-stop.patch
File was deleted
components/library/ConsoleKit/patches/11-sol-vtdaemon.patch
@@ -16,35 +16,6 @@
 src/ck-sysdeps.h         |    1 +
 5 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 6ab05c8..869decd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,6 +49,7 @@ if CK_COMPILE_SOLARIS
 libck_la_SOURCES +=        \
     ck-sysdeps-solaris.c    \
     $(NULL)
+libck_la_LIBADD = -lscf
 endif
 if CK_COMPILE_FREEBSD
 libck_la_SOURCES +=        \
diff --git a/src/ck-sysdeps-freebsd.c b/src/ck-sysdeps-freebsd.c
index a30c380..df2b0f4 100644
--- a/src/ck-sysdeps-freebsd.c
+++ b/src/ck-sysdeps-freebsd.c
@@ -361,6 +361,12 @@ done:
         return ret;
 }
+gboolean
+ck_supports_activatable_consoles (void)
+{
+        return TRUE;
+}
+
 char *
 ck_get_console_device_for_num (guint num)
 {
diff --git a/src/ck-sysdeps-linux.c b/src/ck-sysdeps-linux.c
index 09db310..a95272e 100644
--- a/src/ck-sysdeps-linux.c
@@ -62,57 +33,6 @@
 char *
 ck_get_console_device_for_num (guint num)
 {
diff --git a/src/ck-sysdeps-solaris.c b/src/ck-sysdeps-solaris.c
index 335ab8b..bb37e1e 100644
--- a/src/ck-sysdeps-solaris.c
+++ b/src/ck-sysdeps-solaris.c
@@ -33,6 +33,7 @@
 #ifdef HAVE_SYS_VT_H
 #include <sys/vt.h>
 #endif
+#include <libscf.h>
 #define DEV_ENCODE(M,m) ( \
   ( (M&0xfff) << 8)   |   ( (m&0xfff00) << 12)   |   (m&0xff)   \
@@ -419,6 +420,23 @@ ck_get_max_num_consoles (guint *num)
         return ret;
 }
+gboolean
+ck_supports_activatable_consoles (void)
+{
+        char *state = NULL;
+        gboolean vt_enabled;
+
+        state = smf_get_state ("svc:/system/vtdaemon:default");
+        if (state && g_str_equal (state, SCF_STATE_STRING_ONLINE)) {
+                vt_enabled = TRUE;
+        } else {
+                vt_enabled = FALSE;
+        }
+
+        g_free (state);
+        return vt_enabled;
+}
+
 char *
 ck_get_console_device_for_num (guint num)
 {
diff --git a/src/ck-sysdeps.h b/src/ck-sysdeps.h
index c3f3756..8f22d52 100644
--- a/src/ck-sysdeps.h
+++ b/src/ck-sysdeps.h
@@ -61,6 +61,7 @@ gboolean     ck_fd_is_a_console               (int             fd);
 gboolean     ck_is_root_user                  (void);
 gboolean     ck_get_max_num_consoles          (guint          *num);
+gboolean     ck_supports_activatable_consoles (void);
 char *       ck_get_console_device_for_num    (guint           num);
 gboolean     ck_get_console_num_from_device   (const char     *device,
--
1.5.6.5
--- ConsoleKit-0.4.1/src/ck-seat.c-orig    2011-02-07 22:09:46.085393510 -0600
+++ ConsoleKit-0.4.1/src/ck-seat.c    2011-02-07 22:10:58.766029875 -0600
@@ -1172,6 +1172,10 @@ ck_seat_can_activate_sessions (CkSeat   
components/library/ConsoleKit/patches/12-cores-srss.patch
File was deleted
components/library/ConsoleKit/pkg5
@@ -13,8 +13,8 @@
        "x11/library/libx11"
    ],
    "fmris": [
        "library/security/pam/module/pam-consolekit",
        "library/xdg/consolekit"
        "library/xdg/consolekit",
        "library/security/pam/module/pam-consolekit"
    ],
    "name": "ConsoleKit"
}