writeable automounted partition with device file mode 0000

Bug #742751 reported by jippie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udisks (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: kdebase

I configured udev in such a way, that one particular external USB drive I own attaches to the system without read/write permissions.

 $ ls -ltr /dev/sdj* /dev/mydisk-*
 brw-rw---- 1 jhendrix vboxusers 8, 144 2011-03-25 20:44 /dev/sdj
 lrwxrwxrwx 1 root root 3 2011-03-25 20:44 /dev/mydisk-prestigio -> sdj
 b--------- 1 root root 8, 146 2011-03-25 20:44 /dev/sdj2
 b--------- 1 root root 8, 145 2011-03-25 20:44 /dev/sdj1

The interesting thing is that Kubuntu 10.10 automatically opens both partitions sdj1 and sdj2 in Dolphin as writeable filesystems eventhough the device files have mode 0.

This is not what I expect / want, because the whole drive is owned by an unprivileged user. In turn this behaviour causes a problem as I attach "/dev/mydisk-prestigio" to a VirtualBox virtual machine, and this VM will create partitions and filesystems on this disk. The problem that arises is that the VM has full ownership of the whole disk, including its partitions and at the same time the host's desktop user has r/w access to its partitions.

To the best of my knowledge, udev does not support "not-creating sd* devicefiles for the disk and its partitions" or renaming them. I tried changing "NAME" in the udev rules, but udev doesn't like that: "udevd-work[20051]: kernel-provided name 'sdj' and NAME= 'mydisk-prestigio' disagree, please use SYMLINK+= or change the kernel to provide the proper name"

Please refer to my website for further details on what I did: http://wirespeed.xs4all.nl/mediawiki/index.php/Figuring_out_udev_rules#Assigning_a_raw_disk_to_a_specific_user

Kubuntu 10.10 x86_64
Description: Ubuntu 10.10
Release: 10.10
Platform Version 4.5.1 (KDE 4.5.1)
udev Installed: 162-2.2

Revision history for this message
jippie (jph4dotcom) wrote :

With little further testing, I produced this with NTFS filesystems on the disk and today reproduced it with EXT4.
 /dev/sdj1 on /media/6a8ce615-cb88-46be-a068-0f58aacb7d60 type ext4 (rw,nosuid,nodev,uhelper=udisks)

Revision history for this message
jippie (jph4dotcom) wrote :

Figured out kde uses udisks for automounting.

affects: kdebase (Ubuntu) → udisks (Ubuntu)
Revision history for this message
jippie (jph4dotcom) wrote :

To reproduce, configure udev to remove all permission bits from the device file. This is described on my webpage: http://wirespeed.xs4all.nl/mediawiki/index.php/Figuring_out_udev_rules#Assigning_a_raw_disk_to_a_specific_user

 $ ls -l /dev/sdj1
 b--------- 1 root root 8, 145 2011-03-26 09:05 /dev/sdj1
 $ udisks --mount /dev/sdj1
 Mounted /org/freedesktop/UDisks/devices/sdj1 at /media/6a8ce615-cb88-46be-a068-0f58aacb7d60
 $ ls -l /media/6a8ce615-cb88-46be-a068-0f58aacb7d60/
 total 108
 drwxr-xr-x 2 root root 4096 2011-03-25 22:30 bin
 drwxr-xr-x 3 root root 4096 2011-03-25 22:43 boot
 drwxr-xr-x 2 root root 4096 2011-03-2.......

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.