Skip to content

Commit

Permalink
Camera: use an empty app id in access dialog in case of invalid app id
Browse files Browse the repository at this point in the history
Sending an app id that doesn't resolve to valid app info (e.g. a desktop
file is not found) will automatically reject camera request, because the
backend is not able to verify whether the app (based on app id) runs in
the background. This happens for example when you start Firefox in GNOME
using Alt + F2 shortcut, where we get firefox" as app id from cgroups
and since it doesn't find opened application window for "firefox", it
automatically rejects the request. Using an empty id fixes this problem.
We still use the original app id if it's valid, because it's possible
that app info didn't resolve correctly in case the requesting app is
freshly installed and there is a race.
  • Loading branch information
grulja committed Nov 12, 2024
1 parent cb02780 commit 655bfd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ query_permission_sync (Request *request)

if (!xdp_dbus_impl_access_call_access_dialog_sync (access_impl,
request->id,
app_id,
xdp_is_valid_app_id (app_id) ? app_id : "",
"",
title,
"",
Expand Down

0 comments on commit 655bfd7

Please sign in to comment.