Thomas Blume changed bug 1089408
What Removed Added
Flags   needinfo?(studio@anchev.net)

Comment # 9 on bug 1089408 from
(In reply to George Anchev from comment #7)
> OK. I have set in /etc/fstab:
> 
> /dev/sdf1 /run/media/ exfat
> rw,nodev,nosuid,noatime,uid=1000,gid=100,iocharset=utf8,errors=remount-ro,
> dmask=0077,fmask=1177
> 
> It gives the default permissions which I think are both secure and usable.
> 
> There are 2 problems with that:
> 
> 1. It hard codes the uid and gid which may be OK for a single user system
> but obviously won't work for multiple users.

Instead of hardcoding uid and gid, you could just add the option user, e.g.:

/dev/sdf1 /run/media/ exfat
rw,nodev,nosuid,noatime,user,iocharset=utf8,errors=remount-ro,dmask=0077,fmask=1177

That way you can mount it as non-root user which automatically gives you the
correct uid,gid.

It is also possible to give the mount options directly to udisksctl, e.g.:

udisksctl mount --block-device /dev/sdf1 --options dmask=0077,fmask=1177

> 2. The combination 'rw,errors=remount-ro' makes it remount correctly as ro
> in case of write protected memory card but that is not reflected in the
> permissions. Of course permission-wise it is safe but still that's a
> usability issue.

Does this also happen when you do a user mount as suggested above?

> BTW I don't know why but /proc/mounts shows user_id and group_id 0, which is
> not what fstab instructs:
> 
> /dev/sdf1 /run/media fuseblk
> ro,nosuid,nodev,noatime,user_id=0,group_id=0,default_permissions,allow_other,
> blksize=4096 0 0
> /dev/sdf1 /var/run/media fuseblk
> ro,nosuid,nodev,noatime,user_id=0,group_id=0,default_permissions,allow_other,
> blksize=4096 0 0
> 
> Still ls shows that files and dirs are owned by uid=1000 and gid=100. I
> don't know if that is another bug.

Again, is this also shown when you do a user mount?


You are receiving this mail because: