WIP: udisks2: Include only direct subdirectories of /media
Currently, all mounts with /media
prefix are returned from the volume
monitor (except those with x-gvfs-hide
, or dot at the beginning). However,
some distributions don't use /run/media/$USER
, but /media/$USER
as
the default prefix. Consequently, the volume monitor also returns mounts
that are not accessible as they belong to other users, which is wrong.
It would be ideal to check the mounts using e.g. access (mount_path, R_OK)
,
but this would automount autofs mounts, or would possibly hang on stale NFS
mounts. Let's skip mounts that are not direct subdirectories of /mount
with an exception for /media/$USER
and those with x-gvfs-show
to fix
this issue.