Merge lp:~robert-ancell/lightdm/no-console-kit into lp:lightdm
- no-console-kit
- Merge into trunk
Proposed by
Robert Ancell
Status: | Merged |
---|---|
Merged at revision: | 2096 |
Proposed branch: | lp:~robert-ancell/lightdm/no-console-kit |
Merge into: | lp:lightdm |
Diff against target: |
1735 lines (+42/-1118) 34 files modified
debian/control (+6/-5) liblightdm-gobject/power.c (+10/-63) liblightdm-qt/power.cpp (+8/-32) src/Makefile.am (+0/-2) src/console-kit.c (+0/-262) src/console-kit.h (+0/-31) src/seat.c (+1/-2) src/session-child.c (+3/-46) src/session.c (+6/-34) src/session.h (+0/-2) tests/Makefile.am (+0/-15) tests/scripts/console-kit.conf (+0/-33) tests/scripts/lock-seat-console-kit.conf (+0/-62) tests/scripts/lock-seat-return-session-console-kit.conf (+0/-78) tests/scripts/no-console-kit-or-login1.conf (+0/-33) tests/scripts/no-console-kit.conf (+0/-33) tests/scripts/no-login1.conf (+1/-2) tests/scripts/power-no-console-kit.conf (+0/-67) tests/scripts/power-no-login1.conf (+4/-15) tests/scripts/power-no-services.conf (+0/-1) tests/src/test-gobject-greeter.c (+1/-4) tests/src/test-python-greeter (+0/-3) tests/src/test-qt-greeter.cpp (+1/-4) tests/src/test-runner.c (+0/-267) tests/src/test-session.c (+1/-4) tests/test-console-kit (+0/-2) tests/test-lock-seat-console-kit (+0/-2) tests/test-lock-seat-return-session-console-kit (+0/-2) tests/test-no-console-kit (+0/-2) tests/test-no-console-kit-or-login1 (+0/-2) tests/test-power-no-console-kit-gobject (+0/-2) tests/test-power-no-console-kit-python (+0/-2) tests/test-power-no-console-kit-qt4 (+0/-2) tests/test-power-no-console-kit-qt5 (+0/-2) |
To merge this branch: | bzr merge lp:~robert-ancell/lightdm/no-console-kit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
LightDM Development Team | Pending | ||
Review via email: mp+236643@code.launchpad.net |
Commit message
Remove ConsoleKit support since upstream is long dead. Please migrate to logind or use LightDM 1.10 if ConsoleKit support is required.
Description of the change
To post a comment you must log in.
- 2075. By Robert Ancell
-
Merge with trunk
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' |
2 | --- debian/control 2014-05-17 18:37:53 +0000 |
3 | +++ debian/control 2014-10-02 07:55:11 +0000 |
4 | @@ -47,11 +47,12 @@ |
5 | liblightdm-qt-0-0, |
6 | Provides: x-display-manager |
7 | Description: Display Manager |
8 | - LightDM is a X display manager that: |
9 | - * Has a lightweight codebase |
10 | - * Is standards compliant (PAM, ConsoleKit, etc) |
11 | - * Has a well defined interface between the server and user interface |
12 | - * Cross-desktop (greeters can be written in any toolkit) |
13 | + LightDM is a display manager that: |
14 | + * Is cross-desktop - supports different desktops |
15 | + * Supports different display technologies |
16 | + * Is lightweight - low memory usage and fast performance |
17 | + * Has a comprehensive test suite |
18 | + * Has low code complexity |
19 | |
20 | Package: liblightdm-gobject-1-0 |
21 | Architecture: any |
22 | |
23 | === modified file 'liblightdm-gobject/power.c' |
24 | --- liblightdm-gobject/power.c 2014-09-19 03:16:14 +0000 |
25 | +++ liblightdm-gobject/power.c 2014-10-02 07:55:11 +0000 |
26 | @@ -16,7 +16,6 @@ |
27 | #include "lightdm/power.h" |
28 | |
29 | static GDBusProxy *upower_proxy = NULL; |
30 | -static GDBusProxy *ck_proxy = NULL; |
31 | static GDBusProxy *login1_proxy = NULL; |
32 | |
33 | static GVariant * |
34 | @@ -205,36 +204,6 @@ |
35 | return hibernated; |
36 | } |
37 | |
38 | -static GVariant * |
39 | -ck_call_function (const gchar *function, GError **error) |
40 | -{ |
41 | - GVariant *r; |
42 | - |
43 | - if (!ck_proxy) |
44 | - { |
45 | - ck_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, |
46 | - G_DBUS_PROXY_FLAGS_NONE, |
47 | - NULL, |
48 | - "org.freedesktop.ConsoleKit", |
49 | - "/org/freedesktop/ConsoleKit/Manager", |
50 | - "org.freedesktop.ConsoleKit.Manager", |
51 | - NULL, |
52 | - error); |
53 | - if (!ck_proxy) |
54 | - return FALSE; |
55 | - } |
56 | - |
57 | - r = g_dbus_proxy_call_sync (ck_proxy, |
58 | - function, |
59 | - NULL, |
60 | - G_DBUS_CALL_FLAGS_NONE, |
61 | - -1, |
62 | - NULL, |
63 | - error); |
64 | - |
65 | - return r; |
66 | -} |
67 | - |
68 | /** |
69 | * lightdm_get_can_restart: |
70 | * |
71 | @@ -257,15 +226,8 @@ |
72 | g_variant_get (r, "(&s)", &result); |
73 | can_restart = g_strcmp0 (result, "yes") == 0; |
74 | } |
75 | - } |
76 | - else |
77 | - { |
78 | - r = ck_call_function ("CanRestart", NULL); |
79 | - if (r && g_variant_is_of_type (r, G_VARIANT_TYPE ("(b)"))) |
80 | - g_variant_get (r, "(b)", &can_restart); |
81 | - } |
82 | - if (r) |
83 | g_variant_unref (r); |
84 | + } |
85 | |
86 | return can_restart; |
87 | } |
88 | @@ -282,19 +244,15 @@ |
89 | lightdm_restart (GError **error) |
90 | { |
91 | GVariant *r; |
92 | - gboolean restarted; |
93 | |
94 | r = login1_call_function ("Reboot", g_variant_new("(b)", FALSE), error); |
95 | - if (!r) |
96 | + if (r) |
97 | { |
98 | - g_clear_error (error); |
99 | - r = ck_call_function ("Restart", error); |
100 | + g_variant_unref (r); |
101 | + return TRUE; |
102 | } |
103 | - restarted = r != NULL; |
104 | - if (r) |
105 | - g_variant_unref (r); |
106 | |
107 | - return restarted; |
108 | + return FALSE; |
109 | } |
110 | |
111 | /** |
112 | @@ -319,15 +277,8 @@ |
113 | g_variant_get (r, "(&s)", &result); |
114 | can_shutdown = g_strcmp0 (result, "yes") == 0; |
115 | } |
116 | - } |
117 | - else |
118 | - { |
119 | - r = ck_call_function ("CanStop", NULL); |
120 | - if (r && g_variant_is_of_type (r, G_VARIANT_TYPE ("(b)"))) |
121 | - g_variant_get (r, "(b)", &can_shutdown); |
122 | - } |
123 | - if (r) |
124 | g_variant_unref (r); |
125 | + } |
126 | |
127 | return can_shutdown; |
128 | } |
129 | @@ -344,17 +295,13 @@ |
130 | lightdm_shutdown (GError **error) |
131 | { |
132 | GVariant *r; |
133 | - gboolean shutdown; |
134 | |
135 | r = login1_call_function ("PowerOff", g_variant_new("(b)", FALSE), error); |
136 | - if (!r) |
137 | + if (r) |
138 | { |
139 | - g_clear_error (error); |
140 | - r = ck_call_function ("Stop", error); |
141 | + g_variant_unref (r); |
142 | + return TRUE; |
143 | } |
144 | - shutdown = r != NULL; |
145 | - if (r) |
146 | - g_variant_unref (r); |
147 | |
148 | - return shutdown; |
149 | + return FALSE; |
150 | } |
151 | |
152 | === modified file 'liblightdm-qt/power.cpp' |
153 | --- liblightdm-qt/power.cpp 2014-09-19 03:16:14 +0000 |
154 | +++ liblightdm-qt/power.cpp 2014-10-02 07:55:11 +0000 |
155 | @@ -26,13 +26,11 @@ |
156 | public: |
157 | PowerInterfacePrivate(); |
158 | QScopedPointer<QDBusInterface> powerManagementInterface; |
159 | - QScopedPointer<QDBusInterface> consoleKitInterface; |
160 | QScopedPointer<QDBusInterface> login1Interface; |
161 | }; |
162 | |
163 | PowerInterface::PowerInterfacePrivate::PowerInterfacePrivate() : |
164 | powerManagementInterface(new QDBusInterface("org.freedesktop.UPower","/org/freedesktop/UPower", "org.freedesktop.UPower", QDBusConnection::systemBus())), |
165 | - consoleKitInterface(new QDBusInterface("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager", QDBusConnection::systemBus())), |
166 | login1Interface(new QDBusInterface("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", QDBusConnection::systemBus())) |
167 | { |
168 | } |
169 | @@ -117,17 +115,9 @@ |
170 | |
171 | bool PowerInterface::canShutdown() |
172 | { |
173 | - if (d->login1Interface->isValid()) { |
174 | - QDBusReply<QString> reply1 = d->login1Interface->call("CanPowerOff"); |
175 | - if (reply1.isValid()) { |
176 | - return reply1.value() == "yes"; |
177 | - } |
178 | - } |
179 | - qWarning() << d->login1Interface->lastError(); |
180 | - |
181 | - QDBusReply<bool> reply = d->consoleKitInterface->call("CanStop"); |
182 | - if (reply.isValid()) { |
183 | - return reply.value(); |
184 | + QDBusReply<QString> reply1 = d->login1Interface->call("CanPowerOff"); |
185 | + if (reply1.isValid()) { |
186 | + return reply1.value() == "yes"; |
187 | } |
188 | |
189 | return false; |
190 | @@ -136,26 +126,15 @@ |
191 | bool PowerInterface::shutdown() |
192 | { |
193 | QDBusReply<void> reply; |
194 | - if (d->login1Interface->isValid()) |
195 | - reply = d->login1Interface->call("PowerOff", false); |
196 | - else |
197 | - reply = d->consoleKitInterface->call("Stop"); |
198 | + reply = d->login1Interface->call("PowerOff", false); |
199 | return reply.isValid(); |
200 | } |
201 | |
202 | bool PowerInterface::canRestart() |
203 | { |
204 | - if (d->login1Interface->isValid()) { |
205 | - QDBusReply<QString> reply1 = d->login1Interface->call("CanReboot"); |
206 | - if (reply1.isValid()) { |
207 | - return reply1.value() == "yes"; |
208 | - } |
209 | - } |
210 | - qWarning() << d->login1Interface->lastError(); |
211 | - |
212 | - QDBusReply<bool> reply = d->consoleKitInterface->call("CanRestart"); |
213 | - if (reply.isValid()) { |
214 | - return reply.value(); |
215 | + QDBusReply<QString> reply1 = d->login1Interface->call("CanReboot"); |
216 | + if (reply1.isValid()) { |
217 | + return reply1.value() == "yes"; |
218 | } |
219 | |
220 | return false; |
221 | @@ -164,10 +143,7 @@ |
222 | bool PowerInterface::restart() |
223 | { |
224 | QDBusReply<void> reply; |
225 | - if (d->login1Interface->isValid()) |
226 | - reply = d->login1Interface->call("Reboot", false); |
227 | - else |
228 | - reply = d->consoleKitInterface->call("Restart"); |
229 | + reply = d->login1Interface->call("Reboot", false); |
230 | return reply.isValid(); |
231 | } |
232 | |
233 | |
234 | === modified file 'src/Makefile.am' |
235 | --- src/Makefile.am 2014-08-21 21:36:03 +0000 |
236 | +++ src/Makefile.am 2014-10-02 07:55:11 +0000 |
237 | @@ -4,8 +4,6 @@ |
238 | lightdm_SOURCES = \ |
239 | accounts.c \ |
240 | accounts.h \ |
241 | - console-kit.c \ |
242 | - console-kit.h \ |
243 | display-manager.c \ |
244 | display-manager.h \ |
245 | display-server.c \ |
246 | |
247 | === removed file 'src/console-kit.c' |
248 | --- src/console-kit.c 2014-03-17 16:02:32 +0000 |
249 | +++ src/console-kit.c 1970-01-01 00:00:00 +0000 |
250 | @@ -1,262 +0,0 @@ |
251 | -/* -*- Mode: C; indent-tabs-mode: nil; tab-width: 4 -*- |
252 | - * |
253 | - * Copyright (C) 2010-2011 Robert Ancell. |
254 | - * Author: Robert Ancell <robert.ancell@canonical.com> |
255 | - * |
256 | - * This program is free software: you can redistribute it and/or modify it under |
257 | - * the terms of the GNU General Public License as published by the Free Software |
258 | - * Foundation, either version 3 of the License, or (at your option) any later |
259 | - * version. See http://www.gnu.org/copyleft/gpl.html the full text of the |
260 | - * license. |
261 | - */ |
262 | - |
263 | -#include <gio/gio.h> |
264 | - |
265 | -#include "console-kit.h" |
266 | - |
267 | -gchar * |
268 | -ck_open_session (GVariantBuilder *parameters) |
269 | -{ |
270 | - GDBusConnection *bus; |
271 | - GVariant *result; |
272 | - gchar *cookie; |
273 | - GError *error = NULL; |
274 | - |
275 | - g_return_val_if_fail (parameters != NULL, NULL); |
276 | - |
277 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
278 | - if (error) |
279 | - g_warning ("Failed to get system bus: %s", error->message); |
280 | - g_clear_error (&error); |
281 | - if (!bus) |
282 | - return NULL; |
283 | - result = g_dbus_connection_call_sync (bus, |
284 | - "org.freedesktop.ConsoleKit", |
285 | - "/org/freedesktop/ConsoleKit/Manager", |
286 | - "org.freedesktop.ConsoleKit.Manager", |
287 | - "OpenSessionWithParameters", |
288 | - g_variant_new ("(a(sv))", parameters), |
289 | - G_VARIANT_TYPE ("(s)"), |
290 | - G_DBUS_CALL_FLAGS_NONE, |
291 | - -1, |
292 | - NULL, |
293 | - &error); |
294 | - g_object_unref (bus); |
295 | - |
296 | - if (error) |
297 | - g_warning ("Failed to open CK session: %s", error->message); |
298 | - g_clear_error (&error); |
299 | - if (!result) |
300 | - return NULL; |
301 | - |
302 | - g_variant_get (result, "(s)", &cookie); |
303 | - g_variant_unref (result); |
304 | - g_debug ("Opened ConsoleKit session %s", cookie); |
305 | - |
306 | - return cookie; |
307 | -} |
308 | - |
309 | -static gchar * |
310 | -get_ck_session (GDBusConnection *bus, const gchar *cookie) |
311 | -{ |
312 | - GVariant *result; |
313 | - gchar *session_path; |
314 | - GError *error = NULL; |
315 | - |
316 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
317 | - result = g_dbus_connection_call_sync (bus, |
318 | - "org.freedesktop.ConsoleKit", |
319 | - "/org/freedesktop/ConsoleKit/Manager", |
320 | - "org.freedesktop.ConsoleKit.Manager", |
321 | - "GetSessionForCookie", |
322 | - g_variant_new ("(s)", cookie), |
323 | - G_VARIANT_TYPE ("(o)"), |
324 | - G_DBUS_CALL_FLAGS_NONE, |
325 | - -1, |
326 | - NULL, |
327 | - &error); |
328 | - g_object_unref (bus); |
329 | - if (error) |
330 | - g_warning ("Error getting ConsoleKit session: %s", error->message); |
331 | - g_clear_error (&error); |
332 | - if (!result) |
333 | - return NULL; |
334 | - |
335 | - g_variant_get (result, "(o)", &session_path); |
336 | - g_variant_unref (result); |
337 | - |
338 | - return session_path; |
339 | -} |
340 | - |
341 | -void |
342 | -ck_lock_session (const gchar *cookie) |
343 | -{ |
344 | - GDBusConnection *bus; |
345 | - gchar *session_path; |
346 | - GError *error = NULL; |
347 | - |
348 | - g_return_if_fail (cookie != NULL); |
349 | - |
350 | - g_debug ("Locking ConsoleKit session %s", cookie); |
351 | - |
352 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
353 | - if (error) |
354 | - g_warning ("Failed to get system bus: %s", error->message); |
355 | - g_clear_error (&error); |
356 | - if (!bus) |
357 | - return; |
358 | - |
359 | - session_path = get_ck_session (bus, cookie); |
360 | - if (session_path) |
361 | - { |
362 | - GVariant *result; |
363 | - |
364 | - result = g_dbus_connection_call_sync (bus, |
365 | - "org.freedesktop.ConsoleKit", |
366 | - session_path, |
367 | - "org.freedesktop.ConsoleKit.Session", |
368 | - "Lock", |
369 | - g_variant_new ("()"), |
370 | - G_VARIANT_TYPE ("()"), |
371 | - G_DBUS_CALL_FLAGS_NONE, |
372 | - -1, |
373 | - NULL, |
374 | - &error); |
375 | - if (error) |
376 | - g_warning ("Error locking ConsoleKit session: %s", error->message); |
377 | - g_clear_error (&error); |
378 | - if (result) |
379 | - g_variant_unref (result); |
380 | - } |
381 | - g_object_unref (bus); |
382 | -} |
383 | - |
384 | -void |
385 | -ck_unlock_session (const gchar *cookie) |
386 | -{ |
387 | - GDBusConnection *bus; |
388 | - gchar *session_path; |
389 | - GError *error = NULL; |
390 | - |
391 | - g_return_if_fail (cookie != NULL); |
392 | - |
393 | - g_debug ("Unlocking ConsoleKit session %s", cookie); |
394 | - |
395 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
396 | - if (error) |
397 | - g_warning ("Failed to get system bus: %s", error->message); |
398 | - g_clear_error (&error); |
399 | - if (!bus) |
400 | - return; |
401 | - |
402 | - session_path = get_ck_session (bus, cookie); |
403 | - if (session_path) |
404 | - { |
405 | - GVariant *result; |
406 | - |
407 | - result = g_dbus_connection_call_sync (bus, |
408 | - "org.freedesktop.ConsoleKit", |
409 | - session_path, |
410 | - "org.freedesktop.ConsoleKit.Session", |
411 | - "Unlock", |
412 | - g_variant_new ("()"), |
413 | - G_VARIANT_TYPE ("()"), |
414 | - G_DBUS_CALL_FLAGS_NONE, |
415 | - -1, |
416 | - NULL, |
417 | - &error); |
418 | - if (error) |
419 | - g_warning ("Error unlocking ConsoleKit session: %s", error->message); |
420 | - g_clear_error (&error); |
421 | - if (result) |
422 | - g_variant_unref (result); |
423 | - } |
424 | - g_object_unref (bus); |
425 | -} |
426 | - |
427 | -void |
428 | -ck_activate_session (const gchar *cookie) |
429 | -{ |
430 | - GDBusConnection *bus; |
431 | - gchar *session_path; |
432 | - GError *error = NULL; |
433 | - |
434 | - g_return_if_fail (cookie != NULL); |
435 | - |
436 | - g_debug ("Activating ConsoleKit session %s", cookie); |
437 | - |
438 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
439 | - if (error) |
440 | - g_warning ("Failed to get system bus: %s", error->message); |
441 | - g_clear_error (&error); |
442 | - if (!bus) |
443 | - return; |
444 | - |
445 | - session_path = get_ck_session (bus, cookie); |
446 | - if (session_path) |
447 | - { |
448 | - GVariant *result; |
449 | - |
450 | - result = g_dbus_connection_call_sync (bus, |
451 | - "org.freedesktop.ConsoleKit", |
452 | - session_path, |
453 | - "org.freedesktop.ConsoleKit.Session", |
454 | - "Activate", |
455 | - g_variant_new ("()"), |
456 | - G_VARIANT_TYPE ("()"), |
457 | - G_DBUS_CALL_FLAGS_NONE, |
458 | - -1, |
459 | - NULL, |
460 | - &error); |
461 | - if (error) |
462 | - g_warning ("Error activating ConsoleKit session: %s", error->message); |
463 | - g_clear_error (&error); |
464 | - if (result) |
465 | - g_variant_unref (result); |
466 | - } |
467 | - g_object_unref (bus); |
468 | -} |
469 | - |
470 | -void |
471 | -ck_close_session (const gchar *cookie) |
472 | -{ |
473 | - GDBusConnection *bus; |
474 | - GVariant *result; |
475 | - gboolean is_closed; |
476 | - GError *error = NULL; |
477 | - |
478 | - g_return_if_fail (cookie != NULL); |
479 | - |
480 | - g_debug ("Ending ConsoleKit session %s", cookie); |
481 | - |
482 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
483 | - if (error) |
484 | - g_warning ("Failed to get system bus: %s", error->message); |
485 | - g_clear_error (&error); |
486 | - if (!bus) |
487 | - return; |
488 | - result = g_dbus_connection_call_sync (bus, |
489 | - "org.freedesktop.ConsoleKit", |
490 | - "/org/freedesktop/ConsoleKit/Manager", |
491 | - "org.freedesktop.ConsoleKit.Manager", |
492 | - "CloseSession", |
493 | - g_variant_new ("(s)", cookie), |
494 | - G_VARIANT_TYPE ("(b)"), |
495 | - G_DBUS_CALL_FLAGS_NONE, |
496 | - -1, |
497 | - NULL, |
498 | - &error); |
499 | - g_object_unref (bus); |
500 | - |
501 | - if (error) |
502 | - g_warning ("Error ending ConsoleKit session: %s", error->message); |
503 | - g_clear_error (&error); |
504 | - if (!result) |
505 | - return; |
506 | - |
507 | - g_variant_get (result, "(b)", &is_closed); |
508 | - g_variant_unref (result); |
509 | - |
510 | - if (!is_closed) |
511 | - g_warning ("ConsoleKit.Manager.CloseSession() returned false"); |
512 | -} |
513 | |
514 | === removed file 'src/console-kit.h' |
515 | --- src/console-kit.h 2014-09-19 03:16:14 +0000 |
516 | +++ src/console-kit.h 1970-01-01 00:00:00 +0000 |
517 | @@ -1,31 +0,0 @@ |
518 | -/* |
519 | - * Copyright (C) 2010-2011 Robert Ancell. |
520 | - * Author: Robert Ancell <robert.ancell@canonical.com> |
521 | - * |
522 | - * This program is free software: you can redistribute it and/or modify it under |
523 | - * the terms of the GNU General Public License as published by the Free Software |
524 | - * Foundation, either version 3 of the License, or (at your option) any later |
525 | - * version. See http://www.gnu.org/copyleft/gpl.html the full text of the |
526 | - * license. |
527 | - */ |
528 | - |
529 | -#ifndef CONSOLE_KIT_H_ |
530 | -#define CONSOLE_KIT_H_ |
531 | - |
532 | -#include <glib-object.h> |
533 | - |
534 | -G_BEGIN_DECLS |
535 | - |
536 | -gchar *ck_open_session (GVariantBuilder *parameters); |
537 | - |
538 | -void ck_lock_session (const gchar *cookie); |
539 | - |
540 | -void ck_unlock_session (const gchar *cookie); |
541 | - |
542 | -void ck_activate_session (const gchar *cookie); |
543 | - |
544 | -void ck_close_session (const gchar *cookie); |
545 | - |
546 | -G_END_DECLS |
547 | - |
548 | -#endif /* CONSOLE_KIT_H_ */ |
549 | |
550 | === modified file 'src/seat.c' |
551 | --- src/seat.c 2014-09-29 23:42:38 +0000 |
552 | +++ src/seat.c 2014-10-02 07:55:11 +0000 |
553 | @@ -608,8 +608,7 @@ |
554 | { |
555 | /* Multiple sessions can theoretically be on the same VT (especially |
556 | if using Mir). If a new session appears on an existing active VT, |
557 | - logind will mark it as active, while ConsoleKit will re-mark the |
558 | - oldest session as active. In either case, that may not be the |
559 | + logind will mark it as active which may not be the |
560 | session that we want to be active. So let's be explicit and |
561 | re-activate the correct session whenever a new session starts. |
562 | There's no harm to do this in seats that enforce separate VTs. */ |
563 | |
564 | === modified file 'src/session-child.c' |
565 | --- src/session-child.c 2014-09-19 03:16:14 +0000 |
566 | +++ src/session-child.c 2014-10-02 07:55:11 +0000 |
567 | @@ -20,7 +20,6 @@ |
568 | #include "configuration.h" |
569 | #include "session-child.h" |
570 | #include "session.h" |
571 | -#include "console-kit.h" |
572 | #include "login1.h" |
573 | #include "privileges.h" |
574 | #include "x-authority.h" |
575 | @@ -231,7 +230,6 @@ |
576 | gsize env_length; |
577 | gsize command_argc; |
578 | gchar **command_argv; |
579 | - GVariantBuilder ck_parameters; |
580 | int return_code; |
581 | int authentication_result; |
582 | gchar *authentication_result_string; |
583 | @@ -242,9 +240,7 @@ |
584 | gchar *xdisplay; |
585 | XAuthority *x_authority = NULL; |
586 | gchar *x_authority_filename; |
587 | - GDBusConnection *bus; |
588 | const gchar *login1_session = NULL; |
589 | - gchar *console_kit_cookie = NULL; |
590 | const gchar *locale_value; |
591 | gchar *locale_var; |
592 | static const gchar * const locale_var_names[] = { |
593 | @@ -261,7 +257,6 @@ |
594 | gid_t gid; |
595 | uid_t uid; |
596 | const gchar *home_directory; |
597 | - GError *error = NULL; |
598 | |
599 | #if !defined(GLIB_VERSION_2_36) |
600 | g_type_init (); |
601 | @@ -534,55 +529,21 @@ |
602 | return EXIT_FAILURE; |
603 | } |
604 | |
605 | - /* Open a connection to the system bus for ConsoleKit - we must keep it open or CK will close the session */ |
606 | - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); |
607 | - if (error) |
608 | - g_printerr ("Unable to contact system bus: %s", error->message); |
609 | - if (!bus) |
610 | - { |
611 | - pam_end (pam_handle, 0); |
612 | - return EXIT_FAILURE; |
613 | - } |
614 | - |
615 | /* Check what logind session we are, or fallback to ConsoleKit */ |
616 | login1_session = pam_getenv (pam_handle, "XDG_SESSION_ID"); |
617 | if (login1_session) |
618 | { |
619 | write_string (login1_session); |
620 | + /* Write what was a ConsoleKit cookie */ |
621 | if (version >= 2) |
622 | write_string (NULL); |
623 | } |
624 | else |
625 | { |
626 | - g_variant_builder_init (&ck_parameters, G_VARIANT_TYPE ("(a(sv))")); |
627 | - g_variant_builder_open (&ck_parameters, G_VARIANT_TYPE ("a(sv)")); |
628 | - g_variant_builder_add (&ck_parameters, "(sv)", "unix-user", g_variant_new_int32 (user_get_uid (user))); |
629 | - if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") == 0) |
630 | - g_variant_builder_add (&ck_parameters, "(sv)", "session-type", g_variant_new_string ("LoginWindow")); |
631 | - if (xdisplay) |
632 | - { |
633 | - g_variant_builder_add (&ck_parameters, "(sv)", "x11-display", g_variant_new_string (xdisplay)); |
634 | - if (tty) |
635 | - g_variant_builder_add (&ck_parameters, "(sv)", "x11-display-device", g_variant_new_string (tty)); |
636 | - } |
637 | - if (remote_host_name) |
638 | - { |
639 | - g_variant_builder_add (&ck_parameters, "(sv)", "is-local", g_variant_new_boolean (FALSE)); |
640 | - g_variant_builder_add (&ck_parameters, "(sv)", "remote-host-name", g_variant_new_string (remote_host_name)); |
641 | - } |
642 | - else |
643 | - g_variant_builder_add (&ck_parameters, "(sv)", "is-local", g_variant_new_boolean (TRUE)); |
644 | - console_kit_cookie = ck_open_session (&ck_parameters); |
645 | if (version >= 2) |
646 | write_string (NULL); |
647 | - write_string (console_kit_cookie); |
648 | - if (console_kit_cookie) |
649 | - { |
650 | - gchar *value; |
651 | - value = g_strdup_printf ("XDG_SESSION_COOKIE=%s", console_kit_cookie); |
652 | - pam_putenv (pam_handle, value); |
653 | - g_free (value); |
654 | - } |
655 | + /* Write what was a ConsoleKit cookie */ |
656 | + write_string (NULL); |
657 | } |
658 | |
659 | /* Write X authority */ |
660 | @@ -760,10 +721,6 @@ |
661 | _exit (EXIT_FAILURE); |
662 | } |
663 | |
664 | - /* Close the Console Kit session */ |
665 | - if (console_kit_cookie) |
666 | - ck_close_session (console_kit_cookie); |
667 | - |
668 | /* Close the session */ |
669 | pam_close_session (pam_handle, 0); |
670 | |
671 | |
672 | === modified file 'src/session.c' |
673 | --- src/session.c 2014-09-29 23:42:38 +0000 |
674 | +++ src/session.c 2014-10-02 07:55:11 +0000 |
675 | @@ -23,7 +23,6 @@ |
676 | |
677 | #include "session.h" |
678 | #include "configuration.h" |
679 | -#include "console-kit.h" |
680 | #include "login1.h" |
681 | #include "guest-account.h" |
682 | #include "shared-data-manager.h" |
683 | @@ -96,9 +95,6 @@ |
684 | /* Remote host this session is being controlled from */ |
685 | gchar *remote_host_name; |
686 | |
687 | - /* Console kit cookie */ |
688 | - gchar *console_kit_cookie; |
689 | - |
690 | /* login1 session ID */ |
691 | gchar *login1_session_id; |
692 | |
693 | @@ -652,13 +648,6 @@ |
694 | return session->priv->username; |
695 | } |
696 | |
697 | -const gchar * |
698 | -session_get_console_kit_cookie (Session *session) |
699 | -{ |
700 | - g_return_val_if_fail (session != NULL, NULL); |
701 | - return session->priv->console_kit_cookie; |
702 | -} |
703 | - |
704 | void |
705 | session_respond (Session *session, struct pam_response *response) |
706 | { |
707 | @@ -806,46 +795,30 @@ |
708 | write_string (session, session->priv->argv[i]); |
709 | |
710 | session->priv->login1_session_id = read_string_from_child (session); |
711 | - session->priv->console_kit_cookie = read_string_from_child (session); |
712 | } |
713 | |
714 | void |
715 | session_lock (Session *session) |
716 | { |
717 | g_return_if_fail (session != NULL); |
718 | - if (getuid () == 0) |
719 | - { |
720 | - if (session->priv->login1_session_id) |
721 | - login1_service_lock_session (login1_service_get_instance (), session->priv->login1_session_id); |
722 | - else if (session->priv->console_kit_cookie) |
723 | - ck_lock_session (session->priv->console_kit_cookie); |
724 | - } |
725 | + if (getuid () == 0 && session->priv->login1_session_id) |
726 | + login1_service_lock_session (login1_service_get_instance (), session->priv->login1_session_id); |
727 | } |
728 | |
729 | void |
730 | session_unlock (Session *session) |
731 | { |
732 | g_return_if_fail (session != NULL); |
733 | - if (getuid () == 0) |
734 | - { |
735 | - if (session->priv->login1_session_id) |
736 | - login1_service_unlock_session (login1_service_get_instance (), session->priv->login1_session_id); |
737 | - else if (session->priv->console_kit_cookie) |
738 | - ck_unlock_session (session->priv->console_kit_cookie); |
739 | - } |
740 | + if (getuid () == 0 && session->priv->login1_session_id) |
741 | + login1_service_unlock_session (login1_service_get_instance (), session->priv->login1_session_id); |
742 | } |
743 | |
744 | void |
745 | session_activate (Session *session) |
746 | { |
747 | g_return_if_fail (session != NULL); |
748 | - if (getuid () == 0) |
749 | - { |
750 | - if (session->priv->login1_session_id) |
751 | - login1_service_activate_session (login1_service_get_instance (), session->priv->login1_session_id); |
752 | - else if (session->priv->console_kit_cookie) |
753 | - ck_activate_session (session->priv->console_kit_cookie); |
754 | - } |
755 | + if (getuid () == 0 && session->priv->login1_session_id) |
756 | + login1_service_activate_session (login1_service_get_instance (), session->priv->login1_session_id); |
757 | } |
758 | |
759 | void |
760 | @@ -938,7 +911,6 @@ |
761 | g_object_unref (self->priv->x_authority); |
762 | g_free (self->priv->remote_host_name); |
763 | g_free (self->priv->login1_session_id); |
764 | - g_free (self->priv->console_kit_cookie); |
765 | g_list_free_full (self->priv->env, g_free); |
766 | g_strfreev (self->priv->argv); |
767 | |
768 | |
769 | === modified file 'src/session.h' |
770 | --- src/session.h 2014-09-29 23:42:38 +0000 |
771 | +++ src/session.h 2014-10-02 07:55:11 +0000 |
772 | @@ -115,8 +115,6 @@ |
773 | |
774 | const gchar *session_get_username (Session *session); |
775 | |
776 | -const gchar *session_get_console_kit_cookie (Session *session); |
777 | - |
778 | void session_respond (Session *session, struct pam_response *response); |
779 | |
780 | void session_respond_error (Session *session, int error); |
781 | |
782 | === modified file 'tests/Makefile.am' |
783 | --- tests/Makefile.am 2014-10-02 06:51:36 +0000 |
784 | +++ tests/Makefile.am 2014-10-02 07:55:11 +0000 |
785 | @@ -134,8 +134,6 @@ |
786 | test-lock-session-no-password \ |
787 | test-lock-session-resettable \ |
788 | test-lock-session-return-session \ |
789 | - test-lock-seat-console-kit \ |
790 | - test-lock-seat-return-session-console-kit \ |
791 | test-switch-to-greeter \ |
792 | test-switch-to-greeter-disabled \ |
793 | test-switch-to-greeter-new-session \ |
794 | @@ -170,12 +168,8 @@ |
795 | test-utmp-autologin \ |
796 | test-utmp-wrong-password \ |
797 | test-no-accounts-service \ |
798 | - test-console-kit \ |
799 | - test-no-console-kit \ |
800 | test-no-login1 \ |
801 | - test-no-console-kit-or-login1 \ |
802 | test-power-gobject \ |
803 | - test-power-no-console-kit-gobject \ |
804 | test-power-no-login1-gobject \ |
805 | test-power-no-services-gobject \ |
806 | test-open-file-descriptors \ |
807 | @@ -254,7 +248,6 @@ |
808 | test-autologin-timeout-python \ |
809 | test-autologin-guest-timeout-python \ |
810 | test-power-python \ |
811 | - test-power-no-console-kit-python \ |
812 | test-power-no-login1-python \ |
813 | test-power-no-services-python |
814 | |
815 | @@ -290,7 +283,6 @@ |
816 | test-login-remote-session-qt4 \ |
817 | test-users-qt4 \ |
818 | test-power-qt4 \ |
819 | - test-power-no-console-kit-qt4 \ |
820 | test-power-no-login1-qt4 \ |
821 | test-power-no-services-qt4 |
822 | endif |
823 | @@ -327,7 +319,6 @@ |
824 | test-login-remote-session-qt5 \ |
825 | test-users-qt5 \ |
826 | test-power-qt5 \ |
827 | - test-power-no-console-kit-qt5 \ |
828 | test-power-no-login1-qt5 \ |
829 | test-power-no-services-qt5 |
830 | endif |
831 | @@ -378,7 +369,6 @@ |
832 | scripts/autologin-xserver-crash.conf \ |
833 | scripts/change-authentication.conf \ |
834 | scripts/cancel-authentication.conf \ |
835 | - scripts/console-kit.conf \ |
836 | scripts/corrupt-xauthority.conf \ |
837 | scripts/crash-authenticate.conf \ |
838 | scripts/cred-error.conf \ |
839 | @@ -406,10 +396,8 @@ |
840 | scripts/language-env.conf \ |
841 | scripts/language-no-accounts-service.conf \ |
842 | scripts/lock-seat.conf \ |
843 | - scripts/lock-seat-console-kit.conf \ |
844 | scripts/lock-seat-resettable.conf \ |
845 | scripts/lock-seat-return-session.conf \ |
846 | - scripts/lock-seat-return-session-console-kit.conf \ |
847 | scripts/lock-session.conf \ |
848 | scripts/lock-session-no-password.conf \ |
849 | scripts/lock-session-resettable.conf \ |
850 | @@ -464,12 +452,9 @@ |
851 | scripts/multi-seat-globbing-config-sections.conf \ |
852 | scripts/no-accounts-service.conf \ |
853 | scripts/no-config.conf \ |
854 | - scripts/no-console-kit.conf \ |
855 | - scripts/no-console-kit-or-login1.conf \ |
856 | scripts/no-login1.conf \ |
857 | scripts/open-file-descriptors.conf \ |
858 | scripts/power.conf \ |
859 | - scripts/power-no-console-kit.conf \ |
860 | scripts/power-no-services.conf \ |
861 | scripts/power-no-login1.conf \ |
862 | scripts/plymouth-active-vt.conf \ |
863 | |
864 | === removed file 'tests/scripts/console-kit.conf' |
865 | --- tests/scripts/console-kit.conf 2014-04-03 19:52:38 +0000 |
866 | +++ tests/scripts/console-kit.conf 1970-01-01 00:00:00 +0000 |
867 | @@ -1,33 +0,0 @@ |
868 | -# |
869 | -# Check ConsoleKit variable is set in session |
870 | -# |
871 | - |
872 | -[test-runner-config] |
873 | -disable-login1=true |
874 | - |
875 | -[SeatDefaults] |
876 | -autologin-user=have-password1 |
877 | -user-session=default |
878 | - |
879 | -#?*START-DAEMON |
880 | -#?RUNNER DAEMON-START |
881 | - |
882 | -# X server starts |
883 | -#?XSERVER-0 START VT=7 SEAT=seat0 |
884 | - |
885 | -# Daemon connects when X server is ready |
886 | -#?*XSERVER-0 INDICATE-READY |
887 | -#?XSERVER-0 INDICATE-READY |
888 | -#?XSERVER-0 ACCEPT-CONNECT |
889 | - |
890 | -# Session starts |
891 | -#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_COOKIE=ck-cookie-x:0 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
892 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:0 |
893 | -#?XSERVER-0 ACCEPT-CONNECT |
894 | -#?SESSION-X-0 CONNECT-XSERVER |
895 | - |
896 | -# Cleanup |
897 | -#?*STOP-DAEMON |
898 | -#?SESSION-X-0 TERMINATE SIGNAL=15 |
899 | -#?XSERVER-0 TERMINATE SIGNAL=15 |
900 | -#?RUNNER DAEMON-EXIT STATUS=0 |
901 | |
902 | === removed file 'tests/scripts/lock-seat-console-kit.conf' |
903 | --- tests/scripts/lock-seat-console-kit.conf 2014-04-03 19:52:38 +0000 |
904 | +++ tests/scripts/lock-seat-console-kit.conf 1970-01-01 00:00:00 +0000 |
905 | @@ -1,62 +0,0 @@ |
906 | -# |
907 | -# Check can lock a seat from D-Bus using ConsoleKit |
908 | -# |
909 | - |
910 | -[test-runner-config] |
911 | -disable-login1=true |
912 | - |
913 | -[SeatDefaults] |
914 | -autologin-user=have-password1 |
915 | -user-session=default |
916 | - |
917 | -#?*START-DAEMON |
918 | -#?RUNNER DAEMON-START |
919 | - |
920 | -# X server starts |
921 | -#?XSERVER-0 START VT=7 SEAT=seat0 |
922 | - |
923 | -# Daemon connects when X server is ready |
924 | -#?*XSERVER-0 INDICATE-READY |
925 | -#?XSERVER-0 INDICATE-READY |
926 | -#?XSERVER-0 ACCEPT-CONNECT |
927 | - |
928 | -# Session starts |
929 | -#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_COOKIE=ck-cookie-x:0 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
930 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:0 |
931 | -#?XSERVER-0 ACCEPT-CONNECT |
932 | -#?SESSION-X-0 CONNECT-XSERVER |
933 | - |
934 | -# Lock the seat |
935 | -#?*SESSION-X-0 LOCK-SEAT |
936 | -#?SESSION-X-0 LOCK-SEAT |
937 | - |
938 | -# New X server starts |
939 | -#?XSERVER-1 START VT=8 SEAT=seat0 |
940 | - |
941 | -# Daemon connects when X server is ready |
942 | -#?*XSERVER-1 INDICATE-READY |
943 | -#?XSERVER-1 INDICATE-READY |
944 | -#?XSERVER-1 ACCEPT-CONNECT |
945 | - |
946 | -# Session is locked |
947 | -#?CONSOLE-KIT LOCK-SESSION |
948 | - |
949 | -# Greeter starts |
950 | -#?GREETER-X-1 START XDG_SEAT=seat0 XDG_VTNR=8 XDG_SESSION_COOKIE=ck-cookie-x:1 XDG_SESSION_CLASS=greeter |
951 | -#?XSERVER-1 ACCEPT-CONNECT |
952 | -#?GREETER-X-1 CONNECT-XSERVER |
953 | -#?GREETER-X-1 CONNECT-TO-DAEMON |
954 | -#?GREETER-X-1 CONNECTED-TO-DAEMON |
955 | -#?GREETER-X-1 LOCK-HINT |
956 | - |
957 | -# Switch to greeter |
958 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:1 |
959 | -#?VT ACTIVATE VT=8 |
960 | - |
961 | -# Cleanup |
962 | -#?*STOP-DAEMON |
963 | -#?SESSION-X-0 TERMINATE SIGNAL=15 |
964 | -#?XSERVER-0 TERMINATE SIGNAL=15 |
965 | -#?GREETER-X-1 TERMINATE SIGNAL=15 |
966 | -#?XSERVER-1 TERMINATE SIGNAL=15 |
967 | -#?RUNNER DAEMON-EXIT STATUS=0 |
968 | |
969 | === removed file 'tests/scripts/lock-seat-return-session-console-kit.conf' |
970 | --- tests/scripts/lock-seat-return-session-console-kit.conf 2014-04-03 19:52:38 +0000 |
971 | +++ tests/scripts/lock-seat-return-session-console-kit.conf 1970-01-01 00:00:00 +0000 |
972 | @@ -1,78 +0,0 @@ |
973 | -# |
974 | -# Check can lock a seat from D-Bus and can return to it when using ConsoleKit |
975 | -# |
976 | - |
977 | -[test-runner-config] |
978 | -disable-login1=true |
979 | - |
980 | -[SeatDefaults] |
981 | -autologin-user=have-password1 |
982 | -user-session=default |
983 | - |
984 | -#?*START-DAEMON |
985 | -#?RUNNER DAEMON-START |
986 | - |
987 | -# X server starts |
988 | -#?XSERVER-0 START VT=7 SEAT=seat0 |
989 | - |
990 | -# Daemon connects when X server is ready |
991 | -#?*XSERVER-0 INDICATE-READY |
992 | -#?XSERVER-0 INDICATE-READY |
993 | -#?XSERVER-0 ACCEPT-CONNECT |
994 | - |
995 | -# Session starts |
996 | -#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_COOKIE=ck-cookie-x:0 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
997 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:0 |
998 | -#?XSERVER-0 ACCEPT-CONNECT |
999 | -#?SESSION-X-0 CONNECT-XSERVER |
1000 | - |
1001 | -# Lock the seat |
1002 | -#?*SESSION-X-0 LOCK-SEAT |
1003 | -#?SESSION-X-0 LOCK-SEAT |
1004 | - |
1005 | -# New X server starts |
1006 | -#?XSERVER-1 START VT=8 SEAT=seat0 |
1007 | - |
1008 | -# Daemon connects when X server is ready |
1009 | -#?*XSERVER-1 INDICATE-READY |
1010 | -#?XSERVER-1 INDICATE-READY |
1011 | -#?XSERVER-1 ACCEPT-CONNECT |
1012 | - |
1013 | -# Session is locked |
1014 | -#?CONSOLE-KIT LOCK-SESSION |
1015 | - |
1016 | -# Greeter starts |
1017 | -#?GREETER-X-1 START XDG_SEAT=seat0 XDG_VTNR=8 XDG_SESSION_COOKIE=ck-cookie-x:1 XDG_SESSION_CLASS=greeter |
1018 | -#?XSERVER-1 ACCEPT-CONNECT |
1019 | -#?GREETER-X-1 CONNECT-XSERVER |
1020 | -#?GREETER-X-1 CONNECT-TO-DAEMON |
1021 | -#?GREETER-X-1 CONNECTED-TO-DAEMON |
1022 | -#?GREETER-X-1 LOCK-HINT |
1023 | - |
1024 | -# Switch to greeter |
1025 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:1 |
1026 | -#?VT ACTIVATE VT=8 |
1027 | - |
1028 | -# Login as existing user |
1029 | -#?*GREETER-X-1 AUTHENTICATE USERNAME=have-password1 |
1030 | -#?GREETER-X-1 SHOW-PROMPT TEXT="Password:" |
1031 | -#?*GREETER-X-1 RESPOND TEXT="password" |
1032 | -#?GREETER-X-1 AUTHENTICATION-COMPLETE USERNAME=have-password1 AUTHENTICATED=TRUE |
1033 | -#?*GREETER-X-1 START-SESSION |
1034 | - |
1035 | -# Old session is unlocked |
1036 | -#?CONSOLE-KIT UNLOCK-SESSION |
1037 | - |
1038 | -# Return to session |
1039 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:0 |
1040 | -#?VT ACTIVATE VT=7 |
1041 | - |
1042 | -# Greeter and X server stop |
1043 | -#?GREETER-X-1 TERMINATE SIGNAL=15 |
1044 | -#?XSERVER-1 TERMINATE SIGNAL=15 |
1045 | - |
1046 | -# Cleanup |
1047 | -#?*STOP-DAEMON |
1048 | -#?SESSION-X-0 TERMINATE SIGNAL=15 |
1049 | -#?XSERVER-0 TERMINATE SIGNAL=15 |
1050 | -#?RUNNER DAEMON-EXIT STATUS=0 |
1051 | |
1052 | === removed file 'tests/scripts/no-console-kit-or-login1.conf' |
1053 | --- tests/scripts/no-console-kit-or-login1.conf 2014-04-03 19:52:38 +0000 |
1054 | +++ tests/scripts/no-console-kit-or-login1.conf 1970-01-01 00:00:00 +0000 |
1055 | @@ -1,33 +0,0 @@ |
1056 | -# |
1057 | -# Check still works when neither ConsoleKit or login1 is available |
1058 | -# |
1059 | - |
1060 | -[test-runner-config] |
1061 | -disable-console-kit=true |
1062 | -disable-login1=true |
1063 | - |
1064 | -[SeatDefaults] |
1065 | -autologin-user=have-password1 |
1066 | -user-session=default |
1067 | - |
1068 | -#?*START-DAEMON |
1069 | -#?RUNNER DAEMON-START |
1070 | - |
1071 | -# X server starts |
1072 | -#?XSERVER-0 START VT=7 SEAT=seat0 |
1073 | - |
1074 | -# Daemon connects when X server is ready |
1075 | -#?*XSERVER-0 INDICATE-READY |
1076 | -#?XSERVER-0 INDICATE-READY |
1077 | -#?XSERVER-0 ACCEPT-CONNECT |
1078 | - |
1079 | -# Session starts |
1080 | -#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
1081 | -#?XSERVER-0 ACCEPT-CONNECT |
1082 | -#?SESSION-X-0 CONNECT-XSERVER |
1083 | - |
1084 | -# Cleanup |
1085 | -#?*STOP-DAEMON |
1086 | -#?SESSION-X-0 TERMINATE SIGNAL=15 |
1087 | -#?XSERVER-0 TERMINATE SIGNAL=15 |
1088 | -#?RUNNER DAEMON-EXIT STATUS=0 |
1089 | |
1090 | === removed file 'tests/scripts/no-console-kit.conf' |
1091 | --- tests/scripts/no-console-kit.conf 2014-04-03 19:52:38 +0000 |
1092 | +++ tests/scripts/no-console-kit.conf 1970-01-01 00:00:00 +0000 |
1093 | @@ -1,33 +0,0 @@ |
1094 | -# |
1095 | -# Check still works when ConsoleKit is not available |
1096 | -# |
1097 | - |
1098 | -[test-runner-config] |
1099 | -disable-console-kit=true |
1100 | - |
1101 | -[SeatDefaults] |
1102 | -autologin-user=have-password1 |
1103 | -user-session=default |
1104 | - |
1105 | -#?*START-DAEMON |
1106 | -#?RUNNER DAEMON-START |
1107 | - |
1108 | -# X server starts |
1109 | -#?XSERVER-0 START VT=7 SEAT=seat0 |
1110 | - |
1111 | -# Daemon connects when X server is ready |
1112 | -#?*XSERVER-0 INDICATE-READY |
1113 | -#?XSERVER-0 INDICATE-READY |
1114 | -#?XSERVER-0 ACCEPT-CONNECT |
1115 | - |
1116 | -# Session starts |
1117 | -#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
1118 | -#?LOGIN1 ACTIVATE-SESSION SESSION=c0 |
1119 | -#?XSERVER-0 ACCEPT-CONNECT |
1120 | -#?SESSION-X-0 CONNECT-XSERVER |
1121 | - |
1122 | -# Cleanup |
1123 | -#?*STOP-DAEMON |
1124 | -#?SESSION-X-0 TERMINATE SIGNAL=15 |
1125 | -#?XSERVER-0 TERMINATE SIGNAL=15 |
1126 | -#?RUNNER DAEMON-EXIT STATUS=0 |
1127 | |
1128 | === modified file 'tests/scripts/no-login1.conf' |
1129 | --- tests/scripts/no-login1.conf 2014-04-03 19:52:38 +0000 |
1130 | +++ tests/scripts/no-login1.conf 2014-10-02 07:55:11 +0000 |
1131 | @@ -21,8 +21,7 @@ |
1132 | #?XSERVER-0 ACCEPT-CONNECT |
1133 | |
1134 | # Session starts |
1135 | -#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_COOKIE=ck-cookie-x:0 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
1136 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:0 |
1137 | +#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 |
1138 | #?XSERVER-0 ACCEPT-CONNECT |
1139 | #?SESSION-X-0 CONNECT-XSERVER |
1140 | |
1141 | |
1142 | === removed file 'tests/scripts/power-no-console-kit.conf' |
1143 | --- tests/scripts/power-no-console-kit.conf 2014-03-17 18:33:02 +0000 |
1144 | +++ tests/scripts/power-no-console-kit.conf 1970-01-01 00:00:00 +0000 |
1145 | @@ -1,67 +0,0 @@ |
1146 | -# |
1147 | -# Check can do power operations from the greeter when no ConsoleKit service |
1148 | -# |
1149 | - |
1150 | -[test-runner-config] |
1151 | -disable-console-kit=true |
1152 | - |
1153 | -#?*START-DAEMON |
1154 | -#?RUNNER DAEMON-START |
1155 | - |
1156 | -# X server starts |
1157 | -#?XSERVER-0 START VT=7 SEAT=seat0 |
1158 | - |
1159 | -# Daemon connects when X server is ready |
1160 | -#?*XSERVER-0 INDICATE-READY |
1161 | -#?XSERVER-0 INDICATE-READY |
1162 | -#?XSERVER-0 ACCEPT-CONNECT |
1163 | - |
1164 | -# Greeter starts |
1165 | -#?GREETER-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_SESSION_CLASS=greeter |
1166 | -#?LOGIN1 ACTIVATE-SESSION SESSION=c0 |
1167 | -#?XSERVER-0 ACCEPT-CONNECT |
1168 | -#?GREETER-X-0 CONNECT-XSERVER |
1169 | -#?GREETER-X-0 CONNECT-TO-DAEMON |
1170 | -#?GREETER-X-0 CONNECTED-TO-DAEMON |
1171 | - |
1172 | -# See if can suspend |
1173 | -#?*GREETER-X-0 GET-CAN-SUSPEND |
1174 | -#?LOGIN1 CAN-SUSPEND |
1175 | -#?GREETER-X-0 CAN-SUSPEND ALLOWED=TRUE |
1176 | - |
1177 | -# Suspend |
1178 | -#?*GREETER-X-0 SUSPEND |
1179 | -#?LOGIN1 SUSPEND |
1180 | - |
1181 | -# See if can hibernate |
1182 | -#?*GREETER-X-0 GET-CAN-HIBERNATE |
1183 | -#?LOGIN1 CAN-HIBERNATE |
1184 | -#?GREETER-X-0 CAN-HIBERNATE ALLOWED=TRUE |
1185 | - |
1186 | -# Hibernate |
1187 | -#?*GREETER-X-0 HIBERNATE |
1188 | -#?LOGIN1 HIBERNATE |
1189 | - |
1190 | -# See if can restart |
1191 | -#?*GREETER-X-0 GET-CAN-RESTART |
1192 | -#?LOGIN1 CAN-REBOOT |
1193 | -#?GREETER-X-0 CAN-RESTART ALLOWED=TRUE |
1194 | - |
1195 | -# Restart |
1196 | -#?*GREETER-X-0 RESTART |
1197 | -#?LOGIN1 REBOOT |
1198 | - |
1199 | -# See if can shutdown |
1200 | -#?*GREETER-X-0 GET-CAN-SHUTDOWN |
1201 | -#?LOGIN1 CAN-POWER-OFF |
1202 | -#?GREETER-X-0 CAN-SHUTDOWN ALLOWED=TRUE |
1203 | - |
1204 | -# Shutdown |
1205 | -#?*GREETER-X-0 SHUTDOWN |
1206 | -#?LOGIN1 POWER-OFF |
1207 | - |
1208 | -# Cleanup |
1209 | -#?*STOP-DAEMON |
1210 | -#?GREETER-X-0 TERMINATE SIGNAL=15 |
1211 | -#?XSERVER-0 TERMINATE SIGNAL=15 |
1212 | -#?RUNNER DAEMON-EXIT STATUS=0 |
1213 | |
1214 | === modified file 'tests/scripts/power-no-login1.conf' |
1215 | --- tests/scripts/power-no-login1.conf 2014-03-17 18:33:02 +0000 |
1216 | +++ tests/scripts/power-no-login1.conf 2014-10-02 07:55:11 +0000 |
1217 | @@ -1,5 +1,5 @@ |
1218 | # |
1219 | -# Check can do power operations from the greeter when no login1 service (falls back to ConsoleKit) |
1220 | +# Check powe operations marked as disabled when no login1 service |
1221 | # |
1222 | |
1223 | [test-runner-config] |
1224 | @@ -17,8 +17,7 @@ |
1225 | #?XSERVER-0 ACCEPT-CONNECT |
1226 | |
1227 | # Greeter starts |
1228 | -#?GREETER-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_SESSION_COOKIE=ck-cookie-x:0 XDG_SESSION_CLASS=greeter |
1229 | -#?CONSOLE-KIT ACTIVATE-SESSION SESSION=ck-cookie-x:0 |
1230 | +#?GREETER-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_SESSION_CLASS=greeter |
1231 | #?XSERVER-0 ACCEPT-CONNECT |
1232 | #?GREETER-X-0 CONNECT-XSERVER |
1233 | #?GREETER-X-0 CONNECT-TO-DAEMON |
1234 | @@ -44,21 +43,11 @@ |
1235 | |
1236 | # See if can restart |
1237 | #?*GREETER-X-0 GET-CAN-RESTART |
1238 | -#?CONSOLE-KIT CAN-RESTART |
1239 | -#?GREETER-X-0 CAN-RESTART ALLOWED=TRUE |
1240 | - |
1241 | -# Restart |
1242 | -#?*GREETER-X-0 RESTART |
1243 | -#?CONSOLE-KIT RESTART |
1244 | +#?GREETER-X-0 CAN-RESTART ALLOWED=FALSE |
1245 | |
1246 | # See if can shutdown |
1247 | #?*GREETER-X-0 GET-CAN-SHUTDOWN |
1248 | -#?CONSOLE-KIT CAN-STOP |
1249 | -#?GREETER-X-0 CAN-SHUTDOWN ALLOWED=TRUE |
1250 | - |
1251 | -# Shutdown |
1252 | -#?*GREETER-X-0 SHUTDOWN |
1253 | -#?CONSOLE-KIT STOP |
1254 | +#?GREETER-X-0 CAN-SHUTDOWN ALLOWED=FALSE |
1255 | |
1256 | # Cleanup |
1257 | #?*STOP-DAEMON |
1258 | |
1259 | === modified file 'tests/scripts/power-no-services.conf' |
1260 | --- tests/scripts/power-no-services.conf 2014-02-25 04:01:50 +0000 |
1261 | +++ tests/scripts/power-no-services.conf 2014-10-02 07:55:11 +0000 |
1262 | @@ -4,7 +4,6 @@ |
1263 | |
1264 | [test-runner-config] |
1265 | disable-upower=true |
1266 | -disable-console-kit=true |
1267 | disable-login1=true |
1268 | |
1269 | #?*START-DAEMON |
1270 | |
1271 | === modified file 'tests/src/test-gobject-greeter.c' |
1272 | --- tests/src/test-gobject-greeter.c 2014-09-29 23:42:38 +0000 |
1273 | +++ tests/src/test-gobject-greeter.c 2014-10-02 07:55:11 +0000 |
1274 | @@ -407,7 +407,7 @@ |
1275 | int |
1276 | main (int argc, char **argv) |
1277 | { |
1278 | - gchar *display, *xdg_seat, *xdg_vtnr, *xdg_session_cookie, *xdg_session_class, *mir_socket, *mir_vt, *mir_id, *path; |
1279 | + gchar *display, *xdg_seat, *xdg_vtnr, *xdg_session_class, *mir_socket, *mir_vt, *mir_id, *path; |
1280 | GString *status_text; |
1281 | |
1282 | #if !defined(GLIB_VERSION_2_36) |
1283 | @@ -417,7 +417,6 @@ |
1284 | display = getenv ("DISPLAY"); |
1285 | xdg_seat = getenv ("XDG_SEAT"); |
1286 | xdg_vtnr = getenv ("XDG_VTNR"); |
1287 | - xdg_session_cookie = getenv ("XDG_SESSION_COOKIE"); |
1288 | xdg_session_class = getenv ("XDG_SESSION_CLASS"); |
1289 | mir_socket = getenv ("MIR_SOCKET"); |
1290 | mir_vt = getenv ("MIR_SERVER_VT"); |
1291 | @@ -449,8 +448,6 @@ |
1292 | g_string_append_printf (status_text, " XDG_SEAT=%s", xdg_seat); |
1293 | if (xdg_vtnr) |
1294 | g_string_append_printf (status_text, " XDG_VTNR=%s", xdg_vtnr); |
1295 | - if (xdg_session_cookie) |
1296 | - g_string_append_printf (status_text, " XDG_SESSION_COOKIE=%s", xdg_session_cookie); |
1297 | if (xdg_session_class) |
1298 | g_string_append_printf (status_text, " XDG_SESSION_CLASS=%s", xdg_session_class); |
1299 | if (mir_vt > 0) |
1300 | |
1301 | === modified file 'tests/src/test-python-greeter' |
1302 | --- tests/src/test-python-greeter 2014-06-30 03:24:28 +0000 |
1303 | +++ tests/src/test-python-greeter 2014-10-02 07:55:11 +0000 |
1304 | @@ -12,7 +12,6 @@ |
1305 | display = os.getenv ('DISPLAY'); |
1306 | xdg_seat = os.getenv ('XDG_SEAT'); |
1307 | xdg_vtnr = os.getenv ('XDG_VTNR'); |
1308 | -xdg_session_cookie = os.getenv ('XDG_SESSION_COOKIE'); |
1309 | xdg_session_class = os.getenv ('XDG_SESSION_CLASS'); |
1310 | if display is not None: |
1311 | if display.startswith (':'): |
1312 | @@ -222,8 +221,6 @@ |
1313 | status_text += ' XDG_SEAT=%s' % xdg_seat |
1314 | if xdg_vtnr is not None: |
1315 | status_text += ' XDG_VTNR=%s' % xdg_vtnr |
1316 | -if xdg_session_cookie is not None: |
1317 | - status_text += ' XDG_SESSION_COOKIE=%s' % xdg_session_cookie |
1318 | if xdg_session_class is not None: |
1319 | status_text += ' XDG_SESSION_CLASS=%s' % xdg_session_class |
1320 | status_notify (status_text) |
1321 | |
1322 | === modified file 'tests/src/test-qt-greeter.cpp' |
1323 | --- tests/src/test-qt-greeter.cpp 2014-06-30 04:19:52 +0000 |
1324 | +++ tests/src/test-qt-greeter.cpp 2014-10-02 07:55:11 +0000 |
1325 | @@ -245,7 +245,7 @@ |
1326 | int |
1327 | main(int argc, char *argv[]) |
1328 | { |
1329 | - gchar *display, *xdg_seat, *xdg_vtnr, *xdg_session_cookie, *xdg_session_class; |
1330 | + gchar *display, *xdg_seat, *xdg_vtnr, *xdg_session_class; |
1331 | GString *status_text; |
1332 | |
1333 | #if !defined(GLIB_VERSION_2_36) |
1334 | @@ -255,7 +255,6 @@ |
1335 | display = getenv ("DISPLAY"); |
1336 | xdg_seat = getenv ("XDG_SEAT"); |
1337 | xdg_vtnr = getenv ("XDG_VTNR"); |
1338 | - xdg_session_cookie = getenv ("XDG_SESSION_COOKIE"); |
1339 | xdg_session_class = getenv ("XDG_SESSION_CLASS"); |
1340 | if (display) |
1341 | { |
1342 | @@ -285,8 +284,6 @@ |
1343 | g_string_append_printf (status_text, " XDG_SEAT=%s", xdg_seat); |
1344 | if (xdg_vtnr) |
1345 | g_string_append_printf (status_text, " XDG_VTNR=%s", xdg_vtnr); |
1346 | - if (xdg_session_cookie) |
1347 | - g_string_append_printf (status_text, " XDG_SESSION_COOKIE=%s", xdg_session_cookie); |
1348 | if (xdg_session_class) |
1349 | g_string_append_printf (status_text, " XDG_SESSION_CLASS=%s", xdg_session_class); |
1350 | status_notify ("%s", status_text->str); |
1351 | |
1352 | === modified file 'tests/src/test-runner.c' |
1353 | --- tests/src/test-runner.c 2014-10-02 02:46:13 +0000 |
1354 | +++ tests/src/test-runner.c 2014-10-02 07:55:11 +0000 |
1355 | @@ -81,28 +81,6 @@ |
1356 | handle_user_call, |
1357 | handle_user_get_property, |
1358 | }; |
1359 | -static GDBusNodeInfo *ck_session_info; |
1360 | -typedef struct |
1361 | -{ |
1362 | - gchar *cookie; |
1363 | - gchar *path; |
1364 | - guint id; |
1365 | - gboolean locked; |
1366 | -} CKSession; |
1367 | -static GList *ck_sessions = NULL; |
1368 | -static gint ck_session_index = 0; |
1369 | -static void handle_ck_session_call (GDBusConnection *connection, |
1370 | - const gchar *sender, |
1371 | - const gchar *object_path, |
1372 | - const gchar *interface_name, |
1373 | - const gchar *method_name, |
1374 | - GVariant *parameters, |
1375 | - GDBusMethodInvocation *invocation, |
1376 | - gpointer user_data); |
1377 | -static const GDBusInterfaceVTable ck_session_vtable = |
1378 | -{ |
1379 | - handle_ck_session_call, |
1380 | -}; |
1381 | |
1382 | typedef struct |
1383 | { |
1384 | @@ -1221,249 +1199,6 @@ |
1385 | NULL); |
1386 | } |
1387 | |
1388 | -static CKSession * |
1389 | -open_ck_session (GDBusConnection *connection, GVariant *params) |
1390 | -{ |
1391 | - CKSession *session; |
1392 | - GString *cookie; |
1393 | - GVariantIter *iter; |
1394 | - const gchar *name; |
1395 | - GVariant *value; |
1396 | - GError *error = NULL; |
1397 | - |
1398 | - session = g_malloc0 (sizeof (CKSession)); |
1399 | - ck_sessions = g_list_append (ck_sessions, session); |
1400 | - |
1401 | - cookie = g_string_new ("ck-cookie"); |
1402 | - g_variant_get (params, "a(sv)", &iter); |
1403 | - while (g_variant_iter_loop (iter, "(&sv)", &name, &value)) |
1404 | - { |
1405 | - if (strcmp (name, "x11-display") == 0) |
1406 | - { |
1407 | - const gchar *display; |
1408 | - g_variant_get (value, "&s", &display); |
1409 | - g_string_append_printf (cookie, "-x%s", display); |
1410 | - } |
1411 | - } |
1412 | - |
1413 | - session->cookie = cookie->str; |
1414 | - g_string_free (cookie, FALSE); |
1415 | - session->path = g_strdup_printf ("/org/freedesktop/ConsoleKit/Session%d", ck_session_index++); |
1416 | - session->id = g_dbus_connection_register_object (connection, |
1417 | - session->path, |
1418 | - ck_session_info->interfaces[0], |
1419 | - &ck_session_vtable, |
1420 | - session, |
1421 | - NULL, |
1422 | - &error); |
1423 | - if (error) |
1424 | - g_warning ("Failed to register CK Session: %s", error->message); |
1425 | - g_clear_error (&error); |
1426 | - |
1427 | - return session; |
1428 | -} |
1429 | - |
1430 | -static void |
1431 | -handle_ck_call (GDBusConnection *connection, |
1432 | - const gchar *sender, |
1433 | - const gchar *object_path, |
1434 | - const gchar *interface_name, |
1435 | - const gchar *method_name, |
1436 | - GVariant *parameters, |
1437 | - GDBusMethodInvocation *invocation, |
1438 | - gpointer user_data) |
1439 | -{ |
1440 | - if (strcmp (method_name, "CanRestart") == 0) |
1441 | - { |
1442 | - check_status ("CONSOLE-KIT CAN-RESTART"); |
1443 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", TRUE)); |
1444 | - } |
1445 | - else if (strcmp (method_name, "CanStop") == 0) |
1446 | - { |
1447 | - check_status ("CONSOLE-KIT CAN-STOP"); |
1448 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", TRUE)); |
1449 | - } |
1450 | - else if (strcmp (method_name, "CloseSession") == 0) |
1451 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", TRUE)); |
1452 | - else if (strcmp (method_name, "OpenSession") == 0) |
1453 | - { |
1454 | - GVariantBuilder params; |
1455 | - g_variant_builder_init (¶ms, G_VARIANT_TYPE ("a(sv)")); |
1456 | - CKSession *session = open_ck_session (connection, g_variant_builder_end (¶ms)); |
1457 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", session->cookie)); |
1458 | - } |
1459 | - else if (strcmp (method_name, "OpenSessionWithParameters") == 0) |
1460 | - { |
1461 | - CKSession *session = open_ck_session (connection, g_variant_get_child_value (parameters, 0)); |
1462 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", session->cookie)); |
1463 | - } |
1464 | - else if (strcmp (method_name, "GetSessionForCookie") == 0) |
1465 | - { |
1466 | - GList *link; |
1467 | - gchar *cookie; |
1468 | - |
1469 | - g_variant_get (parameters, "(&s)", &cookie); |
1470 | - |
1471 | - for (link = ck_sessions; link; link = link->next) |
1472 | - { |
1473 | - CKSession *session = link->data; |
1474 | - if (strcmp (session->cookie, cookie) == 0) |
1475 | - { |
1476 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("(o)", session->path)); |
1477 | - return; |
1478 | - } |
1479 | - } |
1480 | - |
1481 | - g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Unable to find session for cookie"); |
1482 | - } |
1483 | - else if (strcmp (method_name, "Restart") == 0) |
1484 | - { |
1485 | - check_status ("CONSOLE-KIT RESTART"); |
1486 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); |
1487 | - } |
1488 | - else if (strcmp (method_name, "Stop") == 0) |
1489 | - { |
1490 | - check_status ("CONSOLE-KIT STOP"); |
1491 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); |
1492 | - } |
1493 | - else |
1494 | - g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "No such method: %s", method_name); |
1495 | -} |
1496 | - |
1497 | -static void |
1498 | -handle_ck_session_call (GDBusConnection *connection, |
1499 | - const gchar *sender, |
1500 | - const gchar *object_path, |
1501 | - const gchar *interface_name, |
1502 | - const gchar *method_name, |
1503 | - GVariant *parameters, |
1504 | - GDBusMethodInvocation *invocation, |
1505 | - gpointer user_data) |
1506 | -{ |
1507 | - CKSession *session = user_data; |
1508 | - |
1509 | - if (strcmp (method_name, "Lock") == 0) |
1510 | - { |
1511 | - if (!session->locked) |
1512 | - check_status ("CONSOLE-KIT LOCK-SESSION"); |
1513 | - session->locked = TRUE; |
1514 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); |
1515 | - } |
1516 | - else if (strcmp (method_name, "Unlock") == 0) |
1517 | - { |
1518 | - if (session->locked) |
1519 | - check_status ("CONSOLE-KIT UNLOCK-SESSION"); |
1520 | - session->locked = FALSE; |
1521 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); |
1522 | - } |
1523 | - else if (strcmp (method_name, "Activate") == 0) |
1524 | - { |
1525 | - gchar *status = g_strdup_printf ("CONSOLE-KIT ACTIVATE-SESSION SESSION=%s", session->cookie); |
1526 | - check_status (status); |
1527 | - g_free (status); |
1528 | - |
1529 | - g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); |
1530 | - } |
1531 | - else |
1532 | - g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "No such method: %s", method_name); |
1533 | -} |
1534 | - |
1535 | -static void |
1536 | -ck_name_acquired_cb (GDBusConnection *connection, |
1537 | - const gchar *name, |
1538 | - gpointer user_data) |
1539 | -{ |
1540 | - const gchar *ck_interface = |
1541 | - "<node>" |
1542 | - " <interface name='org.freedesktop.ConsoleKit.Manager'>" |
1543 | - " <method name='CanRestart'>" |
1544 | - " <arg name='can_restart' direction='out' type='b'/>" |
1545 | - " </method>" |
1546 | - " <method name='CanStop'>" |
1547 | - " <arg name='can_stop' direction='out' type='b'/>" |
1548 | - " </method>" |
1549 | - " <method name='CloseSession'>" |
1550 | - " <arg name='cookie' direction='in' type='s'/>" |
1551 | - " <arg name='result' direction='out' type='b'/>" |
1552 | - " </method>" |
1553 | - " <method name='OpenSession'>" |
1554 | - " <arg name='cookie' direction='out' type='s'/>" |
1555 | - " </method>" |
1556 | - " <method name='OpenSessionWithParameters'>" |
1557 | - " <arg name='parameters' direction='in' type='a(sv)'/>" |
1558 | - " <arg name='cookie' direction='out' type='s'/>" |
1559 | - " </method>" |
1560 | - " <method name='GetSessionForCookie'>" |
1561 | - " <arg name='cookie' direction='in' type='s'/>" |
1562 | - " <arg name='ssid' direction='out' type='o'/>" |
1563 | - " </method>" |
1564 | - " <method name='Restart'/>" |
1565 | - " <method name='Stop'/>" |
1566 | - " <signal name='SeatAdded'>" |
1567 | - " <arg name='seat' type='o'/>" |
1568 | - " </signal>" |
1569 | - " <signal name='SeatRemoved'>" |
1570 | - " <arg name='seat' type='o'/>" |
1571 | - " </signal>" |
1572 | - " </interface>" |
1573 | - "</node>"; |
1574 | - static const GDBusInterfaceVTable ck_vtable = |
1575 | - { |
1576 | - handle_ck_call, |
1577 | - }; |
1578 | - const gchar *ck_session_interface = |
1579 | - "<node>" |
1580 | - " <interface name='org.freedesktop.ConsoleKit.Session'>" |
1581 | - " <method name='Lock'/>" |
1582 | - " <method name='Unlock'/>" |
1583 | - " <method name='Activate'/>" |
1584 | - " </interface>" |
1585 | - "</node>"; |
1586 | - GDBusNodeInfo *ck_info; |
1587 | - GError *error = NULL; |
1588 | - |
1589 | - ck_info = g_dbus_node_info_new_for_xml (ck_interface, &error); |
1590 | - if (error) |
1591 | - g_warning ("Failed to parse D-Bus interface: %s", error->message); |
1592 | - g_clear_error (&error); |
1593 | - if (!ck_info) |
1594 | - return; |
1595 | - ck_session_info = g_dbus_node_info_new_for_xml (ck_session_interface, &error); |
1596 | - if (error) |
1597 | - g_warning ("Failed to parse D-Bus interface: %s", error->message); |
1598 | - g_clear_error (&error); |
1599 | - if (!ck_session_info) |
1600 | - return; |
1601 | - g_dbus_connection_register_object (connection, |
1602 | - "/org/freedesktop/ConsoleKit/Manager", |
1603 | - ck_info->interfaces[0], |
1604 | - &ck_vtable, |
1605 | - NULL, NULL, |
1606 | - &error); |
1607 | - if (error) |
1608 | - g_warning ("Failed to register console kit service: %s", error->message); |
1609 | - g_clear_error (&error); |
1610 | - g_dbus_node_info_unref (ck_info); |
1611 | - |
1612 | - service_count--; |
1613 | - if (service_count == 0) |
1614 | - ready (); |
1615 | -} |
1616 | - |
1617 | -static void |
1618 | -start_console_kit_daemon (void) |
1619 | -{ |
1620 | - service_count++; |
1621 | - g_bus_own_name (G_BUS_TYPE_SYSTEM, |
1622 | - "org.freedesktop.ConsoleKit", |
1623 | - G_BUS_NAME_OWNER_FLAGS_NONE, |
1624 | - NULL, |
1625 | - ck_name_acquired_cb, |
1626 | - NULL, |
1627 | - NULL, |
1628 | - NULL); |
1629 | -} |
1630 | - |
1631 | static void |
1632 | handle_login1_seat_call (GDBusConnection *connection, |
1633 | const gchar *sender, |
1634 | @@ -2813,8 +2548,6 @@ |
1635 | /* Start D-Bus services */ |
1636 | if (!g_key_file_get_boolean (config, "test-runner-config", "disable-upower", NULL)) |
1637 | start_upower_daemon (); |
1638 | - if (!g_key_file_get_boolean (config, "test-runner-config", "disable-console-kit", NULL)) |
1639 | - start_console_kit_daemon (); |
1640 | if (!g_key_file_get_boolean (config, "test-runner-config", "disable-login1", NULL)) |
1641 | start_login1_daemon (); |
1642 | if (!g_key_file_get_boolean (config, "test-runner-config", "disable-accounts-service", NULL)) |
1643 | |
1644 | === modified file 'tests/src/test-session.c' |
1645 | --- tests/src/test-session.c 2014-09-19 03:16:14 +0000 |
1646 | +++ tests/src/test-session.c 2014-10-02 07:55:11 +0000 |
1647 | @@ -229,7 +229,7 @@ |
1648 | int |
1649 | main (int argc, char **argv) |
1650 | { |
1651 | - gchar *display, *xdg_seat, *xdg_vtnr, *xdg_current_desktop, *xdg_greeter_data_dir, *xdg_session_cookie, *xdg_session_class, *xdg_session_type, *xdg_session_desktop, *mir_socket, *mir_vt, *mir_id; |
1652 | + gchar *display, *xdg_seat, *xdg_vtnr, *xdg_current_desktop, *xdg_greeter_data_dir, *xdg_session_class, *xdg_session_type, *xdg_session_desktop, *mir_socket, *mir_vt, *mir_id; |
1653 | GString *status_text; |
1654 | int fd, open_max; |
1655 | |
1656 | @@ -238,7 +238,6 @@ |
1657 | xdg_vtnr = getenv ("XDG_VTNR"); |
1658 | xdg_current_desktop = getenv ("XDG_CURRENT_DESKTOP"); |
1659 | xdg_greeter_data_dir = getenv ("XDG_GREETER_DATA_DIR"); |
1660 | - xdg_session_cookie = getenv ("XDG_SESSION_COOKIE"); |
1661 | xdg_session_class = getenv ("XDG_SESSION_CLASS"); |
1662 | xdg_session_type = getenv ("XDG_SESSION_TYPE"); |
1663 | xdg_session_desktop = getenv ("XDG_SESSION_DESKTOP"); |
1664 | @@ -290,8 +289,6 @@ |
1665 | g_string_append_printf (status_text, " XDG_CURRENT_DESKTOP=%s", xdg_current_desktop); |
1666 | if (xdg_greeter_data_dir) |
1667 | g_string_append_printf (status_text, " XDG_GREETER_DATA_DIR=%s", xdg_greeter_data_dir); |
1668 | - if (xdg_session_cookie) |
1669 | - g_string_append_printf (status_text, " XDG_SESSION_COOKIE=%s", xdg_session_cookie); |
1670 | if (xdg_session_class) |
1671 | g_string_append_printf (status_text, " XDG_SESSION_CLASS=%s", xdg_session_class); |
1672 | if (xdg_session_type) |
1673 | |
1674 | === removed file 'tests/test-console-kit' |
1675 | --- tests/test-console-kit 2012-02-29 22:23:17 +0000 |
1676 | +++ tests/test-console-kit 1970-01-01 00:00:00 +0000 |
1677 | @@ -1,2 +0,0 @@ |
1678 | -#!/bin/sh |
1679 | -./src/dbus-env ./src/test-runner console-kit test-gobject-greeter |
1680 | |
1681 | === removed file 'tests/test-lock-seat-console-kit' |
1682 | --- tests/test-lock-seat-console-kit 2013-08-08 09:15:11 +0000 |
1683 | +++ tests/test-lock-seat-console-kit 1970-01-01 00:00:00 +0000 |
1684 | @@ -1,2 +0,0 @@ |
1685 | -#!/bin/sh |
1686 | -./src/dbus-env ./src/test-runner lock-seat-console-kit test-gobject-greeter |
1687 | |
1688 | === removed file 'tests/test-lock-seat-return-session-console-kit' |
1689 | --- tests/test-lock-seat-return-session-console-kit 2013-08-08 10:10:19 +0000 |
1690 | +++ tests/test-lock-seat-return-session-console-kit 1970-01-01 00:00:00 +0000 |
1691 | @@ -1,2 +0,0 @@ |
1692 | -#!/bin/sh |
1693 | -./src/dbus-env ./src/test-runner lock-seat-return-session-console-kit test-gobject-greeter |
1694 | |
1695 | === removed file 'tests/test-no-console-kit' |
1696 | --- tests/test-no-console-kit 2013-04-23 22:51:09 +0000 |
1697 | +++ tests/test-no-console-kit 1970-01-01 00:00:00 +0000 |
1698 | @@ -1,2 +0,0 @@ |
1699 | -#!/bin/sh |
1700 | -./src/dbus-env ./src/test-runner no-console-kit test-gobject-greeter |
1701 | |
1702 | === removed file 'tests/test-no-console-kit-or-login1' |
1703 | --- tests/test-no-console-kit-or-login1 2013-04-22 12:20:48 +0000 |
1704 | +++ tests/test-no-console-kit-or-login1 1970-01-01 00:00:00 +0000 |
1705 | @@ -1,2 +0,0 @@ |
1706 | -#!/bin/sh |
1707 | -./src/dbus-env ./src/test-runner no-console-kit-or-login1 test-gobject-greeter |
1708 | |
1709 | === removed file 'tests/test-power-no-console-kit-gobject' |
1710 | --- tests/test-power-no-console-kit-gobject 2014-05-15 22:37:49 +0000 |
1711 | +++ tests/test-power-no-console-kit-gobject 1970-01-01 00:00:00 +0000 |
1712 | @@ -1,2 +0,0 @@ |
1713 | -#!/bin/sh |
1714 | -./src/dbus-env ./src/test-runner power-no-console-kit test-gobject-greeter |
1715 | |
1716 | === removed file 'tests/test-power-no-console-kit-python' |
1717 | --- tests/test-power-no-console-kit-python 2014-05-15 22:37:49 +0000 |
1718 | +++ tests/test-power-no-console-kit-python 1970-01-01 00:00:00 +0000 |
1719 | @@ -1,2 +0,0 @@ |
1720 | -#!/bin/sh |
1721 | -./src/dbus-env ./src/test-runner power-no-console-kit test-python-greeter |
1722 | |
1723 | === removed file 'tests/test-power-no-console-kit-qt4' |
1724 | --- tests/test-power-no-console-kit-qt4 2014-05-15 22:37:49 +0000 |
1725 | +++ tests/test-power-no-console-kit-qt4 1970-01-01 00:00:00 +0000 |
1726 | @@ -1,2 +0,0 @@ |
1727 | -#!/bin/sh |
1728 | -./src/dbus-env ./src/test-runner power-no-console-kit test-qt4-greeter |
1729 | |
1730 | === removed file 'tests/test-power-no-console-kit-qt5' |
1731 | --- tests/test-power-no-console-kit-qt5 2014-05-15 22:37:49 +0000 |
1732 | +++ tests/test-power-no-console-kit-qt5 1970-01-01 00:00:00 +0000 |
1733 | @@ -1,2 +0,0 @@ |
1734 | -#!/bin/sh |
1735 | -./src/dbus-env ./src/test-runner power-no-console-kit test-qt5-greeter |