[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Success of udev rule depends on if user has local or NIS account



Hello,

I wrote the following udev rule:

ACTION=="add", SUBSYSTEM=="block", ATTRS{removable}=="1", PROGRAM="/lib/udev/foreground-user", RESULT!="root", MODE="0600", OWNER="$result"

The goal of this rule is to give a user who attaches a USB storage device while being logged on in the graphical environment exclusive access rights for the corresponding device nodes /dev/sd[a-z]* .

That was working as desired for some time, but now I discovered that is does not work correctly any more on some machines, on Debian 10 as well as in Ubuntu 18.04. Searching for the reason gave the result that the success of the udev rule depends on the kernel version (it worked in Ubuntu 18.04 with Kernel 4.15.0-50-generic, but does not work with Kernel 4.15.0-74-generic) as well as on if the user has a local or a NIS account, that is, it works with local accounts, but not with NIS accounts.

Does anybody know what happened in newer kernels that makes OWNER="$result" fail for NIS accounts?

Regards
  Christoph


Reply to: