When subscribing to the D-Bus signal NameOwnerChanged from the bus driver,
specify the object path and the sender in the match rule. Otherwise, random
connections on the bus could impersonate the bus driver.

This patch applies to connman, ofono and pacrunner.
---
 gdbus/watch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdbus/watch.c b/gdbus/watch.c
index 0f99f4f..415e7fa 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -699,7 +699,8 @@ guint g_dbus_add_service_watch(DBusConnection *connection, 
const char *name,
        if (name == NULL)
                return 0;
 
-       data = filter_data_get(connection, service_filter, NULL, NULL,
+       data = filter_data_get(connection, service_filter,
+                               DBUS_SERVICE_DBUS, DBUS_PATH_DBUS,
                                DBUS_INTERFACE_DBUS, "NameOwnerChanged",
                                name);
        if (data == NULL)
-- 
1.8.5.3

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to