Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitelist properties and peer calls #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions flatpak-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
TingPing marked this conversation as resolved.
Show resolved Hide resolved
}

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
Expand Down Expand Up @@ -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;
}
Expand Down