From 4b226bd58872e98f1c096ffc058abf64a69f8567 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sun, 14 Jun 2015 15:30:27 +0300 Subject: CkSession fix uid handling Use the ConsoleKitSession uid for everything. This got missed on the port to GDBus. Now the correct uid is written to the CKDB. Fixes: https://github.com/ConsoleKit2/ConsoleKit2/issues/26 --- src/ck-session.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ck-session.c b/src/ck-session.c index f2ed26f..24329a7 100644 --- a/src/ck-session.c +++ b/src/ck-session.c @@ -55,7 +55,6 @@ struct CkSessionPrivate char *seat_id; char *login_session_id; - guint uid; GTimeVal creation_time; @@ -386,7 +385,7 @@ dbus_set_idle_hint (ConsoleKitSession *cksession, } /* only restrict this by UID for now */ - if (session->priv->uid != calling_uid) { + if (console_kit_session_get_unix_user (cksession) != calling_uid) { throw_error (context, CK_SESSION_ERROR_INSUFFICIENT_PERMISSION, _("Only session owner may set idle hint state")); return TRUE; } @@ -1244,7 +1243,7 @@ ck_session_run_programs (CkSession *session, extra_env[n++] = g_strdup_printf ("CK_SESSION_TYPE=%s", console_kit_session_get_session_type (cksession)); } 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); + extra_env[n++] = g_strdup_printf ("CK_SESSION_USER_UID=%d", console_kit_session_get_unix_user (cksession)); if (console_kit_session_get_display_device (cksession) != NULL && strlen (console_kit_session_get_display_device (cksession)) > 0) { extra_env[n++] = g_strdup_printf ("CK_SESSION_DISPLAY_DEVICE=%s", console_kit_session_get_display_device (cksession)); } @@ -1283,7 +1282,7 @@ ck_session_dump (CkSession *session, cksession = CONSOLE_KIT_SESSION (session); 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_integer (key_file, group_name, "uid", console_kit_session_get_unix_user (cksession)); g_key_file_set_string (key_file, group_name, "seat", -- cgit v1.2.3