Bug 739842

Summary: mounted encrypted disk is automatically owned by root
Product: [Fedora] Fedora Reporter: Martin Stransky <stransky>
Component: udisksAssignee: David Zeuthen <davidz>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: davidz, mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-20 14:52:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Stransky 2011-09-20 08:03:45 UTC
Description of problem:

Unencrypted disks (FAT/ext4) are mounted to /media and owned by used. Encrypted disk is mounted and owned by root.

I have one flash disk with unencrypted FAT and encrypted EXT4 patrices. It's mounted as:

/dev/sdf2 on /media/data type vfat (rw,nosuid,nodev,relatime,uid=500,gid=500,fmask=0022,dmask=0077,codepage=cp437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks)

/dev/mapper/udisks-luks-uuid-40dc1435-577a-4289-8ae3-855d4b4f67f0-uid500 on /media/data1 type ext4 (rw,nosuid,nodev,relatime,seclabel,user_xattr,acl,barrier=1,data=ordered,uhelper=udisks)

[komat@localhost media]$ ll /media
drwx------.  2 komat komat 4096 Sep 20 09:51 data
drwxr-xr-x.  4 root  root  4096 Sep 20 09:53 data1

Version-Release number of selected component (if applicable):
udisks-1.0.3-3.fc15.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Plug in the flash with such patrices
2.
3.

Comment 1 David Zeuthen 2011-09-20 14:52:47 UTC
If I understand your bug report correctly, this is just how it's supposed to work since ext4 records owner/group and mode in the filesystem itself and FAT doesn't. This means that if a filesystem is mounted, for ext4 you will see whatever owner/mode that is on disk, and for FAT the kernel will use the uid/gid passed as mount options.

You can solve the reported problem simply by chown'ing the top-level directory on the ext4 filesystem.

Btw, this is why Palimpsest has a "Take ownership of filesystem" checkbox when using a filesystem with permissions, see e.g.

 http://people.freedesktop.org/~david/palimpsest-ext-take-ownership.png

Closing as NOTABUG.