Package: nut-server
Version: 2.7.2-4
Severity: important
Tags: upstream patch

Dear Maintainer,

I am using an APC Back-UPS Pro with the usbhid-ups driver in NUT.
After upgrading from Debian 6 to Debian 8, the driver would not start anymore
and segfaulted before delivering any data.

There is an upstream bug report at
https://github.com/networkupstools/nut/issues/258
that deals with this problem. It is due to incorrect handling of a missing
USB product identifier string. Apparently the issue only occurs when running
on VMware ESXi, where the USB string is probably lost due to some issue with
the hypervisor, the kernel, or libusb.

A patch is available upstream at
https://github.com/networkupstools/nut/commit/f679a28
and I have confirmed that it fixes the bug for version 2.7.2 in Debian too.

Thanks,
Michael Kuron

-- System Information:
Debian Release: 8.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages nut-server depends on:
ii  adduser              3.113+nmu3
ii  init-system-helpers  1.22
ii  libc6                2.19-18+deb8u2
ii  libnspr4             2:4.10.7-1+deb8u1
ii  libnss3              2:3.17.2-1.1+deb8u2
ii  libupsclient4        2.7.2-4
ii  libusb-0.1-4         2:0.1.12-25
ii  libwrap0             7.6.q-25
ii  lsb-base             4.1+Debian13+nmu1
ii  nut-client           2.7.2-4
ii  udev                 215-17+deb8u3

nut-server recommends no packages.

Versions of packages nut-server suggests:
pn  nut-cgi   <none>
pn  nut-ipmi  <none>
pn  nut-snmp  <none>
pn  nut-xml   <none>

-- Configuration Files:
/etc/nut/ups.conf [Errno 13] Permission denied: u'/etc/nut/ups.conf'
/etc/nut/upsd.conf [Errno 13] Permission denied: u'/etc/nut/upsd.conf'
/etc/nut/upsd.users [Errno 13] Permission denied: u'/etc/nut/upsd.users'

-- no debconf information
diff --git a/drivers/apc-hid.c b/drivers/apc-hid.c
index 1d85621..1393d50 100644
--- a/drivers/apc-hid.c
+++ b/drivers/apc-hid.c
@@ -62,6 +62,11 @@ static void *general_apc_check(USBDevice_t *device)
 {
 	int i = 0;
 
+	if (!device->Product) {
+		upslogx(LOG_WARNING, "device->Product is NULL so it is not possible to determine whether to activate max_report_size workaround");
+		return NULL;
+	}
+
 	/* Some models of Back-UPS overflow on some ReportID.
 	 * This results in some data not being exposed and IO errors on
 	 * WIN32, causing endless reconnection or driver's failure */

Reply via email to