Re: Use GROUP= in a rule matching an interface of the device?

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

 



On Fri, Sep 10, 2010 at 11:49, Ludovic Rousseau
<ludovic.rousseau@xxxxxxxxx> wrote:
> 2010/9/9 David Zeuthen <zeuthen@xxxxxxxxx>:
>> On Thu, Sep 9, 2010 at 5:57 AM, Ludovic Rousseau
>> <ludovic.rousseau@xxxxxxxxx> wrote:
>>> > Something like:
>>> >  SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}="*:0b0000:*", GROUP= ...
>>> > should do it.
>>>
>>> Yes, it does work.
>>>
>>> But I find the rule more obscure.
>>>
>>> Since performance is not a critical point for me I think I will stay with:
>>> ATTRS{bInterfaceClass}=="0b", RUN+="/bin/chgrp pcscd $root/$parent"
>>
>> Please don't. It's racy. In particular it will break if you have
>> daemons or apps listening for uevents and doing stuff when the device
>> node appears.
>
> Would the race issue disappear if I use RUN= instead of RUN+=?

No it wouldn't. It will break all other earlier rules. Device event
must never operate on other devices like their parent in this case.
It's just totally wrong to do anything like that. The next event for
the parent will restore the original mode again, without ever calling
your chgrp hack.

> The chgrp command should not take to long to execute.

It's not a matter of 'long'. A race is a race, and must be avoided.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux