[arch-commits] Commit in nut/repos/community-x86_64 (14 files)

Maxime Gauduin alucryd at gemini.archlinux.org
Thu Aug 18 10:33:39 UTC 2022


    Date: Thursday, August 18, 2022 @ 10:33:39
  Author: alucryd
Revision: 1266864

archrelease: copy trunk to community-x86_64

Added:
  nut/repos/community-x86_64/PKGBUILD
    (from rev 1266863, nut/trunk/PKGBUILD)
  nut/repos/community-x86_64/nut-lowspeed-buffer-size.patch
    (from rev 1266863, nut/trunk/nut-lowspeed-buffer-size.patch)
  nut/repos/community-x86_64/nut-no-libdummy.patch
    (from rev 1266863, nut/trunk/nut-no-libdummy.patch)
  nut/repos/community-x86_64/nut-openssl-1.1.patch
    (from rev 1266863, nut/trunk/nut-openssl-1.1.patch)
  nut/repos/community-x86_64/nut-snmp-usb-order.patch
    (from rev 1266863, nut/trunk/nut-snmp-usb-order.patch)
  nut/repos/community-x86_64/nut.sysusers
    (from rev 1266863, nut/trunk/nut.sysusers)
  nut/repos/community-x86_64/nut.tmpfiles
    (from rev 1266863, nut/trunk/nut.tmpfiles)
Deleted:
  nut/repos/community-x86_64/PKGBUILD
  nut/repos/community-x86_64/nut-lowspeed-buffer-size.patch
  nut/repos/community-x86_64/nut-no-libdummy.patch
  nut/repos/community-x86_64/nut-openssl-1.1.patch
  nut/repos/community-x86_64/nut-snmp-usb-order.patch
  nut/repos/community-x86_64/nut.sysusers
  nut/repos/community-x86_64/nut.tmpfiles

--------------------------------+
 PKGBUILD                       |  241 +++++++++++++++----------------
 nut-lowspeed-buffer-size.patch |   38 ++--
 nut-no-libdummy.patch          |   28 +--
 nut-openssl-1.1.patch          |  302 +++++++++++++++++++--------------------
 nut-snmp-usb-order.patch       |   76 ++++-----
 nut.sysusers                   |    4 
 nut.tmpfiles                   |   12 -
 7 files changed, 351 insertions(+), 350 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2022-08-18 10:33:22 UTC (rev 1266863)
+++ PKGBUILD	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,120 +0,0 @@
-# Maintainer: Maxime Gauduin <alucryd at archlinux.org>
-# Contributor: Florian Bruhin <archlinux.org at the-compiler.org>
-# Contributor: Alex Reznichenko <sa5gap at yandex.ru>
-# Contributor: Roman Kyrylych <roman at archlinux.org>
-# Contributor: Giuseppe Lucarelli <luk at rebelsoft.org>
-# Contributor: Dan Ziemba <zman0900 at gmail.com>
-
-pkgname=nut
-pkgver=2.8.0
-pkgrel=1
-pkgdesc='A collection of programs which provide a common interface for monitoring and administering UPS, PDU and SCD hardware'
-arch=(x86_64)
-url=https://networkupstools.org/
-license=(
-  GPL2
-  GPL3
-)
-depends=(
-  gcc-libs
-  glibc
-  libtool
-  libusb-compat
-  neon
-  net-snmp
-  openssl
-)
-makedepends=(
-  asciidoc
-  gd
-  git
-  python
-)
-optdepends=('gd: CGI support')
-provides=(network-ups-tools)
-conflicts=(network-ups-tools)
-replaces=(network-ups-tools)
-options=(!makeflags)
-backup=(
-  etc/nut/hosts.conf
-  etc/nut/nut.conf
-  etc/nut/ups.conf
-  etc/nut/upsd.conf
-  etc/nut/upsd.users
-  etc/nut/upsmon.conf
-  etc/nut/upssched.conf
-  etc/nut/upsstats.html
-  etc/nut/upsstats-single.html
-)
-_tag=ff16dabca191e5fd8ddc20137317bdebee554d8d
-source=(
-  git+https://github.com/networkupstools/nut.git#tag=${_tag}
-  nut.sysusers
-  nut.tmpfiles
-  nut-lowspeed-buffer-size.patch
-  nut-no-libdummy.patch
-  nut-openssl-1.1.patch
-  nut-snmp-usb-order.patch
-)
-b2sums=('SKIP'
-        'b136678723bae38f2e1b99d682e5bad6c4387c2d709052681f1dc0d41e8dd6d061115f6d3e573400bded671296ca61e5e194258e801c83f26bf309313b3f2319'
-        'b5466d4142fdeadd07859c030a9e6f7a73f1a4f3902a07b6e8b9a5ead738279ff557ac21770edef21e55b015a3b19cd9579e638da0a37f102ed130ed749ac03b'
-        'cdd11335a8d60b2cada25a2cd9be2d0f1c911029a46e3adf8eda7d8687c1b2caf0fd66cd92c41ecbd660d44bc2606e92aa81d4a2c9746b2ef9e15c4048679487'
-        '0314fe2358fab9d49a8bc5b939c2855151c4f35b2b51e6d1accf25469c9d55831960cd5f9b53ee151fb5a45ae7068c9bfcc91c84a7623b783f6c3c5d5da75d65'
-        '17877276e46372aa17d357efc0851b9cdb33b14ac0c40913b47ea513a8ecaa6eebe3241ae8b324583070d76b6c12d3cf18c043778754b5774af846fb8a33b4d7'
-        'e39f049413cb3d393befe5795c895128271f4ca2791b5723eba5c5f20be0b770369ee6144a1e5d6793727709b1ba578d8ace6cbf91695a2771453047827e5334')
-
-pkgver() {
-  cd nut
-  git describe --tags | sed 's/^v//'
-}
-
-prepare() {
-  cd nut
-  ./autogen.sh
-}
-
-build() {
-  cd nut
-  ./configure \
-    --prefix=/usr \
-    --datadir=/usr/share/nut \
-    --libexecdir=/usr/lib/nut \
-    --sbindir=/usr/bin \
-    --sysconfdir=/etc/nut \
-    --disable-static \
-    --with-user=nut \
-    --with-group=nut \
-    --with-altpidpath=/run/nut \
-    --with-cgipath=/usr/share/nut/cgi \
-    --with-drvpath=/usr/lib/nut \
-    --with-htmlpath=/usr/share/nut/html \
-    --with-pidpath=/run/nut \
-    --with-statepath=/var/lib/nut \
-    --with-systemdsystemunitdir=/usr/lib/systemd/system \
-    --with-udev-dir=/usr/lib/udev \
-    --with-cgi \
-    --with-dev \
-    --with-doc=man \
-    --with-libltdl \
-    --with-neon \
-    --with-openssl \
-    --with-serial \
-    --with-snmp \
-    --with-usb \
-    --without-avahi \
-    --without-ipmi \
-    --without-freeipmi \
-    --without-powerman \
-    --without-wrap
-  make
-}
-
-package() {
-  make DESTDIR="${pkgdir}" -C nut install
-  find "${pkgdir}"/etc/nut -name *.sample -exec rename '.sample' '' {} \;
-  install -Dm 644 nut.sysusers "${pkgdir}"/usr/lib/sysusers.d/nut.conf
-  install -Dm 644 nut.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/nut.conf
-}
-
-# vim: ts=2 sw=2 et:

Copied: nut/repos/community-x86_64/PKGBUILD (from rev 1266863, nut/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,121 @@
+# Maintainer: Maxime Gauduin <alucryd at archlinux.org>
+# Contributor: Florian Bruhin <archlinux.org at the-compiler.org>
+# Contributor: Alex Reznichenko <sa5gap at yandex.ru>
+# Contributor: Roman Kyrylych <roman at archlinux.org>
+# Contributor: Giuseppe Lucarelli <luk at rebelsoft.org>
+# Contributor: Dan Ziemba <zman0900 at gmail.com>
+
+pkgname=nut
+pkgver=2.8.0
+pkgrel=2
+pkgdesc='A collection of programs which provide a common interface for monitoring and administering UPS, PDU and SCD hardware'
+arch=(x86_64)
+url=https://networkupstools.org/
+license=(
+  GPL2
+  GPL3
+)
+depends=(
+  gcc-libs
+  glibc
+  libtool
+  libusb-compat
+  neon
+  net-snmp
+  openssl
+)
+makedepends=(
+  asciidoc
+  gd
+  git
+  python
+  systemd
+)
+optdepends=('gd: CGI support')
+provides=(network-ups-tools)
+conflicts=(network-ups-tools)
+replaces=(network-ups-tools)
+options=(!makeflags)
+backup=(
+  etc/nut/hosts.conf
+  etc/nut/nut.conf
+  etc/nut/ups.conf
+  etc/nut/upsd.conf
+  etc/nut/upsd.users
+  etc/nut/upsmon.conf
+  etc/nut/upssched.conf
+  etc/nut/upsstats.html
+  etc/nut/upsstats-single.html
+)
+_tag=ff16dabca191e5fd8ddc20137317bdebee554d8d
+source=(
+  git+https://github.com/networkupstools/nut.git#tag=${_tag}
+  nut.sysusers
+  nut.tmpfiles
+  nut-lowspeed-buffer-size.patch
+  nut-no-libdummy.patch
+  nut-openssl-1.1.patch
+  nut-snmp-usb-order.patch
+)
+b2sums=('SKIP'
+        'b136678723bae38f2e1b99d682e5bad6c4387c2d709052681f1dc0d41e8dd6d061115f6d3e573400bded671296ca61e5e194258e801c83f26bf309313b3f2319'
+        'b5466d4142fdeadd07859c030a9e6f7a73f1a4f3902a07b6e8b9a5ead738279ff557ac21770edef21e55b015a3b19cd9579e638da0a37f102ed130ed749ac03b'
+        'cdd11335a8d60b2cada25a2cd9be2d0f1c911029a46e3adf8eda7d8687c1b2caf0fd66cd92c41ecbd660d44bc2606e92aa81d4a2c9746b2ef9e15c4048679487'
+        '0314fe2358fab9d49a8bc5b939c2855151c4f35b2b51e6d1accf25469c9d55831960cd5f9b53ee151fb5a45ae7068c9bfcc91c84a7623b783f6c3c5d5da75d65'
+        '17877276e46372aa17d357efc0851b9cdb33b14ac0c40913b47ea513a8ecaa6eebe3241ae8b324583070d76b6c12d3cf18c043778754b5774af846fb8a33b4d7'
+        'e39f049413cb3d393befe5795c895128271f4ca2791b5723eba5c5f20be0b770369ee6144a1e5d6793727709b1ba578d8ace6cbf91695a2771453047827e5334')
+
+pkgver() {
+  cd nut
+  git describe --tags | sed 's/^v//'
+}
+
+prepare() {
+  cd nut
+  ./autogen.sh
+}
+
+build() {
+  cd nut
+  ./configure \
+    --prefix=/usr \
+    --datadir=/usr/share/nut \
+    --libexecdir=/usr/lib/nut \
+    --sbindir=/usr/bin \
+    --sysconfdir=/etc/nut \
+    --disable-static \
+    --with-user=nut \
+    --with-group=nut \
+    --with-altpidpath=/run/nut \
+    --with-cgipath=/usr/share/nut/cgi \
+    --with-drvpath=/usr/lib/nut \
+    --with-htmlpath=/usr/share/nut/html \
+    --with-pidpath=/run/nut \
+    --with-statepath=/var/lib/nut \
+    --with-systemdsystemunitdir=/usr/lib/systemd/system \
+    --with-udev-dir=/usr/lib/udev \
+    --with-cgi \
+    --with-dev \
+    --with-doc=man \
+    --with-libltdl \
+    --with-neon \
+    --with-openssl \
+    --with-serial \
+    --with-snmp \
+    --with-usb \
+    --without-avahi \
+    --without-ipmi \
+    --without-freeipmi \
+    --without-powerman \
+    --without-wrap
+  make
+}
+
+package() {
+  make DESTDIR="${pkgdir}" -C nut install
+  find "${pkgdir}"/etc/nut -name *.sample -exec rename '.sample' '' {} \;
+  install -Dm 644 nut.sysusers "${pkgdir}"/usr/lib/sysusers.d/nut.conf
+  install -Dm 644 nut.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/nut.conf
+}
+
+# vim: ts=2 sw=2 et:

Deleted: nut-lowspeed-buffer-size.patch
===================================================================
--- nut-lowspeed-buffer-size.patch	2022-08-18 10:33:22 UTC (rev 1266863)
+++ nut-lowspeed-buffer-size.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,19 +0,0 @@
-http://bugs.gentoo.org/show_bug.cgi?id=318937
-http://boxster.ghz.cc/projects/nut/changeset/2407
-
-Respun from nut-2.4.3-lowspeed-buffer-size.patch
-
-Index: a/drivers/libhid.c
-===================================================================
---- a/drivers/libhid.c
-+++ b/drivers/libhid.c
-@@ -477,7 +477,7 @@
-  */
- int HIDGetEvents(hid_dev_handle_t udev, HIDData_t **event, int eventsize)
- {
--	unsigned char	buf[SMALLBUF];
-+	unsigned char	buf[8];	/* Maximum size for low-speed USB devices */
- 	int		itemCount = 0;
- 	int		buflen, r, i;
- 	HIDData_t	*pData;
-

Copied: nut/repos/community-x86_64/nut-lowspeed-buffer-size.patch (from rev 1266863, nut/trunk/nut-lowspeed-buffer-size.patch)
===================================================================
--- nut-lowspeed-buffer-size.patch	                        (rev 0)
+++ nut-lowspeed-buffer-size.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,19 @@
+http://bugs.gentoo.org/show_bug.cgi?id=318937
+http://boxster.ghz.cc/projects/nut/changeset/2407
+
+Respun from nut-2.4.3-lowspeed-buffer-size.patch
+
+Index: a/drivers/libhid.c
+===================================================================
+--- a/drivers/libhid.c
++++ b/drivers/libhid.c
+@@ -477,7 +477,7 @@
+  */
+ int HIDGetEvents(hid_dev_handle_t udev, HIDData_t **event, int eventsize)
+ {
+-	unsigned char	buf[SMALLBUF];
++	unsigned char	buf[8];	/* Maximum size for low-speed USB devices */
+ 	int		itemCount = 0;
+ 	int		buflen, r, i;
+ 	HIDData_t	*pData;
+

Deleted: nut-no-libdummy.patch
===================================================================
--- nut-no-libdummy.patch	2022-08-18 10:33:22 UTC (rev 1266863)
+++ nut-no-libdummy.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,14 +0,0 @@
-diff --git a/drivers/Makefile.am b/drivers/Makefile.am
-index 99614ca..42b3611 100644
---- a/drivers/Makefile.am
-+++ b/drivers/Makefile.am
-@@ -267,5 +267,6 @@ dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h    \
-
- # Define a dummy library so that Automake builds rules for the
- # corresponding object files.  This library is not actually built,
--EXTRA_LIBRARIES = libdummy.a
--libdummy_a_SOURCES = main.c dstate.c serial.c
-+EXTRA_LIBRARIES =
-+#EXTRA_LIBRARIES = libdummy.a
-+#libdummy_a_SOURCES = main.c dstate.c serial.c
-

Copied: nut/repos/community-x86_64/nut-no-libdummy.patch (from rev 1266863, nut/trunk/nut-no-libdummy.patch)
===================================================================
--- nut-no-libdummy.patch	                        (rev 0)
+++ nut-no-libdummy.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,14 @@
+diff --git a/drivers/Makefile.am b/drivers/Makefile.am
+index 99614ca..42b3611 100644
+--- a/drivers/Makefile.am
++++ b/drivers/Makefile.am
+@@ -267,5 +267,6 @@ dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h    \
+
+ # Define a dummy library so that Automake builds rules for the
+ # corresponding object files.  This library is not actually built,
+-EXTRA_LIBRARIES = libdummy.a
+-libdummy_a_SOURCES = main.c dstate.c serial.c
++EXTRA_LIBRARIES =
++#EXTRA_LIBRARIES = libdummy.a
++#libdummy_a_SOURCES = main.c dstate.c serial.c
+

Deleted: nut-openssl-1.1.patch
===================================================================
--- nut-openssl-1.1.patch	2022-08-18 10:33:22 UTC (rev 1266863)
+++ nut-openssl-1.1.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,151 +0,0 @@
-From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001
-From: Arjen de Korte <build+lede at de-korte.org>
-Date: Mon, 27 Nov 2017 21:10:13 +0100
-Subject: [PATCH] Add support for openssl-1.1.0
-
---- a/clients/upsclient.c
-+++ b/clients/upsclient.c
-@@ -299,11 +299,6 @@
- {
- #ifdef WITH_OPENSSL
- 	int ret, ssl_mode = SSL_VERIFY_NONE;
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--	const SSL_METHOD	*ssl_method;
--#else
--	SSL_METHOD	*ssl_method;
--#endif
- #elif defined(WITH_NSS) /* WITH_OPENSSL */
- 	SECStatus	status;
- #endif /* WITH_OPENSSL | WITH_NSS */
-@@ -315,22 +310,32 @@
- 	}
- 	
- #ifdef WITH_OPENSSL
--	
--	SSL_library_init();
--	SSL_load_error_strings();
- 
--	ssl_method = TLSv1_client_method();
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+	SSL_load_error_strings();
-+	SSL_library_init();
- 
--	if (!ssl_method) {
--		return 0;
--	}
-+	ssl_ctx = SSL_CTX_new(SSLv23_client_method());
-+#else
-+	ssl_ctx = SSL_CTX_new(TLS_client_method());
-+#endif
- 
--	ssl_ctx = SSL_CTX_new(ssl_method);
- 	if (!ssl_ctx) {
- 		upslogx(LOG_ERR, "Can not initialize SSL context");
- 		return -1;
- 	}
- 	
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+	/* set minimum protocol TLSv1 */
-+	SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
-+#else
-+	ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION);
-+	if (ret != 1) {
-+		upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1");
-+		return -1;
-+	}
-+#endif
-+
- 	if (!certpath) {
- 		if (certverify == 1) {
- 			upslogx(LOG_ERR, "Can not verify certificate if any is specified");
-@@ -737,7 +742,7 @@
- 	switch(res)
- 	{
- 	case 1:
--		upsdebugx(3, "SSL connected");
-+		upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl));
- 		break;
- 	case 0:
- 		upslog_with_errno(1, "SSL_connect do not accept handshake.");
---- a/clients/upssched.c
-+++ b/clients/upssched.c
-@@ -794,7 +794,7 @@
- 	}
- 
- 	if (!strcmp(cmd, "EXECUTE")) {
--		if (ca1 == '\0') {
-+		if (ca1[0] == '\0') {
- 			upslogx(LOG_ERR, "Empty EXECUTE command argument");
- 			return;
- 		}
---- a/m4/nut_check_libopenssl.m4
-+++ b/m4/nut_check_libopenssl.m4
-@@ -58,7 +58,7 @@
- 
- 	dnl check if openssl is usable
- 	AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT])
--	AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no])
-+	AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no])
- 
- 	if test "${nut_have_openssl}" = "yes"; then
- 		nut_with_ssl="yes"
---- a/server/netssl.c
-+++ b/server/netssl.c
-@@ -274,7 +274,7 @@
- 	{
- 	case 1:
- 		client->ssl_connected = 1;
--		upsdebugx(3, "SSL connected");
-+		upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl));
- 		break;
- 		
- 	case 0:
-@@ -370,13 +370,7 @@
- {
- #ifdef WITH_NSS
- 	SECStatus status;
--#elif defined(WITH_OPENSSL)
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--	const SSL_METHOD	*ssl_method;
--#else
--	SSL_METHOD	*ssl_method;
--#endif
--#endif /* WITH_NSS|WITH_OPENSSL */
-+#endif /* WITH_NSS */
- 
- 	if (!certfile) {
- 		return;
-@@ -386,18 +380,29 @@
- 
- #ifdef WITH_OPENSSL
- 
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
- 	SSL_load_error_strings();
- 	SSL_library_init();
- 
--	if ((ssl_method = TLSv1_server_method()) == NULL) {
-+	ssl_ctx = SSL_CTX_new(SSLv23_server_method());
-+#else
-+	ssl_ctx = SSL_CTX_new(TLS_server_method());
-+#endif
-+
-+	if (!ssl_ctx) {
- 		ssl_debug();
--		fatalx(EXIT_FAILURE, "TLSv1_server_method failed");
-+		fatalx(EXIT_FAILURE, "SSL_CTX_new failed");
- 	}
- 
--	if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) {
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+	/* set minimum protocol TLSv1 */
-+	SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
-+#else
-+	if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) {
- 		ssl_debug();
--		fatalx(EXIT_FAILURE, "SSL_CTX_new failed");
-+		fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)");
- 	}
-+#endif
- 
- 	if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) {
- 		ssl_debug();

Copied: nut/repos/community-x86_64/nut-openssl-1.1.patch (from rev 1266863, nut/trunk/nut-openssl-1.1.patch)
===================================================================
--- nut-openssl-1.1.patch	                        (rev 0)
+++ nut-openssl-1.1.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,151 @@
+From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001
+From: Arjen de Korte <build+lede at de-korte.org>
+Date: Mon, 27 Nov 2017 21:10:13 +0100
+Subject: [PATCH] Add support for openssl-1.1.0
+
+--- a/clients/upsclient.c
++++ b/clients/upsclient.c
+@@ -299,11 +299,6 @@
+ {
+ #ifdef WITH_OPENSSL
+ 	int ret, ssl_mode = SSL_VERIFY_NONE;
+-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+-	const SSL_METHOD	*ssl_method;
+-#else
+-	SSL_METHOD	*ssl_method;
+-#endif
+ #elif defined(WITH_NSS) /* WITH_OPENSSL */
+ 	SECStatus	status;
+ #endif /* WITH_OPENSSL | WITH_NSS */
+@@ -315,22 +310,32 @@
+ 	}
+ 	
+ #ifdef WITH_OPENSSL
+-	
+-	SSL_library_init();
+-	SSL_load_error_strings();
+ 
+-	ssl_method = TLSv1_client_method();
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++	SSL_load_error_strings();
++	SSL_library_init();
+ 
+-	if (!ssl_method) {
+-		return 0;
+-	}
++	ssl_ctx = SSL_CTX_new(SSLv23_client_method());
++#else
++	ssl_ctx = SSL_CTX_new(TLS_client_method());
++#endif
+ 
+-	ssl_ctx = SSL_CTX_new(ssl_method);
+ 	if (!ssl_ctx) {
+ 		upslogx(LOG_ERR, "Can not initialize SSL context");
+ 		return -1;
+ 	}
+ 	
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++	/* set minimum protocol TLSv1 */
++	SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
++#else
++	ret = SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION);
++	if (ret != 1) {
++		upslogx(LOG_ERR, "Can not set minimum protocol to TLSv1");
++		return -1;
++	}
++#endif
++
+ 	if (!certpath) {
+ 		if (certverify == 1) {
+ 			upslogx(LOG_ERR, "Can not verify certificate if any is specified");
+@@ -737,7 +742,7 @@
+ 	switch(res)
+ 	{
+ 	case 1:
+-		upsdebugx(3, "SSL connected");
++		upsdebugx(3, "SSL connected (%s)", SSL_get_version(ups->ssl));
+ 		break;
+ 	case 0:
+ 		upslog_with_errno(1, "SSL_connect do not accept handshake.");
+--- a/clients/upssched.c
++++ b/clients/upssched.c
+@@ -794,7 +794,7 @@
+ 	}
+ 
+ 	if (!strcmp(cmd, "EXECUTE")) {
+-		if (ca1 == '\0') {
++		if (ca1[0] == '\0') {
+ 			upslogx(LOG_ERR, "Empty EXECUTE command argument");
+ 			return;
+ 		}
+--- a/m4/nut_check_libopenssl.m4
++++ b/m4/nut_check_libopenssl.m4
+@@ -58,7 +58,7 @@
+ 
+ 	dnl check if openssl is usable
+ 	AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_openssl=yes], [nut_have_openssl=no], [AC_INCLUDES_DEFAULT])
+-	AC_CHECK_FUNCS(SSL_library_init, [], [nut_have_openssl=no])
++	AC_CHECK_FUNCS(SSL_CTX_new, [], [nut_have_openssl=no])
+ 
+ 	if test "${nut_have_openssl}" = "yes"; then
+ 		nut_with_ssl="yes"
+--- a/server/netssl.c
++++ b/server/netssl.c
+@@ -274,7 +274,7 @@
+ 	{
+ 	case 1:
+ 		client->ssl_connected = 1;
+-		upsdebugx(3, "SSL connected");
++		upsdebugx(3, "SSL connected (%s)", SSL_get_version(client->ssl));
+ 		break;
+ 		
+ 	case 0:
+@@ -370,13 +370,7 @@
+ {
+ #ifdef WITH_NSS
+ 	SECStatus status;
+-#elif defined(WITH_OPENSSL)
+-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+-	const SSL_METHOD	*ssl_method;
+-#else
+-	SSL_METHOD	*ssl_method;
+-#endif
+-#endif /* WITH_NSS|WITH_OPENSSL */
++#endif /* WITH_NSS */
+ 
+ 	if (!certfile) {
+ 		return;
+@@ -386,18 +380,29 @@
+ 
+ #ifdef WITH_OPENSSL
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ 	SSL_load_error_strings();
+ 	SSL_library_init();
+ 
+-	if ((ssl_method = TLSv1_server_method()) == NULL) {
++	ssl_ctx = SSL_CTX_new(SSLv23_server_method());
++#else
++	ssl_ctx = SSL_CTX_new(TLS_server_method());
++#endif
++
++	if (!ssl_ctx) {
+ 		ssl_debug();
+-		fatalx(EXIT_FAILURE, "TLSv1_server_method failed");
++		fatalx(EXIT_FAILURE, "SSL_CTX_new failed");
+ 	}
+ 
+-	if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL) {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++	/* set minimum protocol TLSv1 */
++	SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
++#else
++	if (SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_VERSION) != 1) {
+ 		ssl_debug();
+-		fatalx(EXIT_FAILURE, "SSL_CTX_new failed");
++		fatalx(EXIT_FAILURE, "SSL_CTX_set_min_proto_version(TLS1_VERSION)");
+ 	}
++#endif
+ 
+ 	if (SSL_CTX_use_certificate_chain_file(ssl_ctx, certfile) != 1) {
+ 		ssl_debug();

Deleted: nut-snmp-usb-order.patch
===================================================================
--- nut-snmp-usb-order.patch	2022-08-18 10:33:22 UTC (rev 1266863)
+++ nut-snmp-usb-order.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,38 +0,0 @@
-The code that generates the SNMP and USB headers to compile against does not
-have a deterministic order, leading to different results at times.
-
-Signed-off-by: Robin H. Johnson <robbat2 at gentoo.org>
-
-diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-snmpinfo.py nut-2.7.1/tools/nut-snmpinfo.py
---- nut-2.7.1.orig/tools/nut-snmpinfo.py	2014-01-04 19:08:19.117150636 -0800
-+++ nut-2.7.1/tools/nut-snmpinfo.py	2013-07-26 12:41:11.000000000 -0700
-@@ -78,7 +78,9 @@
- output_file.write( "/* SNMP IDs device table */\n" )
- output_file.write( "static snmp_device_id_t snmp_device_table[] = {\n" )
- 
--for filename in glob.glob('../drivers/*-mib.c'):
-+mibs = glob.glob('../drivers/*-mib.c')
-+mibs.sort()
-+for filename in mibs:
- 	list_of_line = open(filename,'r').read().split(';')
- 	for line in list_of_line:
- 		if "mib2nut_info_t" in line:
-diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-usbinfo.pl nut-2.7.1/tools/nut-usbinfo.pl
---- nut-2.7.1.orig/tools/nut-usbinfo.pl	2014-01-04 19:12:45.595949760 -0800
-+++ nut-2.7.1/tools/nut-usbinfo.pl	2013-11-17 11:27:38.000000000 -0800
-@@ -75,7 +75,12 @@
- 
- ################# MAIN #################
- 
--find(\&find_usbdevs,$scanPath);
-+find({ 
-+		wanted => \&find_usbdevs, 
-+		follow => 1, 
-+		preprocess => sub { return sort @_ },
-+	},
-+	$scanPath);
- &gen_usb_files;
- 
- ################# SUB METHOD #################
-
-

Copied: nut/repos/community-x86_64/nut-snmp-usb-order.patch (from rev 1266863, nut/trunk/nut-snmp-usb-order.patch)
===================================================================
--- nut-snmp-usb-order.patch	                        (rev 0)
+++ nut-snmp-usb-order.patch	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,38 @@
+The code that generates the SNMP and USB headers to compile against does not
+have a deterministic order, leading to different results at times.
+
+Signed-off-by: Robin H. Johnson <robbat2 at gentoo.org>
+
+diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-snmpinfo.py nut-2.7.1/tools/nut-snmpinfo.py
+--- nut-2.7.1.orig/tools/nut-snmpinfo.py	2014-01-04 19:08:19.117150636 -0800
++++ nut-2.7.1/tools/nut-snmpinfo.py	2013-07-26 12:41:11.000000000 -0700
+@@ -78,7 +78,9 @@
+ output_file.write( "/* SNMP IDs device table */\n" )
+ output_file.write( "static snmp_device_id_t snmp_device_table[] = {\n" )
+ 
+-for filename in glob.glob('../drivers/*-mib.c'):
++mibs = glob.glob('../drivers/*-mib.c')
++mibs.sort()
++for filename in mibs:
+ 	list_of_line = open(filename,'r').read().split(';')
+ 	for line in list_of_line:
+ 		if "mib2nut_info_t" in line:
+diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-usbinfo.pl nut-2.7.1/tools/nut-usbinfo.pl
+--- nut-2.7.1.orig/tools/nut-usbinfo.pl	2014-01-04 19:12:45.595949760 -0800
++++ nut-2.7.1/tools/nut-usbinfo.pl	2013-11-17 11:27:38.000000000 -0800
+@@ -75,7 +75,12 @@
+ 
+ ################# MAIN #################
+ 
+-find(\&find_usbdevs,$scanPath);
++find({ 
++		wanted => \&find_usbdevs, 
++		follow => 1, 
++		preprocess => sub { return sort @_ },
++	},
++	$scanPath);
+ &gen_usb_files;
+ 
+ ################# SUB METHOD #################
+
+

Deleted: nut.sysusers
===================================================================
--- nut.sysusers	2022-08-18 10:33:22 UTC (rev 1266863)
+++ nut.sysusers	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,2 +0,0 @@
-u nut - "Network UPS Tools" /var/lib/nut
-m nut uucp

Copied: nut/repos/community-x86_64/nut.sysusers (from rev 1266863, nut/trunk/nut.sysusers)
===================================================================
--- nut.sysusers	                        (rev 0)
+++ nut.sysusers	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,2 @@
+u nut - "Network UPS Tools" /var/lib/nut
+m nut uucp

Deleted: nut.tmpfiles
===================================================================
--- nut.tmpfiles	2022-08-18 10:33:22 UTC (rev 1266863)
+++ nut.tmpfiles	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -1,6 +0,0 @@
-d /run/nut 0700 nut nut -
-d /var/lib/nut 0700 nut nut -
-z /etc/nut/upsd.conf 0640 root nut -
-z /etc/nut/upsd.users 0640 root nut -
-z /etc/nut/upsmon.conf 0640 root nut -
-

Copied: nut/repos/community-x86_64/nut.tmpfiles (from rev 1266863, nut/trunk/nut.tmpfiles)
===================================================================
--- nut.tmpfiles	                        (rev 0)
+++ nut.tmpfiles	2022-08-18 10:33:39 UTC (rev 1266864)
@@ -0,0 +1,6 @@
+d /run/nut 0700 nut nut -
+d /var/lib/nut 0700 nut nut -
+z /etc/nut/upsd.conf 0640 root nut -
+z /etc/nut/upsd.users 0640 root nut -
+z /etc/nut/upsmon.conf 0640 root nut -
+



More information about the arch-commits mailing list