summaryrefslogtreecommitdiff
path: root/tools/list-sessions.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/list-sessions.c')
-rw-r--r--tools/list-sessions.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/tools/list-sessions.c b/tools/list-sessions.c
index 746c2f7..0a026c8 100644
--- a/tools/list-sessions.c
+++ b/tools/list-sessions.c
@@ -47,9 +47,9 @@
#define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session"
static gboolean
-get_int (DBusGProxy *proxy,
- const char *method,
- int *val)
+get_uint (DBusGProxy *proxy,
+ const char *method,
+ guint *val)
{
GError *error;
gboolean res;
@@ -59,7 +59,7 @@ get_int (DBusGProxy *proxy,
method,
&error,
G_TYPE_INVALID,
- G_TYPE_INT, val,
+ G_TYPE_UINT, val,
G_TYPE_INVALID);
if (! res) {
g_warning ("%s failed: %s", method, error->message);
@@ -160,9 +160,10 @@ list_session (DBusGConnection *connection,
const char *ssid)
{
DBusGProxy *proxy;
- int uid;
+ guint uid;
char *realname;
char *sid;
+ char *lsid;
char *session_type;
char *x11_display;
char *x11_display_device;
@@ -184,6 +185,7 @@ list_session (DBusGConnection *connection,
}
sid = NULL;
+ lsid = NULL;
session_type = NULL;
x11_display = NULL;
x11_display_device = NULL;
@@ -192,8 +194,9 @@ list_session (DBusGConnection *connection,
creation_time = NULL;
idle_since_hint = NULL;
- get_int (proxy, "GetUnixUser", &uid);
+ get_uint (proxy, "GetUnixUser", &uid);
get_path (proxy, "GetSeatId", &sid);
+ get_string (proxy, "GetLoginSessionId", &lsid);
get_string (proxy, "GetSessionType", &session_type);
get_string (proxy, "GetX11Display", &x11_display);
get_string (proxy, "GetX11DisplayDevice", &x11_display_device);
@@ -216,7 +219,7 @@ list_session (DBusGConnection *connection,
short_ssid = ssid + strlen (CK_PATH) + 1;
}
- printf ("%s:\n\tuid = '%d'\n\trealname = '%s'\n\tseat = '%s'\n\tsession-type = '%s'\n\tactive = %s\n\tx11-display = '%s'\n\tx11-display-device = '%s'\n\tdisplay-device = '%s'\n\tremote-host-name = '%s'\n\tis-local = %s\n\ton-since = '%s'",
+ printf ("%s:\n\tunix-user = '%d'\n\trealname = '%s'\n\tseat = '%s'\n\tsession-type = '%s'\n\tactive = %s\n\tx11-display = '%s'\n\tx11-display-device = '%s'\n\tdisplay-device = '%s'\n\tremote-host-name = '%s'\n\tis-local = %s\n\ton-since = '%s'\n\tlogin-session-id = '%s'",
short_ssid,
uid,
realname,
@@ -228,7 +231,8 @@ list_session (DBusGConnection *connection,
display_device,
remote_host_name,
is_local ? "TRUE" : "FALSE",
- creation_time);
+ creation_time,
+ lsid);
if (idle_since_hint != NULL && idle_since_hint[0] != '\0') {
printf ("\n\tidle-since-hint = '%s'", idle_since_hint);
}
@@ -239,6 +243,7 @@ list_session (DBusGConnection *connection,
g_free (remote_host_name);
g_free (realname);
g_free (sid);
+ g_free (lsid);
g_free (session_type);
g_free (x11_display);
g_free (x11_display_device);