Skip to contentSkip to conversation

sticky permissions of block devices

DISCUSSION Matthias Schwarzott 2 participants 2 messages Nov 29, 2009

lore
Share & tools
lore
#0 lore raw

Hi there!

Newer udev has an ugly behaviour regarding block devices.
Chown a blockdevice to some user and open it once.
udev will trigger a change event and reset the permissions back to root:disk.

The fastest solution I can propose is to restrict permission setting to ACTION="add", but is that a good choice?

The use-case I had was to allow a user to access /dev/sda for running qemu.

Regards
Matthias

#1 lore raw
Quoted 8 lines · Matthias Schwarzott

Newer udev has an ugly behaviour regarding block devices.
Chown a blockdevice to some user and open it once.
udev will trigger a change event and reset the permissions back to root:disk.

The fastest solution I can propose is to restrict permission setting to ACTION="add", but is that a good choice?

The use-case I had was to allow a user to access /dev/sda for running qemu.

I guess, such users should create a simple rule in /etc/udev/rules.d/ with the intended settings to apply the permissions. There are many reasons for change events, and they can happen for any device at any time, and we re-apply all settings with a change event, because the device might have changed its settings, and needs a new policy applied.

As a simple workaround ACLs can probably be used, and they should not be removed with any later event, unless the primary ownership/mode is not touched.

Kay