From 91159c7e1ae5ab2d8ee3f211c1a931dd13eccf89 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Mon, 13 May 2024 14:05:00 +0200 Subject: [PATCH] Whitelist properties and peer calls --- flatpak-proxy.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/flatpak-proxy.c b/flatpak-proxy.c index aea7a55..334168f 100644 --- a/flatpak-proxy.c +++ b/flatpak-proxy.c @@ -1924,11 +1924,27 @@ is_dbus_method_call (Header *header) } static gboolean -is_introspection_call (Header *header) +is_properties_call (Header *header) { return header->type == G_DBUS_MESSAGE_TYPE_METHOD_CALL && - g_strcmp0 (header->interface, "org.freedesktop.DBus.Introspectable") == 0; + g_strcmp0 (header->interface, "org.freedesktop.DBus.Properties") == 0; +} + +static gboolean +is_introspection_call (Header *header) +{ + return + header->type == G_DBUS_MESSAGE_TYPE_METHOD_CALL && + g_strcmp0 (header->interface, "org.freedesktop.DBus.Introspectable") == 0; +} + +static gboolean +is_peer_call (Header *header) +{ + return + header->type == G_DBUS_MESSAGE_TYPE_METHOD_CALL && + g_strcmp0 (header->interface, "org.freedesktop.DBus.Peer") == 0; } static BusHandler @@ -1970,7 +1986,7 @@ get_dbus_method_handler (FlatpakProxyClient *client, Header *header) /* Its a bus call */ - if (is_introspection_call (header)) + if (is_properties_call (header) || is_introspection_call (header) || is_peer_call (header)) { return HANDLE_PASS; }