Skip to content

Commit

Permalink
usb: Change terminology for USB
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Figuière <[email protected]>
  • Loading branch information
hfiguiere committed Aug 15, 2024
1 parent 19df3c5 commit 74f9508
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/xdp-app-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,40 +1845,40 @@ xdp_app_info_get_usb_queries (XdpAppInfo *app_info)
{
case XDP_APP_INFO_KIND_FLATPAK:
{
g_auto(GStrv) allowed_devices = NULL;
g_auto(GStrv) blocked_devices = NULL;
g_auto(GStrv) enumerable_devices = NULL;
g_auto(GStrv) hidden_devices = NULL;

allowed_devices = g_key_file_get_string_list (app_info->u.flatpak.keyfile,
enumerable_devices = g_key_file_get_string_list (app_info->u.flatpak.keyfile,
"USB Devices",
"allowed-devices",
NULL, NULL);

for (size_t i = 0; allowed_devices && allowed_devices[i] != NULL; i++)
for (size_t i = 0; enumerable_devices && enumerable_devices[i] != NULL; i++)
{
g_autoptr(XdpUsbQuery) query =
xdp_usb_query_from_string (XDP_USB_QUERY_TYPE_ALLOW, allowed_devices[i]);
xdp_usb_query_from_string (XDP_USB_QUERY_TYPE_ALLOW, enumerable_devices[i]);

if (query)
g_ptr_array_add (usb_queries, g_steal_pointer (&query));
}

blocked_devices = g_key_file_get_string_list (app_info->u.flatpak.keyfile,
hidden_devices = g_key_file_get_string_list (app_info->u.flatpak.keyfile,
"USB Devices",
"blocked-devices",
NULL, NULL);

for (size_t i = 0; blocked_devices && blocked_devices[i] != NULL; i++)
for (size_t i = 0; hidden_devices && hidden_devices[i] != NULL; i++)
{
g_autoptr(XdpUsbQuery) query =
xdp_usb_query_from_string (XDP_USB_QUERY_TYPE_BLOCK, blocked_devices[i]);
xdp_usb_query_from_string (XDP_USB_QUERY_TYPE_BLOCK, hidden_devices[i]);

if (query)
g_ptr_array_add (usb_queries, g_steal_pointer (&query));
}

g_message ("Found %d allowlists and %d blocks for app %s",
allowed_devices ? g_strv_length (allowed_devices) : 0,
blocked_devices ? g_strv_length (blocked_devices) : 0,
g_message ("Found %d enumerable and %d hidden for app %s",
enumerable_devices ? g_strv_length (enumerable_devices) : 0,
hidden_devices ? g_strv_length (hidden_devices) : 0,
xdp_app_info_get_id (app_info));
}
break;
Expand Down

0 comments on commit 74f9508

Please sign in to comment.