From 9c94fe7bf5439573ae20033536713ef6486b718a Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mar 23 2010 10:06:44 +0000 Subject: - reduced size of buffer to maximum size supported by low-speed USB devices - fixes #575334 --- diff --git a/nut-2.4.3-bz575334.patch b/nut-2.4.3-bz575334.patch new file mode 100644 index 0000000..b14f8c0 --- /dev/null +++ b/nut-2.4.3-bz575334.patch @@ -0,0 +1,21 @@ +diff -up nut-2.4.3/drivers/libhid.c.bz575334 nut-2.4.3/drivers/libhid.c +--- nut-2.4.3/drivers/libhid.c.bz575334 2010-03-22 17:34:16.251422549 +0100 ++++ nut-2.4.3/drivers/libhid.c 2010-03-22 17:34:16.278422151 +0100 +@@ -141,7 +141,7 @@ static int refresh_report_buffer(reportb + { + int id = pData->ReportID; + int r; +- unsigned char buf[SMALLBUF]; ++ unsigned char buf[8]; + + if (rbuf->ts[id] + age > time(NULL)) { + /* buffered report is still good; nothing to do */ +@@ -469,7 +469,7 @@ bool_t HIDSetItemValue(hid_dev_handle_t + */ + int HIDGetEvents(hid_dev_handle_t udev, HIDData_t **event, int eventsize) + { +- unsigned char buf[SMALLBUF]; ++ unsigned char buf[8]; + int itemCount = 0; + int buflen, r, i; + HIDData_t *pData; diff --git a/nut.spec b/nut.spec index 30b8cc8..52c4170 100644 --- a/nut.spec +++ b/nut.spec @@ -9,7 +9,7 @@ Summary: Network UPS Tools Name: nut Version: 2.4.3 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2+ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -23,6 +23,9 @@ Patch0: nut-2.2.1-conf.patch #rejected upstream Patch1: nut-2.2.2-halpath.patch +#from upstream, required for nut <= 2.4.3, bz#575334 +Patch2: nut-2.4.3-bz575334.patch + Requires: nut-client => 2.4.0 hal Requires(pre): hal Requires(post): fileutils chkconfig initscripts @@ -116,6 +119,7 @@ necessary to develop NUT client applications. %setup -q %patch0 -p1 -b .conf %patch1 -p1 -b .halpath +%patch2 -p1 -b .bz575334 %build autoreconf -i @@ -356,6 +360,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libupsclient.pc %changelog +* Mon Mar 23 2010 Michal Hlavinka - 2.4.3-2 +- reduced size of buffer to maximum size supported by low-speed USB devices +- fixes #575334 + * Wed Feb 24 2010 Michal Hlavinka - 2.4.3-1 - cyberpower driver was replaced by the powerpanel driver - general USB support has been vastly improved, including many bug