-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsoleKit2-fix-is-local.diff
41 lines (38 loc) · 1.85 KB
/
ConsoleKit2-fix-is-local.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/src/ck-manager.c b/src/ck-manager.c
index c8a244e..3a555b8 100644
--- a/src/ck-manager.c
+++ b/src/ck-manager.c
@@ -2899,7 +2899,8 @@ verify_and_open_session_for_leader (CkManager *manager,
GVariant *parameters,
GDBusMethodInvocation *context)
{
- gboolean is_local = FALSE;
+ gboolean is_local = -1;
+ gboolean is_session_id_local = -1;
GVariantIter *iter;
gchar *prop_name;
GVariant *value;
@@ -2911,18 +2912,23 @@ verify_and_open_session_for_leader (CkManager *manager,
g_debug ("CkManager: verifying session for leader");
g_variant_get ((GVariant *)parameters, "a{sv}", &iter);
- while (!is_local && g_variant_iter_next (iter, "{sv}", &prop_name, &value)) {
+ while (g_variant_iter_next (iter, "{sv}", &prop_name, &value)) {
if (g_strcmp0 (prop_name, "is-local") == 0) {
- is_local = TRUE;
+ is_local = g_variant_get_boolean (value);
}
if (g_strcmp0 (prop_name, "login-session-id") == 0) {
- is_local = _verify_login_session_id_is_local (manager, g_variant_get_string (value, 0));
+ is_session_id_local = _verify_login_session_id_is_local (manager, g_variant_get_string (value, 0));
}
g_free (prop_name);
g_variant_unref (value);
}
g_variant_iter_free (iter);
+ if (is_local == -1 && is_session_id_local == TRUE)
+ is_local = TRUE;
+ else if (is_local == -1)
+ is_local = FALSE;
+
g_debug ("CkManager: found is-local=%s", is_local ? "true" : "false");
open_session_for_leader (manager,