From cf3e247193b49c1907dd85b74f0de1530948016c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jun 2010 02:46:07 +0200 Subject: [PATCH] dbus: tighten match rules a bit --- src/dbus.c | 9 ++++++--- src/dbus.h | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index a14dbda9..69ed641e 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -332,7 +332,7 @@ static void bus_toggle_timeout(DBusTimeout *timeout, void *data) { log_error("Failed to rearm timer: %s", strerror(-r)); } -static DBusHandlerResult api_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) { +static DBusHandlerResult api_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) { Manager *m = data; DBusError error; DBusMessage *reply = NULL; @@ -438,7 +438,7 @@ oom: return DBUS_HANDLER_RESULT_NEED_MEMORY; } -static DBusHandlerResult system_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) { +static DBusHandlerResult system_bus_message_filter(DBusConnection *connection, DBusMessage *message, void *data) { Manager *m = data; DBusError error; @@ -457,7 +457,7 @@ static DBusHandlerResult system_bus_message_filter(DBusConnection *connection, log_error("Warning! System D-Bus connection terminated."); bus_done_system(m); - } if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) { + } else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) { const char *cgroup; if (!dbus_message_get_args(message, &error, @@ -733,6 +733,7 @@ int bus_init_system(Manager *m) { dbus_bus_add_match(m->system_bus, "type='signal'," "interface='org.freedesktop.systemd1.Agent'," + "member='Released'," "path='/org/freedesktop/systemd1/agent'", &error); @@ -798,6 +799,7 @@ int bus_init_api(Manager *m) { "type='signal'," "sender='"DBUS_SERVICE_DBUS"'," "interface='"DBUS_INTERFACE_DBUS"'," + "member='NameOwnerChange'," "path='"DBUS_PATH_DBUS"'", &error); @@ -813,6 +815,7 @@ int bus_init_api(Manager *m) { "type='signal'," "sender='"DBUS_SERVICE_DBUS"'," "interface='org.freedesktop.systemd1.Activator'," + "member='ActivationRequest'," "path='"DBUS_PATH_DBUS"'", &error); diff --git a/src/dbus.h b/src/dbus.h index 3ad299ed..264bdff6 100644 --- a/src/dbus.h +++ b/src/dbus.h @@ -37,23 +37,23 @@ typedef struct BusProperty { } BusProperty; #define BUS_PROPERTIES_INTERFACE \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ " \n" \ - " \n" \ + " \n" \ " \n" #define BUS_INTROSPECTABLE_INTERFACE \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ " \n" int bus_init_system(Manager *m); -- 2.39.5