From f4c4bdb33de8b93f74fcbf32bee2842eee2362fe Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 27 Jan 2022 02:28:37 +0000 Subject: [PATCH] dbus: properly handle object path Previously we reply to requests sent to _any_ object path, even though we only declare /com/github/chjj/compton. This commit makes sure we only reply to request sent to the right path. Signed-off-by: Yuxuan Shui --- src/dbus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dbus.c b/src/dbus.c index d9f01fb..b87f556 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -179,7 +179,9 @@ bool cdbus_init(session_t *ps, const char *uniq) { dbus_error_free(&err); goto fail; } - dbus_connection_add_filter(cd->dbus_conn, cdbus_process, ps, NULL); + dbus_connection_register_object_path( + cd->dbus_conn, CDBUS_OBJECT_NAME, + (DBusObjectPathVTable[]){{NULL, cdbus_process}}, ps); return true; fail: ps->dbus_data = NULL;