diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2017-07-24 17:45:16 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2017-07-24 17:47:48 +0300 |
commit | db55559b4b683ac6bc9618a57cc16b0e311ffc3d (patch) | |
tree | 58613adb7c514f6bd9beacd047cb5b67af479675 | |
parent | 3a5d440397ab095e1e78509c0f725b79d5773076 (diff) | |
download | ConsoleKit2-db55559b4b683ac6bc9618a57cc16b0e311ffc3d.tar.gz |
fix: Seat property on Session interface
return 'Seat1', '/org/freedesktop/ConsoleKit/Seat1' instead of the
object path twice.
-rw-r--r-- | src/ck-session.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ck-session.c b/src/ck-session.c index 7b05428..8a35044 100644 --- a/src/ck-session.c +++ b/src/ck-session.c @@ -1247,6 +1247,7 @@ ck_session_set_seat_id (CkSession *session, GError **error) { GVariant *seat = NULL; + gchar **seat_split; g_return_val_if_fail (CK_IS_SESSION (session), FALSE); @@ -1254,7 +1255,16 @@ ck_session_set_seat_id (CkSession *session, session->priv->seat_id = g_strdup (id); if (id != NULL) { - seat = g_variant_new ("(so)", id, id); + /* we need to remove the prefix from the first seat_id returned */ + seat_split = g_strsplit (id, "/org/freedesktop/ConsoleKit/", 2); + + if (seat_split[0] == NULL) { + g_critical ("id %s is invalid or g_strsplit has changed", id); + return FALSE; + } + + seat = g_variant_new ("(so)", seat_split[1], id); + g_strfreev (seat_split); } console_kit_session_set_seat (CONSOLE_KIT_SESSION (session), seat); |