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