Created attachment 32288 [details] devkit-disks --dump I've tried to set permissions for files on vfat partition on a usb key: $ ls -l /dev/sdb1 brw-rw---- 1 root storage 8, 17 Dec 24 18:59 /dev/sdb1 For that purpose I've created directory /media/wf: $ ls -ld /media/wf drwxrwxr-x 2 root storage 4096 Dec 24 19:27 /media/wf And I've added following line to /etc/fstab: UUID=6CBD-D6FF /media/wf vfat group,uid=0,gid=95,umask=0113,fmask=0113,dmask=0002,shortname=mixed,utf8=1,flush 0 0 After that I'm able to mount my partition using mount (unmounts well too), but if I invoke devkit-disks, it fails: $ devkit-disks --mount /dev/sdb1 Mount failed: Error mounting: mount exited with exit code 1: helper failed with: mount: only root can mount /dev/sdb1 on /media/wf If I change 'group' option in fstab to 'user' or 'users' keyword all works fine. I've used DeviceKit-Disks 009, but I didn't see any bags or commit messages on this problem. Line from /proc/self/mountinfo after 'mount /dev/sdb1': 22 14 8:17 / /media/wf rw,nosuid,nodev,noexec,relatime - vfat /dev/sdb1 rw,gid=95,fmask=0113,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,flush,errors=remount-ro
Yeah, looks like src/helpers/job-fstab-mounter.c is missing setgroup(), initgroups() and a lot of other stuff needed when becoming the user.
Created attachment 46605 [details] [review] Patch to correctly set user's groups My use-case is wanting to do rsync-backups to an external drive with ntfs on it... for that I need the "permissions" ntfs-3g mount option, added that in a line to fstab but udisks wasnt working then since my membership in the "disk" group is what gives me access to the block device. This fixes the issue for me... happy happy :)
Development focus is on udisks 2.0 which is a completely different codebase. The good news is that in 2.0, this should work out of the box ... e.g. unless you use the option x-udisks-auth we simply run "mount /dev/sda2" as root after ensuring the caller has the appropriate org.freedesktop.udisks2.filesystem-mount* authorization. So closing as FIXED, please reopen if it doesn't work for you.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.