Subject: [alpine-user] USB Permissions

From: Gareth Williams <[email-masked]>
Date: Wed, 25 Jul 2018 07:50:33 +0100

Hi,

I'm trying to set up NUT (UPS tools) on Alpine 3.8.  I've compiled from 
edge and that stage seems to have worked fine.

The device is an EATON Ellipse ECO 800 UPS which uses USB for 
communicating with Alpine.  I've therefore also installed eudev to 
manage to USB permissions.

However, I can't get it to communicate.

I've added the UPS to ups.conf:

     [eaton]
     driver = usbhid-ups
     port = auto
     vendorid=0463
     desc = "Eaton UPS"

But when I try to start it, I get errors.  Running a strace on the driver:

     strace /usr/lib/nut/usbhid-ups -a eaton

results in (amongst other messages):

     stat("/sys/bus/usb/devices", 0x7639e69ffe80) = -1 EACCES 
(Permission denied)

Checking permissions with:

     ls -ld /sys/bus/usb/devices

     drwx------    2 root     root             0 Jul 24 19:41 
/sys/bus/usb/devices/

In fact, it is 0600 root:root all the way up to /sys/bus.

Shouldn't this be 0644 or similar, or maybe 0640 but with group 'usb'?

Kind regards,

Gareth Williams

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Gareth Williams <[email-masked]>
Date: Thu, 26 Jul 2018 06:38:53 +0100

To answer my own question and hopefully save someone else asking it:

The driver can't read /sys/bus and sub-directories because I had a 
hardened kernel installed and these kernels have the 
CONFIG_GRKERNSEC_SYSFS_RESTRICT config option enabled which disables 
read access to the whole /sys tree.  Changing the kernel to 
linux-vanilla fixed it.

Kind regards,

Gareth

On 25/07/2018 07:50, Gareth Williams wrote:
> Hi,
>
> I'm trying to set up NUT (UPS tools) on Alpine 3.8.  I've compiled 
> from edge and that stage seems to have worked fine.
>

---