You are not logged in.

#1 2014-04-10 09:42:51

XZS
Member
Registered: 2011-05-11
Posts: 30

Udisks permissions when mounting images

I often deal with raw disk images mounted via loop devices. Recently, I found out that they can be managed without root privileges using udisks. For testing purposes, I created created and formatted an image like so:

dd if=/dev/urandom of=img.img bs=1M count=16
mkfs.ext4 img.img

Then I now mount it using udisks

udisksctl loop-setup -f img.img

This works fine so far. The device shows up in any file manager, I can access via its mountpoint in /run,  just like any local hard drive managed by udisks,. Only the permissions are not what I expected.

ls -l /run/media/$USER/
drwxr-xr-x 3 root  root   1024 Apr 10 11:19 [some id]
drwx------ 1 auser auser 12288 Oct 30  2012 [a device label]

The first one listed is the loop device, owned by root and not writable by anybody else. The second one is a local hard drive or an USB pen device, belonging to the user who mounted it. I know that I could fix this with a simple chmod executed as root. But why does udisks assign different permissions and owners? Can it be configured to do otherwise?

Last edited by XZS (2014-04-13 21:33:07)

Offline

Board footer

Powered by FluxBB