storaged-project / udisks

The UDisks project provides a daemon, tools and libraries to access and manipulate disks, storage devices and technologies.
https://storaged.org/doc/udisks2-api/latest/
Other
348 stars 142 forks source link

[feature request] Allow mount not for one user,but for a group #1279

Open 3036662 opened 6 months ago

3036662 commented 6 months ago

Normally, run/media/$user is created, and ACL is set for a user. Do you consider the possibility of creating an ACL for $group or user/group? It would be nice to have a way to mount one USB drive, not for all users or one user, but for a group( for example /run/media/$GROUP) by calling some dbus method MountOnGroupBehalf(group).

tbzatek commented 6 months ago

I don't have precise answer for ACLs, but you may try experimenting with different mount options like umask, dmask, fmask, mode, dmode and gid=. Also, there are number of flags that can be set via udev rules on a block device, such as UDISKS_FILESYSTEM_SHARED.

Alternatively, you may try to put a record in /etc/fstab with your own mount options.

3036662 commented 6 months ago

The point is that Udisks allow you to mount devices either in /run/media/$USER + acl or in /media (UDISKS_FILESYSTEM_SHARED). In order to allow a group of users to use the device, you need an ACL for the group/user. Mounting options are not quite suitable for this task since not all file systems support such options. Using Fstab for USB sticks is, in my opinion, not the right approach. To solve this problem, we use a third-party daemon (libacl and glibc-mount calls). I would like to keep the whole mounting mechanism using udisks,to keep things consistent. I wanted to ask if there is an opportunity to consider expanding the functionality in this direction. We can help with the development, if this area is at all interesting.