diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2015-06-14 15:30:27 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2015-06-14 19:55:26 +0300 |
commit | 4b226bd58872e98f1c096ffc058abf64a69f8567 (patch) | |
tree | 80882a5ac42a9507e7f3a23c6a64ecb10a459602 | |
parent | 8171428718628337ac27efcd25e83e8b90073f5a (diff) | |
download | ConsoleKit2-4b226bd58872e98f1c096ffc058abf64a69f8567.tar.gz |
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
-rw-r--r-- | src/ck-session.c | 7 |
1 files 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", |