Skip to content

Commit

Permalink
Propagate error on invalid app info
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuntu committed Aug 29, 2023
1 parent 10e48cd commit 158d732
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/xdp-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2155,15 +2155,22 @@ app_info_map_pids (XdpAppInfo *app_info,
{
for (int i = 0; i < n_pids; i++)
{
XdpAppInfo *info = xdp_get_app_info_from_pid(pids[i], error);
if (strcmp(info->id, app_info->id) != 0 || info->kind != app_info->kind)
g_autoptr(GError) local_error = NULL;
XdpAppInfo *info = xdp_get_app_info_from_pid (pids[i], &local_error);
if (!info)
{
g_propagate_prefixed_error (error, g_steal_pointer (&local_error),
"Can't find app for pid %i: ", pids[i]);
return FALSE;
}

if (info->kind != app_info->kind || g_strcmp0 (info->id, app_info->id) != 0)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
"App info of pids do not match.");
"App info from pid does not match.");
return FALSE;
}
}

return TRUE;
}
else if (app_info->kind != XDP_APP_INFO_KIND_FLATPAK)
Expand Down

0 comments on commit 158d732

Please sign in to comment.