** Description changed:

- Tested on Ubuntu 26.10, XPS 13 (9350)
- Relevant packages installed:
- - apparmor 6.0.0~alpha1-0ubuntu4
- - loupe 50.0-0ubuntu2
+ [ Impact ]
  
  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.
+ The abstraction itself should use the correct
+ path=/org/freedesktop/portal/documents
  
  Loupe's stderr:
  Gtk-WARNING **: Failed to receive drop data: 
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Sender is not authorized 
to send message
  
+ [ Test Plan ]
  
- 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:
+ 1. Open Loupe on its own (ie. without an image).
+ 2. Drag an image file from Files onto the Loupe window and drop it.
+ 3. Verify that the image opens.
  
-   dbus send
-        bus=session
-        path=/org/freedesktop/portal/documents
-        interface=org.freedesktop.portal.FileTransfer
-        member={StartTransfer,AddFiles,RetrieveFiles,StopTransfer},
+ [ Where problems could occur ]
  
-   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.
+ The patch modifies the abstractions/dbus-xdg/portal-file-transfer abstraction.
+ Problems would manifest in programs confined with AppArmor profiles that use 
such abstraction, currently only Loupe.

-- 
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