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 <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-01-27 02:28:37 +00:00
parent b4e0e6128c
commit f4c4bdb33d
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 3 additions and 1 deletions

View File

@ -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;