summaryrefslogtreecommitdiff
path: root/sys-power
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-06-01 00:07:06 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-06-01 00:07:06 +0100
commit1551fe56fd6ba43a94509cffc61b6bf854b7ac9f (patch)
treebe99b6ceb874878a108d68c641b476a2df076517 /sys-power
parent0e2a727aba684f1a44cc0402a3f77d242140681b (diff)
gentoo auto-resync : 01:06:2024 - 00:07:06
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/Manifest.gzbin5743 -> 5742 bytes
-rw-r--r--sys-power/nut/Manifest7
-rw-r--r--sys-power/nut/files/lighttpd_nut.conf-2.2.022
-rw-r--r--sys-power/nut/files/nut-2.6.5-init.d-upsd37
-rw-r--r--sys-power/nut/files/nut-2.7.1-snmpusb-order.patch37
-rw-r--r--sys-power/nut/files/nut-2.7.4-nut-scanner.patch35
-rw-r--r--sys-power/nut/files/nut-2.7.4-py3.patch56
-rw-r--r--sys-power/nut/files/nut-2.7.4-slibtool.patch61
-rw-r--r--sys-power/nut/files/nut-openssl-1.1-support.patch151
9 files changed, 0 insertions, 406 deletions
diff --git a/sys-power/Manifest.gz b/sys-power/Manifest.gz
index 4fae0ff902fe..1d482cb80120 100644
--- a/sys-power/Manifest.gz
+++ b/sys-power/Manifest.gz
Binary files differ
diff --git a/sys-power/nut/Manifest b/sys-power/nut/Manifest
index 6aee0b71eede..d9c6b861e200 100644
--- a/sys-power/nut/Manifest
+++ b/sys-power/nut/Manifest
@@ -1,15 +1,8 @@
-AUX lighttpd_nut.conf-2.2.0 852 BLAKE2B 782d4e411266612f1393af5ff05bca420ce7e99e6490138515567fb56c401b6f6e4e8b8a85071cb3f640a30f5cf4be0cff7a408ac2b5f9f505c7a2df1211eb83 SHA512 3bdb8cf6823d06ff84fd85f4484be4d842ce4a06722ebe22d7ddd6ea1b78ea08411a7f4a62a31df1b697f5e687f7ee88c8c4872e6a5a05390cef4a46798a7f35
AUX nut-2.2.2-init.d-upsdrv 859 BLAKE2B 7911afe5ab45fa0123b43ac2fe186dbfa4eb9cb224fe5c6dc702d436d94de92492edc3ccce6a28273267c7b051e296c6ce42b9f420087e0e413921190611f07d SHA512 6ca718fcd0019420eabb4b69e3f24334872336be56c07b14c668813bf3d2b82f92903028d7d3142be743ed22d8dc94d7e471d9596710b9dbc1717e2576d3a8f3
AUX nut-2.6.2-lowspeed-buffer-size.patch 553 BLAKE2B 2f758e7b807117e20b465951676ff524d1d2b52b5a69fcb09ad6811730c0038fff4b81cfcc1daaf6f0cfc6d5248be35c4be8b58f9193fe26028361c888ed1535 SHA512 59a953d3c89acccc3d5c028b36de15059f512d0a8074e7fed1d3831570bd09a544e44b5b754b4ad72f8163295db21160c142a83f4d608e40a401c9452823d7b7
-AUX nut-2.6.5-init.d-upsd 671 BLAKE2B a8658d22ffdba585d9fd6de13a347a16e98182bd484c41f6eb8b3e38d94be6a4eea4475f2586d2a7d8146858bc14b2fd0e861a56681ae25a5ce3116a2b7d435c SHA512 79c36537fb40b8284afb8edc28afa0f98fdf96e8def0382278c6242b4602f1911e29a174825ee676f77aa609b6409ce3483a1d188354956d20be9862c4e78180
AUX nut-2.6.5-init.d-upslog 573 BLAKE2B 2a0e04f83990035beb12eee33cfe7ce4fdcd1f310a7ba6f2255e4ad3a1f76245acf4a66332eea5cce7765d914ce7c14f02da50ebb8fa8640c871a12f492ed28b SHA512 06ca7fa8f3fe729b07a919d2a0ecb573b8ac180c447f927504524fca18894e045492458271b9a15898861cb3839b9fb95b2c843e241c7148bc25331ab8360b36
AUX nut-2.6.5-init.d-upsmon 557 BLAKE2B 2681668f09426397a79ade8fe706c182dcb5c58c8e0189d51f9ccd0eddaf9eae78a083da38625f8868b355f2096ad7566b27cbaf967aa7472a92a760fa9ef767 SHA512 9559af5c12ef23db196762e2f999a463518383506ded48903ca5ad4b06230644668bbaa1fd007784514140ef391f76bb0bd6e11efa5d1698b79c57b7f5f74cf2
-AUX nut-2.7.1-snmpusb-order.patch 1417 BLAKE2B 20c3150559d3810c8bf15a9560ccf950ad1bb26bd58b4f2bcf3736871f4599bc3ad948e5f008b1549184f78d0fa3b417bbc8728660fbb110f4537fce83231bad SHA512 df3701821bc4ef45a5089e4d4439c3367fb23cefce7d06168bd422a8c32a1b373ae9fb3456bd5f90a51a672edf9ce29254a08c2045efe210a11b82399793ec19
-AUX nut-2.7.4-nut-scanner.patch 1615 BLAKE2B dd672f2996ca650a6456084dc92d6a9c6ea1b0fe2d1b812bffcfdefda5e797f3f89e19e325f5a2d9ba066b077b9855d2403e111038bd4024f255f2fee243f500 SHA512 5db031aa5c74e4987824b2ac7a5f6e073de16b8958104ceabb7482a6c6b7779d8380fc30b6189ca2cfee9ab795a7413e537d093b0a338aee73d3385b54d280d7
-AUX nut-2.7.4-py3.patch 1940 BLAKE2B 5bb77bca18ad40a1ba4e579098accb0135c0f4b24436425de3983204554ddb0aeceb473a7a6729048dbfb6175e015129a8bfcce26b169b3e21c905f9f08f079e SHA512 2a4f12954bdf2e50cbfb7a7dd09ed83be27ed2a6d0a2e4244ca8b309614515599c81541b5cfb4c81244b739cf3a47d56cb2746db3fae9e8861c5115c0287041b
-AUX nut-2.7.4-slibtool.patch 2470 BLAKE2B 6baadd663f83209f3abbb4a6b83f170df56da07bb679f6e47571151406c879cfe9a0dbe17fa72678ca66fdcd07ad07bfb8a38e4821cf529e9367a71fad18de69 SHA512 9dfa6c38a56dcf6d743e4ea4eb46ff5e4a81e77eb79df97921662e00c6f4bee4f70a845c3e49ef5ecda31e0e90b8e7f5b450a9c3cd8c5742b093409b894556a8
AUX nut-2.8.0-init.d-upsd 667 BLAKE2B f3ec275cd401df017428c3772fb3f0d51b66173e3d08fdd844e8499bd216b455d6a2846e991c53285092eafc1ad3f43665185c853a438f5331ecd95c2c8c2e30 SHA512 4a58aea9b0119c6ba0949a5d8365cf8785aa49050fb9cb6f6e0ac4d12d1b8e947823d0c41b64500f453fdf236dee6cf60f812c76a65bff9b2ea0f2b713852dc3
-AUX nut-openssl-1.1-support.patch 3873 BLAKE2B 17877276e46372aa17d357efc0851b9cdb33b14ac0c40913b47ea513a8ecaa6eebe3241ae8b324583070d76b6c12d3cf18c043778754b5774af846fb8a33b4d7 SHA512 8945f2f663dc50cfd7041cc7f2c4af5cca4b5ef9cfa1be48c122a623e6eadfc511bbaa60a8bd6b68bb2569c75d5f64613d595ad7444b8d6ec9f773d7743872a1
AUX nut.powerfail.initd 1305 BLAKE2B 88bd2a1b5b3fbb2ab9ea4d408e4cc57399702c587ec8314c5b78aa5ce03d4de0f4850ecd580140bf5a42947853f7f64953e0a2859fb1f83de185682d6b600500 SHA512 9e171fc192efaa16e554725b6bf40377e648400f6f6e860d436218289fadcf96c7209fed76129d0dfec912dc5702cca11c90fea072767135fe1a2ba8e11ef2ac
AUX systemd_notify.patch 1753 BLAKE2B a44167bf491b393474b94ee4c375013cd23d1e1151311eab40ba6ca2c190019631aeb3fd21e20b9ce0a0b98d98506c88ddd9fe043a1000268d8b7b4195d8b489 SHA512 9984fb879a002cd00949dd7e10f5720f3b50ce871312750dbdb8b805903b37b1f8be2c7b2f6b79a13739fba2c28bf0f85427af7c9b7421ebf13cabfb3cd88381
DIST nut-2.8.0.tar.gz 3287640 BLAKE2B 6ad87e9c90920d45846d9c1311e8feeb3c36bfa506d62d938940c00d2fc7f7b30632d079a8ee969db624824ae4fd3e14e41e8acd1eda296e26a3aa340f186b94 SHA512 3c413ae54088045a713eb80cf1bdda474f41bb3b67c7c0248aa7a0c4d441dce1ff42627a2735273d7e36892d1f2eeb895220cf28af63fec2fa0c7a267f82d577
diff --git a/sys-power/nut/files/lighttpd_nut.conf-2.2.0 b/sys-power/nut/files/lighttpd_nut.conf-2.2.0
deleted file mode 100644
index 434be8c87e61..000000000000
--- a/sys-power/nut/files/lighttpd_nut.conf-2.2.0
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Lighttpd configuration for using NUT under Gentoo Linux.
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-###############################################################################
-
-# Simple copy this to /etc/lighttpd/ and include it in your lighttpd.conf.
-# It will make NUT available at http://$HOST/nut/
-
-server.modules += ("mod_cgi")
-
-# If you want to limit it to some host, uncomment the host check and modify it to your needs.
-# $HTTP["host"] == "www2.example.org" {
-alias.url += ( "/nut/" => "/usr/share/nut/cgi/" )
-$HTTP["url"] =~ "^/nut/" {
- dir-listing.activate = "disable"
- cgi.assign = ( ".cgi" => "" )
- index-file.names = ( "upsstats.cgi" )
-}
-# }
-
-# vim: set ft=conf foldmethod=marker et :
diff --git a/sys-power/nut/files/nut-2.6.5-init.d-upsd b/sys-power/nut/files/nut-2.6.5-init.d-upsd
deleted file mode 100644
index c4debd306601..000000000000
--- a/sys-power/nut/files/nut-2.6.5-init.d-upsd
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-extra_started_commands="reload"
-
-pidfile=/var/lib/nut/upsd.pid
-bin=/usr/sbin/upsd
-
-depend() {
- use net
- before upsmon
- after upsdrv
-}
-
-start() {
- ebegin "Starting upsd"
- # clean up first
- pkill -u root,nut -x ${bin}
- sleep 1
- rm -f ${pidfile}
- # now start up
- start-stop-daemon --start --quiet --exec ${bin}
- eend $?
-}
-
-stop() {
- ebegin "Stopping upsd"
- start-stop-daemon --stop --quiet --pidfile ${pidfile}
- eend $?
-}
-
-reload() {
- ebegin "Reloading upsd"
- start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile}
- eend $?
-}
diff --git a/sys-power/nut/files/nut-2.7.1-snmpusb-order.patch b/sys-power/nut/files/nut-2.7.1-snmpusb-order.patch
deleted file mode 100644
index e62b6571d2ce..000000000000
--- a/sys-power/nut/files/nut-2.7.1-snmpusb-order.patch
+++ /dev/null
@@ -1,37 +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@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 #################
-
diff --git a/sys-power/nut/files/nut-2.7.4-nut-scanner.patch b/sys-power/nut/files/nut-2.7.4-nut-scanner.patch
deleted file mode 100644
index c846e3a782cd..000000000000
--- a/sys-power/nut/files/nut-2.7.4-nut-scanner.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 5d98d5536699222bc93c58c1e6f6df43dc9bfcff Mon Sep 17 00:00:00 2001
-From: Arnaud Quette <arnaud.quette@free.fr>
-Date: Thu, 10 Mar 2016 14:41:40 +0100
-Subject: [PATCH] Fix nut-scanner compilation in some environments
-
-Following the commits 5187dab (common: add some string-related functions) and
-e767df5 (common: consolidate some string-related functions), the build rules of
-nut-scanner were not updated to also use str.c. Since the libcommon.la
-dependency was still there, some environments managed to build cleanly, while
-other are failing. Update build dependencies to fix this situation
----
- tools/nut-scanner/Makefile.am | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am
-index 558cb23b8f..db85c68287 100644
---- a/tools/nut-scanner/Makefile.am
-+++ b/tools/nut-scanner/Makefile.am
-@@ -14,14 +14,14 @@ libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \
- scan_avahi.c scan_eaton_serial.c nutscan-serial.c \
- ../../drivers/serial.c \
- ../../drivers/bcmxcp_ser.c \
-- ../../common/common.c
-+ ../../common/common.c ../../common/str.c
- libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS)
- libnutscan_la_LDFLAGS = $(SERLIBS) -version-info 1:0:0
- libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL_CFLAGS) -I$(top_srcdir)/drivers
-
- nut_scanner_SOURCES = nut-scanner.c
- nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include
--nut_scanner_LDADD = libnutscan.la ../../common/libcommon.la
-+nut_scanner_LDADD = libnutscan.la
-
- if WITH_SSL
- libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS)
diff --git a/sys-power/nut/files/nut-2.7.4-py3.patch b/sys-power/nut/files/nut-2.7.4-py3.patch
deleted file mode 100644
index dbe661982eb1..000000000000
--- a/sys-power/nut/files/nut-2.7.4-py3.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From eea0c5e9e5566c36a8b1e364ed4909231901a8f5 Mon Sep 17 00:00:00 2001
-From: Florian Bruhin <git@the-compiler.org>
-Date: Tue, 29 Nov 2016 10:45:04 +0100
-Subject: [PATCH 1/2] Make gen-nutupsconf-aug.py work with Python 3
-
-This makes the script work with Python 2.6+.
-Fixes #345.
----
- scripts/augeas/gen-nutupsconf-aug.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/scripts/augeas/gen-nutupsconf-aug.py b/scripts/augeas/gen-nutupsconf-aug.py
-index 55db17a73..4bb201602 100755
---- a/scripts/augeas/gen-nutupsconf-aug.py
-+++ b/scripts/augeas/gen-nutupsconf-aug.py
-@@ -18,6 +18,8 @@
- # This program extracts all drivers specific variables, declared
- # using 'addvar()' and output a complete ups.conf lens for Augeas
-
-+from __future__ import print_function
-+
- import sys
- import re
- import glob
-@@ -69,7 +71,7 @@ def grep(string,list):
-
- if (len(sys.argv) == 2):
- dirPrefix = sys.argv[1]
-- print dirPrefix
-+ print(dirPrefix)
-
- # 1/ Extract all specific drivers parameters, in a sorted list with unique entries
- # 1.1/ List all drivers implementation files
-
-From 7bf209a5deef1ec1f05cf89c25c8399590d4e4e8 Mon Sep 17 00:00:00 2001
-From: Florian Bruhin <git@the-compiler.org>
-Date: Tue, 29 Nov 2016 17:37:01 +0100
-Subject: [PATCH 2/2] Fix gitlog2changelog.py on python 3
-
----
- tools/gitlog2changelog.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tools/gitlog2changelog.py b/tools/gitlog2changelog.py
-index d8c089187..f0bea4af6 100755
---- a/tools/gitlog2changelog.py
-+++ b/tools/gitlog2changelog.py
-@@ -80,7 +80,7 @@
- else:
- message = message + " " + line.strip()
- # If this line is hit all of the files have been stored for this commit
-- elif re.search('files? changed', line) >= 0:
-+ elif re.search('files? changed', line):
- filesFound = True
- continue
- # Collect the files for this commit. FIXME: Still need to add +/- to files
diff --git a/sys-power/nut/files/nut-2.7.4-slibtool.patch b/sys-power/nut/files/nut-2.7.4-slibtool.patch
deleted file mode 100644
index ddcebdc2ec4f..000000000000
--- a/sys-power/nut/files/nut-2.7.4-slibtool.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From a0328e384ad3fb230c2276c8b6dd9f2c47ac07fb Mon Sep 17 00:00:00 2001
-From: orbea <orbea@riseup.net>
-Date: Sat, 27 Mar 2021 15:18:17 -0700
-Subject: [PATCH] drivers: Fix undefined references with slibtool.
-
-Signed-off-by: orbea <orbea@riseup.net>
----
- drivers/Makefile.am | 15 +++++++++------
- 1 file changed, 9 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/Makefile.am b/drivers/Makefile.am
-index 40746364e3..3c2277cfc0 100644
---- a/drivers/Makefile.am
-+++ b/drivers/Makefile.am
-@@ -4,8 +4,8 @@
- # (libtool version of the static lib, in order to access LTLIBOBJS)
- #FIXME: SERLIBS is only useful for LDADD_DRIVERS_SERIAL not for LDADD_COMMON
- LDADD_COMMON = ../common/libcommon.la ../common/libparseconf.la
--LDADD_DRIVERS = $(LDADD_COMMON) main.o dstate.o
--LDADD_DRIVERS_SERIAL = $(LDADD_DRIVERS) $(SERLIBS) serial.o
-+LDADD_DRIVERS = libdummy.la $(LDADD_COMMON)
-+LDADD_DRIVERS_SERIAL = libdummy_serial.la $(LDADD_DRIVERS) $(SERLIBS)
-
- # most targets are drivers, so make this the default
- LDADD = $(LDADD_DRIVERS_SERIAL)
-@@ -109,6 +109,7 @@ bcmxcp_LDADD = $(LDADD) -lm
- belkin_SOURCES = belkin.c
- belkinunv_SOURCES = belkinunv.c
- bestfcom_SOURCES = bestfcom.c
-+bestfortress_SOURCES = bestfortress.c
- bestuferrups_SOURCES = bestuferrups.c
- bestups_SOURCES = bestups.c
- blazer_ser_SOURCES = blazer.c blazer_ser.c
-@@ -198,7 +199,6 @@ richcomm_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
- riello_usb_SOURCES = riello.c riello_usb.c libusb.c usb-common.c
- riello_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
-
--
- # HID-over-serial
- mge_shut_SOURCES = usbhid-ups.c libshut.c libhid.c hidparser.c mge-hid.c
- # per-target CFLAGS are necessary here
-@@ -253,7 +253,7 @@ nutdrv_qx_LDADD = $(LDADD_DRIVERS) -lm
- nutdrv_qx_CFLAGS = $(AM_CFLAGS)
- if WITH_SERIAL
- nutdrv_qx_CFLAGS += -DQX_SERIAL
--nutdrv_qx_LDADD += $(SERLIBS) serial.o
-+nutdrv_qx_LDADD += libdummy_serial.la $(SERLIBS)
- endif
- if WITH_USB
- nutdrv_qx_CFLAGS += -DQX_USB
-@@ -291,5 +291,8 @@ dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h bcmxcp_ser.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_LTLIBRARIES = libdummy.la libdummy_serial.la
-+libdummy_la_SOURCES = main.c dstate.c
-+libdummy_la_LDFLAGS = -no-undefined -static
-+libdummy_serial_la_SOURCES = serial.c
-+libdummy_serial_la_LDFLAGS = -no-undefined -static
diff --git a/sys-power/nut/files/nut-openssl-1.1-support.patch b/sys-power/nut/files/nut-openssl-1.1-support.patch
deleted file mode 100644
index 5d1c2afe7dca..000000000000
--- a/sys-power/nut/files/nut-openssl-1.1-support.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From da1f5aa699f54e0f6977ab64a3bc2f90a51c3104 Mon Sep 17 00:00:00 2001
-From: Arjen de Korte <build+lede@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();