Skip to content

Commit

Permalink
app-info/host: Only use the cgroup app id if we have a matching GAppInfo
Browse files Browse the repository at this point in the history
This should prevent cases where the connection is from something that's
not actually an app but follows the systemd cgroup standard.

This is safe because
* it's a host app anyway
* we always use an empty app id when x-d-p is built without systemd
* it's the default when the systemd cgroup standard is not followed
  • Loading branch information
swick committed Dec 3, 2024
1 parent 7fcc976 commit 831a6c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/xdp-app-info-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ xdp_app_info_host_new (int pid,
desktop_id = g_strconcat (appid, ".desktop", NULL);
gappinfo = G_APP_INFO (g_desktop_app_info_new (desktop_id));

if (!gappinfo)
{
g_clear_pointer (&desktop_id, g_free);
desktop_id = g_strdup ("");
}

app_info_host = g_object_new (XDP_TYPE_APP_INFO_HOST, NULL);
xdp_app_info_initialize (XDP_APP_INFO (app_info_host),
/* engine, app id, instance */
Expand Down

0 comments on commit 831a6c7

Please sign in to comment.