public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/nut] f44: fix nut monitor spin CPU after upsd closed connection (rhbz#2539831)
@ 2026-10-07 15:16 Michal Hlavinka
  0 siblings, 0 replies; only message in thread
From: Michal Hlavinka @ 2026-10-07 15:16 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/nut
Branch : f44
Commit : ab5d1edc5acb8c7d1368a3a30e647c5878347f2f
Author : Michal Hlavinka <mhlavink@redhat.com>
Date   : 2026-10-07T17:08:20+02:00
Stats  : +24/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/nut/c/ab5d1edc5acb8c7d1368a3a30e647c5878347f2f?branch=f44

Log:
fix nut monitor spin CPU after upsd closed connection (rhbz#2539831)

---
diff --git a/nut-2.8.5-3e675fed.patch b/nut-2.8.5-3e675fed.patch
new file mode 100644
index 0000000..6e572d1
--- /dev/null
+++ b/nut-2.8.5-3e675fed.patch
@@ -0,0 +1,16 @@
+diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
+index 3296d082b4..783a6c9e8f 100644
+--- a/scripts/python/module/PyNUT.py.in
++++ b/scripts/python/module/PyNUT.py.in
+@@ -721,7 +721,10 @@ certhost    : Optional dict or list of dict/lists: {hostname: [certname, certver
+         while True:
+             data_end_index = data.find(finished_reading_data)
+             if data_end_index == -1:
+-                data += self.__srv_handler.recv(50)  # nut_telnetlib.py uses 50
++                chunk = self.__srv_handler.recv(50)  # nut_telnetlib.py uses 50
++                if not chunk:
++                    raise EOFError("Connection closed by server")
++                data += chunk
+             else:
+                 break
+         data_end_index += len(finished_reading_data)

diff --git a/nut.spec b/nut.spec
index 79c855d..c8f47cf 100644
--- a/nut.spec
+++ b/nut.spec
@@ -13,7 +13,7 @@
 Summary: Network UPS Tools
 Name: nut
 Version: 2.8.5
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: GPL-2.0-or-later AND GPL-3.0-or-later
 Url: https://www.networkupstools.org/
 Source: https://www.networkupstools.org/source/2.8/%{name}-%{version}.tar.gz
@@ -25,6 +25,9 @@ Patch9: nut-2.6.5-rmpidf.patch
 Patch15: nut-c99-strdup.patch
 Patch16: nut-2.8-rhinoname.patch
 Patch17: nut-2.8.5-nutuser.patch
+# from upstream, for <= 2.8.5, rhbz#2539831
+# https://github.com/networkupstools/nut/commit/3e675fedbbec7f8a38b477e20bb85f00d9a42226
+Patch18: nut-2.8.5-3e675fed.patch
 
 Requires(post): coreutils systemd
 Requires(preun): systemd
@@ -141,6 +144,7 @@ necessary to develop NUT client applications.
 #patch -P 15 -p1
 %patch -P 16 -p2 -b .rhinoname
 %patch -P 17 -p2 -b .nutuser
+%patch -P 18 -p1 -b .3e675fed
 
 sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in
 sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in
@@ -536,6 +540,9 @@ fi
 %{_libdir}/pkgconfig/libnutscan.pc
 
 %changelog
+* Wed Oct 07 2026 Michal Hlavinka <mhlavink@redhat.com> - 2.8.5-9
+- fix nut monitor spin CPU after upsd closed connection (rhbz#2539831)
+
 * Tue Aug 25 2026 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 2.8.5-8.2
 - Explicitly set no rpath options for ldflags in pkg-config files
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-07 15:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 15:16 [rpms/nut] f44: fix nut monitor spin CPU after upsd closed connection (rhbz#2539831) Michal Hlavinka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox