Skip to content

Commit

Permalink
usb: If not sandboxed, assume all devices
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Figuière <[email protected]>
  • Loading branch information
hfiguiere committed Sep 14, 2024
1 parent 6d36a8d commit 4dcfc94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/xdp-app-info-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ struct _XdpAppInfoHost

G_DEFINE_FINAL_TYPE (XdpAppInfoHost, xdp_app_info_host, XDP_TYPE_APP_INFO)

static GPtrArray *
xdp_app_info_host_get_usb_queries (XdpAppInfo *app_info)
{
g_autoptr(GPtrArray) usb_queries = NULL;

usb_queries = g_ptr_array_new_with_free_func ((GDestroyNotify) xdp_usb_query_free);
g_autoptr(XdpUsbQuery) query =
xdp_usb_query_from_string (XDP_USB_QUERY_TYPE_ALLOW, "all");
if (query)
g_ptr_array_add (usb_queries, g_steal_pointer (&query));

return g_steal_pointer (&usb_queries);
}

gboolean
xdp_app_info_host_validate_autostart (XdpAppInfo *app_info,
GKeyFile *keyfile,
Expand All @@ -55,6 +69,8 @@ xdp_app_info_host_class_init (XdpAppInfoHostClass *klass)
{
XdpAppInfoClass *app_info_class = XDP_APP_INFO_CLASS (klass);

app_info_class->get_usb_queries =
xdp_app_info_host_get_usb_queries;
app_info_class->validate_autostart =
xdp_app_info_host_validate_autostart;
app_info_class->validate_dynamic_launcher =
Expand Down

0 comments on commit 4dcfc94

Please sign in to comment.