]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: don't force device ownership and mode on every event 12910/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 29 Jun 2019 13:08:11 +0000 (15:08 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 29 Jun 2019 14:10:49 +0000 (16:10 +0200)
commit3708c0f455931c8cb5fed149923e5a995c2e3fbf
treea0d87248e84cf400c81c66309c2e4546bc9f6d56
parentab3a7372d21bd41ac6d4ec574bf2ed5c63ae9a2f
udev: don't force device ownership and mode on every event

This partially reverts 25de7aa7b90c23d33ea50ada1e50c5834a414237. I don't think the
change was intended there.

The problem I'm trying to solve: for /dev/kvm we get first an ADD uevent, and
then CHANGE whenever something connects or disconnects to the character device.
The rules in 50-default-udev.rules set UID, GID, and MODE on ADD, but not on
CHANGE. When the change event happens, we would reset the ownership and
permissions.

This happens because node_permissions_apply() would (after 25de7aa7b90c23d33)
set uid=gid=0 if they weren't set by the rules.

So let's only pass uid/gid/mode to node_permissions_apply() if appropriately
configured. Also let node_permissions_apply() do the skip of uid/gid/mode if
not set, and rename "always_apply" to more closely reflect its meaning.
src/udev/udev-event.c
src/udev/udev-node.c