Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2023 07:28:31 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 269729] sysutils/nut USB permissions issue
Message-ID:  <bug-269729-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269729

            Bug ID: 269729
           Summary: sysutils/nut USB permissions issue
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: cy@FreeBSD.org
          Reporter: dennypage@me.com
          Assignee: cy@FreeBSD.org
             Flags: maintainer-feedback?(cy@FreeBSD.org)

I maintain the NUT package for pfSense and have run into an issue with USB
permissions for some UPS models.=20

NB: My testing is against nut-2.8.0_13, but I haven't seen anything suggest=
ing
that the issue is resolved in later port revisions.

The permission problem arrises from the fact that the kernel attaches a dri=
ver
to the device during initialization, and this subsequently prevents the dev=
ice
from being opened by usbhid-ups. The error reported is "Can't claim USB dev=
ice"

The following demonstrates the specifics:

-----
[23.01-RELEASE][root@fw]/root: usbconfig -d ugen0.2 show_ifdrv
ugen0.2: <American Power Conversion Smart-UPS1000 FW:UPS 16.0 / ID1047> at
usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (10mA)
ugen0.2.0: uhid0: <American Power Conversion Smart-UPS1000 FW:UPS 16.0 /
ID1047, class 0/0, rev 2.00/0.01, addr 4>

[23.01-RELEASE][root@fw]/root: /usr/local/libexec/nut/usbhid-ups -a ups
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of th=
is
message)
Can't claim USB device [051d:0003]@0/0: Other error

[23.01-RELEASE][root@fw]/root: usbconfig -d ugen0.2 detach_kernel_driver

[23.01-RELEASE][root@fw]/root: usbconfig -d ugen0.2 show_ifdrv
ugen0.2: <American Power Conversion Smart-UPS1000 FW:UPS 16.0 / ID1047> at
usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (10mA)

[23.01-RELEASE][root@fw]/root: /usr/local/libexec/nut/usbhid-ups -a ups
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of th=
is
message)
Using subdriver: APC HID 0.98

[23.01-RELEASE][root@fw]/root:=20
-----

As you would expect, if the "-u root" option is added to usbhid-ups then it
will succeed even if the kernel driver is currently attached.

I note that this permission issue is also present in the truss outputs in b=
ug
#267144

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269729-7788>