Automounted exfat-fuse has root:root ownership

1,241 views
Skip to first unread message

Ian Abbott

unread,
Oct 26, 2013, 5:19:48 PM10/26/13
to ex...@googlegroups.com
Hi folks,

When automounting a exFAT filesystem on a removable device in the GNOME
desktop (or using gvfs-mount), all the files and directories are owned
by root:root with permissions 755. This effectively makes the filesystem
read-only for the ordinary, active desktop user who plugged in the
device (the effective user of gvfs-mount). This contrasts sharply with a
removable device containing a FAT32 filesystem, where the files and
directories are owned by the user who mounted the filesystem.

Note: I am using a current Debian testing ("Jessie") system, but recent
Ubuntu releases 13.04 onwards seem to have the same problem.


Here is what I see when I plug in a USB flash drive with an exFAT
filesystem:

$ ls -ld /media/user/EXFAT-DRIVE
drwxr-xr-x 1 root root 131072 Jan 1 1970 /media/user/EXFAT-DRIVE
$ ls -l /media/user/EXFAT-DRIVE
total 768
-rwxr-xr-x 1 root root 92 Jul 20 2011 Autorun.inf
drwxr-xr-x 1 root root 131072 Oct 23 10:29 Documents
-rwxr-xr-x 1 root root 354728 Feb 13 2012 program.exe

For contrast, this is what I see for a USB flash drive containing a
FAT32 filesystem:

$ ls -ld /media/user/FAT32-DRIVE
drwx------ 12 user user 4096 Jan 1 1970 /media/user/FAT32-DRIVE
$ ls -l /media/user/FAT32-DRIVE
total 300816
-rw-r--r-- 1 user user 92 Jul 20 2011 Autorun.inf
drwx------ 1 user user 131072 Oct 23 10:29 Documents
-rwxr-xr-x 1 user user 354728 Feb 13 2012 program.exe

(I have edited the details a for illustrative purposes. It's interesting
that the executable bits of files on the FAT32 system depend on some
pattern-matching on the filename, but that's not important.)

$ mount
...
/dev/sdc1 on /media/user/EXFAT-DRIVE type fuseblk
(rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/sdd1 on /media/user/FAT32-DRIVE type vfat
(rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

It's also interesting that a lot of options have been automatically
passed to mount when mounting the drive with the FAT32 filesystem, but
the options when mounting the drive with the exFAT system are much more
sparse. Perhaps the thing that passes the options doesn't know about
exFAT yet. The options passed to fuse look wrong anyway.

Ian Abbott

unread,
Oct 26, 2013, 5:31:07 PM10/26/13
to ex...@googlegroups.com
On 26/10/13 22:19, Ian Abbott wrote:
> $ mount
> ...
> /dev/sdc1 on /media/user/EXFAT-DRIVE type fuseblk
> (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
> /dev/sdd1 on /media/user/FAT32-DRIVE type vfat
> (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
>
> It's also interesting that a lot of options have been automatically
> passed to mount when mounting the drive with the FAT32 filesystem, but
> the options when mounting the drive with the exFAT system are much more
> sparse. Perhaps the thing that passes the options doesn't know about
> exFAT yet. The options passed to fuse look wrong anyway.

A quick follow-up. The options passed for the exFAT filesystem are the
same as those passed for an NTFS filesystem mounted in the same way.
Possibly not too surprising as they both use partition type '7'.
However, the automounted NTFS drive has everything owned by user:user
(the user and group that mounted it) with permissions 600 for files and
700 for directories.

Ian Abbott

unread,
Oct 26, 2013, 5:32:39 PM10/26/13
to ex...@googlegroups.com
[Sorry, resending as I sent it from the wrong address. :) ]

On 26/10/13 22:19, Ian Abbott wrote:
> $ mount
> ...
> /dev/sdc1 on /media/user/EXFAT-DRIVE type fuseblk
> (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
> /dev/sdd1 on /media/user/FAT32-DRIVE type vfat
> (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
>
> It's also interesting that a lot of options have been automatically
> passed to mount when mounting the drive with the FAT32 filesystem, but
> the options when mounting the drive with the exFAT system are much more
> sparse. Perhaps the thing that passes the options doesn't know about
> exFAT yet. The options passed to fuse look wrong anyway.

Andrew Nayenko

unread,
Oct 27, 2013, 3:56:55 AM10/27/13
to ex...@googlegroups.com, i...@abbott.org
Hi Ian,

On my system (Fedora 19, GNOME 3.8) automounted volume options are the
same, all files are owned by root:root too, but volume is fully
accessible for current user:

/dev/sdc1 /run/media/relan/EXFAT-DRIVE fuseblk
rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0

fuse-exfat uses 'allow_other' FUSE option to allow all users access (see
https://www.kernel.org/doc/Documentation/filesystems/fuse.txt). And this
works fine in Fedora. Maybe Debian security policy prohibits this FUSE
option and requires explicit setting of uid/gid?
--
Andrew Nayenko <res...@gmail.com>

Ian Abbott

unread,
Oct 27, 2013, 8:36:29 AM10/27/13
to Andrew Nayenko, ex...@googlegroups.com
On 27/10/13 07:56, Andrew Nayenko wrote:
> Hi Ian,
>
> On my system (Fedora 19, GNOME 3.8) automounted volume options are the
> same, all files are owned by root:root too, but volume is fully
> accessible for current user:
>
> /dev/sdc1 /run/media/relan/EXFAT-DRIVE fuseblk
> rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
>
> fuse-exfat uses 'allow_other' FUSE option to allow all users access (see
> https://www.kernel.org/doc/Documentation/filesystems/fuse.txt). And this
> works fine in Fedora. Maybe Debian security policy prohibits this FUSE
> option and requires explicit setting of uid/gid?

Thanks Andrew. I set the 'user_allow_other' option in /etc/fuse.conf and
now it works exactly as you described. It would be nice if it worked
without this option (as it does for NTFS fuseblk where everything in the
mounted filesystem is owned by the user), but I can live with this.
Reply all
Reply to author
Forward
0 new messages