From 69843ce54c22c16ef4ef2b5e8d70092ba2ffdb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= Date: Fri, 13 Sep 2024 19:11:45 -0400 Subject: [PATCH] usb: If not sandboxed, assume all devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hubert Figuière --- src/xdp-app-info-host.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/xdp-app-info-host.c b/src/xdp-app-info-host.c index 4520d800c..03fddf206 100644 --- a/src/xdp-app-info-host.c +++ b/src/xdp-app-info-host.c @@ -55,6 +55,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 = @@ -66,6 +68,20 @@ xdp_app_info_host_init (XdpAppInfoHost *app_info_host) { } +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); +} + #ifdef HAVE_LIBSYSTEMD char * _xdp_app_info_host_parse_app_id_from_unit_name (const char *unit)