Public bug reported:

Tested on Ubuntu 26.10, XPS 13 (9350)
Relevant packages installed:
- apparmor 6.0.0~alpha1-0ubuntu4
- loupe 50.0-0ubuntu2

On Ubuntu 26.10, dropping an image file (e.g. from Files) onto a Loupe
window does nothing. The drop highlight appears, but no image is opened.

It is found that the new loupe profile includes abstractions/dbus-
xdg/portal-file-transfer. That abstraction allows the
org.freedesktop.portal.FileTransfer methods only on the object path
/org/freedesktop/portal/desktop. However, FileTransfer is implemented by
xdg-document-portal (bus name org.freedesktop.portal.Documents) on the
path /org/freedesktop/portal/documents. GTK 4 calls RetrieveFiles there
when it receives a drop, so the call is denied and GTK discards the drop
data.


Steps to reproduce:
-------------------
1. Open Loupe on its own (ie. without an image).
2. Drag an image file from Files onto the Loupe window and drop it.

Expected: the image opens.
Actual: nothing happens.

Loupe's stderr:
Gtk-WARNING **: Failed to receive drop data: 
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Sender is not authorized 
to send message


Workaround / suggested fix: 
----------------------------
Allow the same rules on the documents path. Adding this file through the 
abstraction's existing include directory, as 
/etc/apparmor.d/abstractions/dbus-xdg/portal-file-transfer.d/documents-path, 
and reloading the profile makes drag-and-drop work:

  dbus send
       bus=session
       path=/org/freedesktop/portal/documents
       interface=org.freedesktop.portal.FileTransfer
       member={StartTransfer,AddFiles,RetrieveFiles,StopTransfer},

  dbus receive
       bus=session
       path=/org/freedesktop/portal/documents
       interface=org.freedesktop.portal.FileTransfer
       member=TransferClosed,

The abstraction itself should probably use
path=/org/freedesktop/portal/documents, or allow both paths.

** Affects: apparmor (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: loupe (Ubuntu)
     Importance: Undecided
         Status: New

** Summary changed:

- portal-file-transfer abstraction allows FileTransfer on the wrong object path 
- Loupe drag-and-drop breaks
+ Loupe drag-and-drop breaks due to AppArmor allowing FileTransfer on the wrong 
path

** Also affects: loupe (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2171366

Title:
  Loupe drag-and-drop breaks due to AppArmor allowing FileTransfer on
  the wrong path

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2171366/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to