Update to 1.19.2

Resolves: RHEL-74556
This commit is contained in:
Jan Grulich 2025-01-21 08:36:38 +01:00
parent 66b896b48e
commit 8e99a57a1d
5 changed files with 3 additions and 2075 deletions

1
.gitignore vendored
View File

@ -48,3 +48,4 @@
/xdg-desktop-portal-1.18.2.tar.xz
/xdg-desktop-portal-1.18.4.tar.xz
/xdg-desktop-portal-1.19.1.tar.xz
/xdg-desktop-portal-1.19.2.tar.xz

View File

@ -1 +1 @@
SHA512 (xdg-desktop-portal-1.19.1.tar.xz) = c480cdc6fbbdeedbfe0e37ac463b6afa9127efa1b3e6c665c28e272c23f5d41e6f3f0e8e3c69c31d0829032a009bcf04643ba7f782332a3eccf591eca5c6dff4
SHA512 (xdg-desktop-portal-1.19.2.tar.xz) = 747b4788da5eb9db765389d20b70c8bd90e33dea5763888f09c7e031c92640cd4d231b925d61fe62a446040b6bc1ba3c2ca8e11a20e18585ddf0c4ebb8303864

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
%global pipewire_version 0.2.90
Name: xdg-desktop-portal
Version: 1.19.1
Version: 1.19.2
Release: %autorelease
Summary: Portal frontend service to flatpak
@ -17,12 +17,6 @@ License: LGPL-2.1-or-later
URL: https://github.com/flatpak/xdg-desktop-portal/
Source0: https://github.com/flatpak/xdg-desktop-portal/releases/download/%{version}/%{name}-%{version}.tar.xz
# Backport of webextensions portal
# PR: https://github.com/flatpak/xdg-desktop-portal/pull/1537
Patch0: xdg-desktop-portal-webextensions.patch
# Camera: Fix permission check in OpenPipeWireRemote
# https://github.com/flatpak/xdg-desktop-portal/pull/1576
Patch1: xdp-fix-permission-check-in-openpipewireremote.patch
BuildRequires: gcc
BuildRequires: gettext

View File

@ -1,81 +0,0 @@
From 316b950becdf4b7b3bd3f443955d890b1abee0db Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Wed, 15 Jan 2025 15:15:51 -0600
Subject: [PATCH] camera: fix permission check in OpenPipeWireRemote
6cd99b04d438b1de9b25c7bd928e541609904db3 changed the logic that the
camera portal uses to look up permissions for the AccessCamera method.
Applications first call AccessCamera to ensure they have camera
permission and to prompt the user if permission is missing, then they
call OpenPipeWireRemote, which fails if permission is missing. The
permission lookup logic needs to be the same in both places. Currently
when running Snapshot launched by GNOME Shell (rather than launched in a
terminal), Snapshot passes AccessCamera's permission check, then fails
OpenPipeWireRemote's permission check, causing camera access to be
denied without allowing the user to grant permission.
Also, since the same commit the code uses the XdpAppInfo on a secondary
thread. I suspect this is unsafe, and the original code avoided doing
so; therefore, let's be careful and move this logic to the main thread
so that the secondary thread only receives a copy of the app ID, as
before.
https://gitlab.gnome.org/GNOME/snapshot/-/issues/267
---
src/camera.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/camera.c b/src/camera.c
index 4224a0a7b..9b43b36d8 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -78,11 +78,7 @@ query_permission_sync (XdpRequest *request)
const char *app_id;
gboolean allowed;
- if (xdp_app_info_is_host (request->app_info))
- app_id = "";
- else
- app_id = (const char *)g_object_get_data (G_OBJECT (request), "app-id");
-
+ app_id = (const char *)g_object_get_data (G_OBJECT (request), "app-id");
permission = xdp_get_permission_sync (app_id, PERMISSION_TABLE, PERMISSION_DEVICE_CAMERA);
if (permission == XDP_PERMISSION_ASK || permission == XDP_PERMISSION_UNSET)
{
@@ -190,6 +186,16 @@ handle_access_camera_in_thread_func (GTask *task,
}
}
+static const char *
+app_id_from_app_info (XdpAppInfo *app_info)
+{
+ /* Automatically grant camera access to unsandboxed apps. */
+ if (xdp_app_info_is_host (app_info))
+ return "";
+
+ return xdp_app_info_get_id (app_info);
+}
+
static gboolean
handle_access_camera (XdpDbusCamera *object,
GDBusMethodInvocation *invocation,
@@ -211,9 +217,7 @@ handle_access_camera (XdpDbusCamera *object,
REQUEST_AUTOLOCK (request);
- app_id = xdp_app_info_get_id (request->app_info);
-
-
+ app_id = app_id_from_app_info (request->app_info);
g_object_set_data_full (G_OBJECT (request), "app-id", g_strdup (app_id), g_free);
xdp_request_export (request, g_dbus_method_invocation_get_connection (invocation));
@@ -288,7 +292,7 @@ handle_open_pipewire_remote (XdpDbusCamera *object,
}
app_info = xdp_invocation_lookup_app_info_sync (invocation, NULL, &error);
- app_id = xdp_app_info_get_id (app_info);
+ app_id = app_id_from_app_info (app_info);
permission = xdp_get_permission_sync (app_id, PERMISSION_TABLE, PERMISSION_DEVICE_CAMERA);
if (permission != XDP_PERMISSION_YES)
{