Bug 25792 - devkit-disks doesn't mount partition with 'group' option in fstab
Summary: devkit-disks doesn't mount partition with 'group' option in fstab
Status: RESOLVED FIXED
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-24 13:07 UTC by Anton Leontiev
Modified: 2012-09-28 17:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
devkit-disks --dump (17.27 KB, text/plain)
2009-12-24 13:07 UTC, Anton Leontiev
Details
Patch to correctly set user's groups (1.27 KB, patch)
2011-05-11 08:11 UTC, simonop
Details | Splinter Review

Description Anton Leontiev 2009-12-24 13:07:55 UTC
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
Comment 1 David Zeuthen (not reading bugmail) 2010-01-04 13:28:01 UTC
Yeah, looks like src/helpers/job-fstab-mounter.c is missing setgroup(), initgroups() and a lot of other stuff needed when becoming the user.
Comment 2 simonop 2011-05-11 08:11:47 UTC
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 :)
Comment 3 David Zeuthen (not reading bugmail) 2012-09-28 17:34:18 UTC
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.