[Nut-upsdev] newhidups subdriver_matcher incorrectly matches USB hub

Schmier, Jacob Jacob_Schmier at inter-tel.com
Wed Aug 16 01:03:24 UTC 2006


> > :/tmp# /tmp/newhidups -DDD /dev/usb/hid/hiddev0 

> (Note that you do not need to specify the /dev node for newhidups.) 

According to the usage info, the /dev node is only optional when 
using -a.  Although running the following works just fine:
:/tmp# /tmp/newhidups -u nut /etc/passwd

Having to provide SOMETHING in the device option even though newhidups 
is going to scan the usb bus for a device anyway seems a bit ridiculous 
to me, but that is another issue ;)

> One way to avoid this is to run the driver as an unprivileged user, 
> and set up udev/hotplug to only give NUT read/write access to the UPS.

> IIRC, most distributions use mode 0644 on /proc/bus/usb/* nodes by 
> default, so creating a 'nut' user and running 'chown nut ...' in the 
> hotplug script would do the trick. See scripts/hotplug or 
> scripts/hotplug-ng (udev) for more information.

> -- 
> - Charles Lepple

Thanks for the suggestion.  It definitely does the trick.  However,
this is really just a work around to the underlying problem.  The hub
is still matched, it just cannot be claimed due to permissions.  The 
hub really shouldn't be matched at all.

I could just as easily change belkin_claim in drivers/belkin-hid.c so 
that it never reports a match since I don't use a Belkin UPS.

~Jacob



More information about the Nut-upsdev mailing list