7

Is it possible to write a new udev rule that undoes TAG+="uaccess" (removes the uaccess tag) without undoing any of the other tags on a device? If so, how?

(I have a device that should be opened by a daemon. Unfortunately, the uaccess tag added in /lib/udev/rules.d/70-uaccess.rules causes the permissions to be mangled whenever someone logs in, breaking access for the daemon.)

2 Answers2

6

From version 217 onwards, is possible to do that using:

TAG-="uaccess"

For older versions, sadly it isn't. So you can workaround adding some conditional that would prevent the tag from being added:

KERNEL=="sdb", GROUP="daemon", OPTIONS+="last_rule"

In this case, you set the permissions and then nothing else can be added.

Braiam
  • 35,991
0

I tried the accepted answer and it didn't work for RHEL7. The OPTIONS+="last_rule" is deprecated.

SUBSYSTEM=="block", ENV{ID_CDROM}=="1",TAG:="systemd"

This needs to run after the 70-uaccess.rules. Name it /etc/udev/rules.d/71-uaccess-remove.rules