1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
4 This file is part of systemd.
6 Copyright 2010 Lennart Poettering
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 #include <sys/socket.h>
28 #include <dbus/dbus.h>
30 #include <sys/epoll.h>
33 #include "dbus-common.h"
38 int bus_check_peercred(DBusConnection *c) {
45 assert_se(dbus_connection_get_unix_fd(c, &fd));
47 l = sizeof(struct ucred);
48 if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &l) < 0) {
49 log_error("SO_PEERCRED failed: %m");
53 if (l != sizeof(struct ucred)) {
54 log_error("SO_PEERCRED returned wrong size.");
58 if (ucred.uid != 0 && ucred.uid != geteuid())
64 static int sync_auth(DBusConnection *bus, DBusError *error) {
69 /* This complexity should probably move into D-Bus itself:
71 * https://bugs.freedesktop.org/show_bug.cgi?id=35189 */
73 begin = tstamp = now(CLOCK_MONOTONIC);
76 if (tstamp > begin + DEFAULT_TIMEOUT_USEC)
79 if (dbus_connection_get_is_authenticated(bus))
82 if (!dbus_connection_read_write_dispatch(bus, ((begin + DEFAULT_TIMEOUT_USEC - tstamp) + USEC_PER_MSEC - 1) / USEC_PER_MSEC))
85 tstamp = now(CLOCK_MONOTONIC);
88 if (!dbus_connection_get_is_connected(bus)) {
89 dbus_set_error_const(error, DBUS_ERROR_NO_SERVER, "Connection terminated during authentication.");
93 if (!dbus_connection_get_is_authenticated(bus)) {
94 dbus_set_error_const(error, DBUS_ERROR_TIMEOUT, "Failed to authenticate in time.");
101 int bus_connect(DBusBusType t, DBusConnection **_bus, bool *_private, DBusError *error) {
102 DBusConnection *bus = NULL;
108 if (geteuid() == 0 && t == DBUS_BUS_SYSTEM) {
109 /* If we are root, then let's talk directly to the
110 * system instance, instead of going via the bus */
112 bus = dbus_connection_open_private("unix:path=/run/systemd/private", error);
117 if (t == DBUS_BUS_SESSION) {
120 /* If we are supposed to talk to the instance,
121 * try via XDG_RUNTIME_DIR first, then
122 * fallback to normal bus access */
124 e = getenv("XDG_RUNTIME_DIR");
128 if (asprintf(&p, "unix:path=%s/systemd/private", e) < 0)
131 bus = dbus_connection_open_private(p, NULL);
137 bus = dbus_bus_get_private(t, error);
145 dbus_connection_set_exit_on_disconnect(bus, FALSE);
148 if (bus_check_peercred(bus) < 0) {
149 dbus_connection_close(bus);
150 dbus_connection_unref(bus);
152 dbus_set_error_const(error, DBUS_ERROR_ACCESS_DENIED, "Failed to verify owner of bus.");
157 r = sync_auth(bus, error);
159 dbus_connection_close(bus);
160 dbus_connection_unref(bus);
171 int bus_connect_system_ssh(const char *user, const char *host, DBusConnection **_bus, DBusError *error) {
177 assert(user || host);
180 asprintf(&p, "unixexec:path=ssh,argv1=-xT,argv2=%s@%s,argv3=systemd-stdio-bridge", user, host);
182 asprintf(&p, "unixexec:path=ssh,argv1=-xT,argv2=%s@localhost,argv3=systemd-stdio-bridge", user);
184 asprintf(&p, "unixexec:path=ssh,argv1=-xT,argv2=%s,argv3=systemd-stdio-bridge", host);
187 dbus_set_error_const(error, DBUS_ERROR_NO_MEMORY, NULL);
191 bus = dbus_connection_open_private(p, error);
197 dbus_connection_set_exit_on_disconnect(bus, FALSE);
199 if ((r = sync_auth(bus, error)) < 0) {
200 dbus_connection_close(bus);
201 dbus_connection_unref(bus);
205 if (!dbus_bus_register(bus, error)) {
206 dbus_connection_close(bus);
207 dbus_connection_unref(bus);
215 int bus_connect_system_polkit(DBusConnection **_bus, DBusError *error) {
221 /* Don't bother with PolicyKit if we are root */
223 return bus_connect(DBUS_BUS_SYSTEM, _bus, NULL, error);
225 bus = dbus_connection_open_private("unixexec:path=pkexec,argv1=" SYSTEMD_STDIO_BRIDGE_BINARY_PATH, error);
229 dbus_connection_set_exit_on_disconnect(bus, FALSE);
231 if ((r = sync_auth(bus, error)) < 0) {
232 dbus_connection_close(bus);
233 dbus_connection_unref(bus);
237 if (!dbus_bus_register(bus, error)) {
238 dbus_connection_close(bus);
239 dbus_connection_unref(bus);
247 const char *bus_error_message(const DBusError *error) {
250 /* Sometimes the D-Bus server is a little bit too verbose with
251 * its error messages, so let's override them here */
252 if (dbus_error_has_name(error, DBUS_ERROR_ACCESS_DENIED))
253 return "Access denied";
255 return error->message;
258 DBusHandlerResult bus_default_message_handler(
260 DBusMessage *message,
261 const char *introspection,
262 const char *interfaces,
263 const BusBoundProperties *bound_properties) {
266 DBusMessage *reply = NULL;
272 dbus_error_init(&error);
274 if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Introspectable", "Introspect") && introspection) {
276 if (!(reply = dbus_message_new_method_return(message)))
279 if (!dbus_message_append_args(reply, DBUS_TYPE_STRING, &introspection, DBUS_TYPE_INVALID))
282 } else if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Properties", "Get") && bound_properties) {
283 const char *interface, *property;
284 const BusBoundProperties *bp;
285 const BusProperty *p;
287 DBusMessageIter iter, sub;
289 if (!dbus_message_get_args(
292 DBUS_TYPE_STRING, &interface,
293 DBUS_TYPE_STRING, &property,
295 return bus_send_error_reply(c, message, &error, -EINVAL);
297 for (bp = bound_properties; bp->interface; bp++) {
298 if (!streq(bp->interface, interface))
301 for (p = bp->properties; p->property; p++)
302 if (streq(p->property, property))
307 if (!nulstr_contains(interfaces, interface))
308 dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface");
310 dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_PROPERTY, "Unknown property");
312 return bus_send_error_reply(c, message, &error, -EINVAL);
315 reply = dbus_message_new_method_return(message);
319 dbus_message_iter_init_append(reply, &iter);
321 if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, p->signature, &sub))
324 data = (char*)bp->base + p->offset;
326 data = *(void**)data;
327 r = p->append(&sub, property, data);
332 dbus_message_unref(reply);
333 return bus_send_error_reply(c, message, NULL, r);
336 if (!dbus_message_iter_close_container(&iter, &sub))
339 } else if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Properties", "GetAll") && bound_properties) {
340 const char *interface;
341 const BusBoundProperties *bp;
342 const BusProperty *p;
343 DBusMessageIter iter, sub, sub2, sub3;
345 if (!dbus_message_get_args(
348 DBUS_TYPE_STRING, &interface,
350 return bus_send_error_reply(c, message, &error, -EINVAL);
352 if (interface[0] && !nulstr_contains(interfaces, interface)) {
353 dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface");
354 return bus_send_error_reply(c, message, &error, -EINVAL);
357 if (!(reply = dbus_message_new_method_return(message)))
360 dbus_message_iter_init_append(reply, &iter);
362 if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &sub))
365 for (bp = bound_properties; bp->interface; bp++) {
366 if (interface[0] && !streq(bp->interface, interface))
369 for (p = bp->properties; p->property; p++) {
372 if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_DICT_ENTRY, NULL, &sub2) ||
373 !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &p->property) ||
374 !dbus_message_iter_open_container(&sub2, DBUS_TYPE_VARIANT, p->signature, &sub3))
377 data = (char*)bp->base + p->offset;
379 data = *(void**)data;
380 r = p->append(&sub3, p->property, data);
385 dbus_message_unref(reply);
386 return bus_send_error_reply(c, message, NULL, r);
389 if (!dbus_message_iter_close_container(&sub2, &sub3) ||
390 !dbus_message_iter_close_container(&sub, &sub2))
395 if (!dbus_message_iter_close_container(&iter, &sub))
398 } else if (dbus_message_is_method_call(message, "org.freedesktop.DBus.Properties", "Set") && bound_properties) {
399 const char *interface, *property;
400 DBusMessageIter iter;
401 const BusBoundProperties *bp;
402 const BusProperty *p;
406 if (!dbus_message_iter_init(message, &iter) ||
407 dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
408 return bus_send_error_reply(c, message, NULL, -EINVAL);
410 dbus_message_iter_get_basic(&iter, &interface);
412 if (!dbus_message_iter_next(&iter) ||
413 dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
414 return bus_send_error_reply(c, message, NULL, -EINVAL);
416 dbus_message_iter_get_basic(&iter, &property);
418 if (!dbus_message_iter_next(&iter) ||
419 dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT ||
420 dbus_message_iter_has_next(&iter))
421 return bus_send_error_reply(c, message, NULL, -EINVAL);
423 for (bp = bound_properties; bp->interface; bp++) {
424 if (!streq(bp->interface, interface))
427 for (p = bp->properties; p->property; p++)
428 if (streq(p->property, property))
433 if (!nulstr_contains(interfaces, interface))
434 dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface");
436 dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_PROPERTY, "Unknown property");
438 return bus_send_error_reply(c, message, &error, -EINVAL);
442 dbus_set_error_const(&error, DBUS_ERROR_PROPERTY_READ_ONLY, "Property read-only");
443 return bus_send_error_reply(c, message, &error, -EINVAL);
446 dbus_message_iter_recurse(&iter, &sub);
448 sig = dbus_message_iter_get_signature(&sub);
452 if (!streq(sig, p->signature)) {
454 return bus_send_error_reply(c, message, NULL, -EINVAL);
459 r = p->set(&sub, property);
463 return bus_send_error_reply(c, message, NULL, r);
466 reply = dbus_message_new_method_return(message);
470 const char *interface = dbus_message_get_interface(message);
472 if (!interface || !nulstr_contains(interfaces, interface)) {
473 dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface");
474 return bus_send_error_reply(c, message, &error, -EINVAL);
479 if (!dbus_connection_send(c, reply, NULL))
482 dbus_message_unref(reply);
483 return DBUS_HANDLER_RESULT_HANDLED;
486 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
490 dbus_message_unref(reply);
492 dbus_error_free(&error);
494 return DBUS_HANDLER_RESULT_NEED_MEMORY;
497 int bus_property_append_string(DBusMessageIter *i, const char *property, void *data) {
498 const char *t = data;
506 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
512 int bus_property_append_strv(DBusMessageIter *i, const char *property, void *data) {
518 return bus_append_strv_iter(i, t);
521 int bus_property_append_bool(DBusMessageIter *i, const char *property, void *data) {
531 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &db))
537 int bus_property_append_tristate_false(DBusMessageIter *i, const char *property, void *data) {
547 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &db))
553 int bus_property_append_uint64(DBusMessageIter *i, const char *property, void *data) {
558 /* Let's ensure that usec_t is actually 64bit, and hence this
559 * function can be used for usec_t */
560 assert_cc(sizeof(uint64_t) == sizeof(usec_t));
562 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT64, data))
568 int bus_property_append_uint32(DBusMessageIter *i, const char *property, void *data) {
573 /* Let's ensure that pid_t, mode_t, uid_t, gid_t are actually
574 * 32bit, and hence this function can be used for
575 * pid_t/mode_t/uid_t/gid_t */
576 assert_cc(sizeof(uint32_t) == sizeof(pid_t));
577 assert_cc(sizeof(uint32_t) == sizeof(mode_t));
578 assert_cc(sizeof(uint32_t) == sizeof(unsigned));
579 assert_cc(sizeof(uint32_t) == sizeof(uid_t));
580 assert_cc(sizeof(uint32_t) == sizeof(gid_t));
582 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT32, data))
588 int bus_property_append_int32(DBusMessageIter *i, const char *property, void *data) {
593 assert_cc(sizeof(int32_t) == sizeof(int));
595 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, data))
601 int bus_property_append_size(DBusMessageIter *i, const char *property, void *data) {
608 u = (uint64_t) *(size_t*) data;
610 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT64, &u))
616 int bus_property_append_ul(DBusMessageIter *i, const char *property, void *data) {
623 u = (uint64_t) *(unsigned long*) data;
625 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT64, &u))
631 int bus_property_append_long(DBusMessageIter *i, const char *property, void *data) {
638 l = (int64_t) *(long*) data;
640 if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT64, &l))
646 const char *bus_errno_to_dbus(int error) {
651 return DBUS_ERROR_INVALID_ARGS;
654 return DBUS_ERROR_NO_MEMORY;
658 return DBUS_ERROR_ACCESS_DENIED;
661 return DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN;
664 return DBUS_ERROR_FILE_NOT_FOUND;
667 return DBUS_ERROR_FILE_EXISTS;
671 return DBUS_ERROR_TIMEOUT;
674 return DBUS_ERROR_IO_ERROR;
679 return DBUS_ERROR_DISCONNECTED;
682 return DBUS_ERROR_FAILED;
685 DBusHandlerResult bus_send_error_reply(DBusConnection *c, DBusMessage *message, DBusError *berror, int error) {
686 DBusMessage *reply = NULL;
687 const char *name, *text;
689 if (berror && dbus_error_is_set(berror)) {
691 text = berror->message;
693 name = bus_errno_to_dbus(error);
694 text = strerror(-error);
697 if (!(reply = dbus_message_new_error(message, name, text)))
700 if (!dbus_connection_send(c, reply, NULL))
703 dbus_message_unref(reply);
706 dbus_error_free(berror);
708 return DBUS_HANDLER_RESULT_HANDLED;
712 dbus_message_unref(reply);
715 dbus_error_free(berror);
717 return DBUS_HANDLER_RESULT_NEED_MEMORY;
720 DBusMessage* bus_properties_changed_new(const char *path, const char *interface, const char *properties) {
722 DBusMessageIter iter, sub;
728 if (!(m = dbus_message_new_signal(path, "org.freedesktop.DBus.Properties", "PropertiesChanged")))
731 dbus_message_iter_init_append(m, &iter);
733 /* We won't send any property values, since they might be
734 * large and sometimes not cheap to generated */
736 if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &interface) ||
737 !dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &sub) ||
738 !dbus_message_iter_close_container(&iter, &sub) ||
739 !dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &sub))
742 NULSTR_FOREACH(i, properties)
743 if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &i))
746 if (!dbus_message_iter_close_container(&iter, &sub))
753 dbus_message_unref(m);
758 uint32_t bus_flags_to_events(DBusWatch *bus_watch) {
764 /* no watch flags for disabled watches */
765 if (!dbus_watch_get_enabled(bus_watch))
768 flags = dbus_watch_get_flags(bus_watch);
770 if (flags & DBUS_WATCH_READABLE)
772 if (flags & DBUS_WATCH_WRITABLE)
775 return events | EPOLLHUP | EPOLLERR;
778 unsigned bus_events_to_flags(uint32_t events) {
781 if (events & EPOLLIN)
782 flags |= DBUS_WATCH_READABLE;
783 if (events & EPOLLOUT)
784 flags |= DBUS_WATCH_WRITABLE;
785 if (events & EPOLLHUP)
786 flags |= DBUS_WATCH_HANGUP;
787 if (events & EPOLLERR)
788 flags |= DBUS_WATCH_ERROR;
793 int bus_parse_strv(DBusMessage *m, char ***_l) {
794 DBusMessageIter iter;
799 if (!dbus_message_iter_init(m, &iter))
802 return bus_parse_strv_iter(&iter, _l);
805 int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l) {
807 unsigned n = 0, i = 0;
813 if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY ||
814 dbus_message_iter_get_element_type(iter) != DBUS_TYPE_STRING)
817 dbus_message_iter_recurse(iter, &sub);
819 while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
821 dbus_message_iter_next(&sub);
824 if (!(l = new(char*, n+1)))
827 dbus_message_iter_recurse(iter, &sub);
829 while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
832 assert_se(dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING);
833 dbus_message_iter_get_basic(&sub, &s);
835 if (!(l[i++] = strdup(s))) {
840 dbus_message_iter_next(&sub);
852 int bus_append_strv_iter(DBusMessageIter *iter, char **l) {
857 if (!dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "s", &sub))
861 if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, l))
864 if (!dbus_message_iter_close_container(iter, &sub))
870 int bus_iter_get_basic_and_next(DBusMessageIter *iter, int type, void *data, bool next) {
875 if (dbus_message_iter_get_arg_type(iter) != type)
878 dbus_message_iter_get_basic(iter, data);
880 if (!dbus_message_iter_next(iter) != !next)
886 int generic_print_property(const char *name, DBusMessageIter *iter, bool all) {
890 switch (dbus_message_iter_get_arg_type(iter)) {
892 case DBUS_TYPE_STRING: {
894 dbus_message_iter_get_basic(iter, &s);
896 if (all || !isempty(s))
897 printf("%s=%s\n", name, s);
902 case DBUS_TYPE_BOOLEAN: {
905 dbus_message_iter_get_basic(iter, &b);
906 printf("%s=%s\n", name, yes_no(b));
911 case DBUS_TYPE_UINT64: {
913 dbus_message_iter_get_basic(iter, &u);
915 /* Yes, heuristics! But we can change this check
916 * should it turn out to not be sufficient */
918 if (endswith(name, "Timestamp")) {
919 char timestamp[FORMAT_TIMESTAMP_MAX], *t;
921 t = format_timestamp(timestamp, sizeof(timestamp), u);
923 printf("%s=%s\n", name, strempty(t));
925 } else if (strstr(name, "USec")) {
926 char timespan[FORMAT_TIMESPAN_MAX];
928 printf("%s=%s\n", name, format_timespan(timespan, sizeof(timespan), u));
930 printf("%s=%llu\n", name, (unsigned long long) u);
935 case DBUS_TYPE_UINT32: {
937 dbus_message_iter_get_basic(iter, &u);
939 if (strstr(name, "UMask") || strstr(name, "Mode"))
940 printf("%s=%04o\n", name, u);
942 printf("%s=%u\n", name, (unsigned) u);
947 case DBUS_TYPE_INT32: {
949 dbus_message_iter_get_basic(iter, &i);
951 printf("%s=%i\n", name, (int) i);
955 case DBUS_TYPE_DOUBLE: {
957 dbus_message_iter_get_basic(iter, &d);
959 printf("%s=%g\n", name, d);
963 case DBUS_TYPE_ARRAY:
965 if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_STRING) {
969 dbus_message_iter_recurse(iter, &sub);
971 dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
974 while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
977 assert(dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING);
978 dbus_message_iter_get_basic(&sub, &s);
979 printf("%s%s", space ? " " : "", s);
982 dbus_message_iter_next(&sub);
990 } else if (dbus_message_iter_get_element_type(iter) == DBUS_TYPE_BYTE) {
993 dbus_message_iter_recurse(iter, &sub);
995 dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
998 while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
1001 assert(dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_BYTE);
1002 dbus_message_iter_get_basic(&sub, &u);
1005 dbus_message_iter_next(&sub);
1020 static void release_name_pending_cb(DBusPendingCall *pending, void *userdata) {
1022 DBusConnection *bus = userdata;
1024 assert_se(reply = dbus_pending_call_steal_reply(pending));
1025 dbus_message_unref(reply);
1027 dbus_connection_close(bus);
1030 void bus_async_unregister_and_exit(DBusConnection *bus, const char *name) {
1031 DBusMessage *m = NULL;
1032 DBusPendingCall *pending = NULL;
1036 /* We unregister the name here, but we continue to process
1037 * requests, until we get the response for it, so that all
1038 * requests are guaranteed to be processed. */
1040 m = dbus_message_new_method_call(
1043 DBUS_INTERFACE_DBUS,
1048 if (!dbus_message_append_args(
1055 if (!dbus_connection_send_with_reply(bus, m, &pending, -1))
1058 if (!dbus_pending_call_set_notify(pending, release_name_pending_cb, bus, NULL))
1061 dbus_message_unref(m);
1062 dbus_pending_call_unref(pending);
1067 log_error("Out of memory");
1070 dbus_pending_call_cancel(pending);
1071 dbus_pending_call_unref(pending);
1075 dbus_message_unref(m);
1078 DBusHandlerResult bus_exit_idle_filter(DBusConnection *bus, DBusMessage *m, void *userdata) {
1079 usec_t *remain_until = userdata;
1083 assert(remain_until);
1085 /* Everytime we get a new message we reset out timeout */
1086 *remain_until = now(CLOCK_MONOTONIC) + DEFAULT_EXIT_USEC;
1088 if (dbus_message_is_signal(m, DBUS_INTERFACE_LOCAL, "Disconnected"))
1089 dbus_connection_close(bus);
1091 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;