External storage devices plugged into a particular seat are attempted to be mounted on all seats
This issue manifests itself in multi-seat setups.
Steps to reproduce:
- Configure a machine to use at least 2 hardware seats with USB ports assigned to each, via udev/loginctl/....
- Log in to any DE which makes use of gvfs (GNOME, MATE, ...) on both seats as different users.
- Plug in a USB mass storage device to a USB port attached to a particular seat (verify via udev properties: ID_SEAT should be correct or missing if
seat0
); We'll refer to it asseat-A
. - Observe the
gvfs-udisks-volume-monitor
s of the (at least 2) active sessions trying to mount the device in a racy fashion, calling the methodMount
of the interfaceorg.freedesktop.UDisks2.Filesystem
on the block device.
If polkit mandates authorisation through a polkit agent (action id org.freedesktop.udisks2.filesystem-mount
on the seat seat-A
and org.freedesktop.udisks2.filesystem-mount-other-seat
on other seats), an auth-agent prompt pops up on a random seat (whichever method call was first to be processed). If it is dismissed, it pops again on a different seat, and so on on every seat. The exact behaviour generally depends on polkit rules (e. g. if polkit rules unconditionally allow to mount the filesystem, it will be mounted by a session on a random seat no matter the seat it is plugged in)
Forbidding device mounts on all seats via polkit rules (like return polkit.Result.NO
) does not help, because the polkit agents still spawn a dialog (telling the user they are not authorized) on all seats.
Expected behaviour: The volume monitors do not attempt to automatically mount UDisks drives from other seats.