New release (1.3-beta)

This commit is contained in:
Pavel Zhukov 2017-10-26 13:42:16 +02:00
parent 4c4a7febca
commit 1713070789
7 changed files with 150 additions and 284 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@
/kea-1.1.0-beta.tar.gz
/kea-1.1.0.tar.gz
/kea-1.2.0.tar.gz
/kea-1.3.0-beta.tar.gz

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAABAgAGBQJX7PWFAAoJEG+m68mRGkwC9R4IAJ38ERPBzm7TwgnjJbhONRAF
21bJHuGSy7Q3X4TrxQemIBix3HKlYAh0Xq234mv1Kx5MHPArrg9bGZQ3yFPdFW0n
qO/PdZnAybemzrwX2qhC9v1YO6rP+W4kcgOby5W3gVBIqiHj55qTbGPwsEwWZSWI
SAx2gqISn1j9rMXA0BjNIB4B9DZbyq9jSciV/7RYHVOVN++BvbB5/IM+jKTCSHu2
RT8Nwj+wf3TjGCn0qnXiaeSkUJUfIA6Sb2ZhDDe47Do/qQJ65CPtiiNDHFJBITpW
kqEuErI0AWzVg6a0dJOOY66WigC0jSs9wnbYwzqTbuIeH7CauXmUlJZ0y5os3h8=
=wVz2
-----END PGP SIGNATURE-----

13
kea-1.3.0-hooksdir.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/hooks/dhcp/lease_cmds/Makefile.am b/src/hooks/dhcp/lease_cmds/Makefile.am
index 2c36689..fb6365e 100644
--- a/src/hooks/dhcp/lease_cmds/Makefile.am
+++ b/src/hooks/dhcp/lease_cmds/Makefile.am
@@ -36,7 +36,7 @@ liblease_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
liblease_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
# install the shared object into $(libdir)/hooks
-lib_hooksdir = $(libdir)/hooks
+lib_hooksdir = $(libdir)/kea/hooks
lib_hooks_LTLIBRARIES = libdhcp_lease_cmds.la
libdhcp_lease_cmds_la_SOURCES =

View File

@ -1,145 +0,0 @@
Author: Adam Majer <adamm@zombino.com>
Summary: Add OpenSSL 1.1 support.
PR: https://github.com/isc-projects/kea/pull/34
--- a/src/lib/cryptolink/openssl_hash.cc
+++ b/src/lib/cryptolink/openssl_hash.cc
@@ -5,11 +5,11 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <cryptolink.h>
#include <cryptolink/crypto_hash.h>
-#include <boost/scoped_ptr.hpp>
+#include <boost/move/unique_ptr.hpp>
#include <openssl/evp.h>
#include <cryptolink/openssl_common.h>
@@ -60,24 +60,17 @@ public:
isc_throw(isc::cryptolink::UnsupportedAlgorithm,
"Unknown hash algorithm: " <<
static_cast<int>(hash_algorithm));
}
- md_.reset(new EVP_MD_CTX);
+ md_.reset(EVP_MD_CTX_new());
EVP_MD_CTX_init(md_.get());
EVP_DigestInit_ex(md_.get(), algo, NULL);
}
- /// @brief Destructor
- ~HashImpl() {
- if (md_) {
- EVP_MD_CTX_cleanup(md_.get());
- }
- }
-
/// @brief Returns the output size of the digest
///
/// @return output size of the digest
size_t getOutputLength() const {
return (EVP_MD_CTX_size(md_.get()));
@@ -128,12 +121,25 @@ public:
}
return (std::vector<uint8_t>(digest.begin(), digest.end()));
}
private:
+ class EvpDeleter {
+ public:
+ void operator()(EVP_MD_CTX *ptr) {EVP_MD_CTX_free(ptr);}
+ };
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static EVP_MD_CTX* EVP_MD_CTX_new() { return new EVP_MD_CTX; }
+ static void EVP_MD_CTX_free(EVP_MD_CTX *ptr) {
+ EVP_MD_CTX_cleanup(ptr);
+ delete ptr;
+ }
+#endif
+
/// @brief The protected pointer to the OpenSSL EVP_MD_CTX structure
- boost::scoped_ptr<EVP_MD_CTX> md_;
+ boost::movelib::unique_ptr<EVP_MD_CTX, EvpDeleter> md_;
};
Hash::Hash(const HashAlgorithm hash_algorithm)
{
impl_ = new HashImpl(hash_algorithm);
--- a/src/lib/cryptolink/openssl_hmac.cc
+++ b/src/lib/cryptolink/openssl_hmac.cc
@@ -5,11 +5,11 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <cryptolink.h>
#include <cryptolink/crypto_hmac.h>
-#include <boost/scoped_ptr.hpp>
+#include <boost/move/unique_ptr.hpp>
#include <openssl/hmac.h>
#include <cryptolink/openssl_common.h>
@@ -39,25 +39,16 @@ public:
}
if (secret_len == 0) {
isc_throw(BadKey, "Bad HMAC secret length: 0");
}
- md_.reset(new HMAC_CTX);
- HMAC_CTX_init(md_.get());
-
+ md_.reset(HMAC_CTX_new());
HMAC_Init_ex(md_.get(), secret,
static_cast<int>(secret_len),
algo, NULL);
}
- /// @brief Destructor
- ~HMACImpl() {
- if (md_) {
- HMAC_CTX_cleanup(md_.get());
- }
- }
-
/// @brief Returns the output size of the digest
///
/// @return output size of the digest
size_t getOutputLength() const {
int size = HMAC_size(md_.get());
@@ -128,13 +119,29 @@ public:
}
return (digest.same(sig, len));
}
private:
+ class HMAC_Deleter {
+ public:
+ void operator()(HMAC_CTX *ptr) { HMAC_CTX_free(ptr); }
+ };
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static HMAC_CTX* HMAC_CTX_new() {
+ HMAC_CTX *ptr = new HMAC_CTX;
+ HMAC_CTX_init(ptr);
+ return ptr;
+ }
+ static void HMAC_CTX_free(HMAC_CTX *ptr) {
+ HMAC_CTX_cleanup(ptr);
+ delete ptr;
+ }
+#endif
/// @brief The protected pointer to the OpenSSL HMAC_CTX structure
- boost::scoped_ptr<HMAC_CTX> md_;
+ boost::movelib::unique_ptr<HMAC_CTX, HMAC_Deleter> md_;
};
HMAC::HMAC(const void* secret, size_t secret_length,
const HashAlgorithm hash_algorithm)
{

View File

@ -1,45 +1,8 @@
From 683028b4f5dcf7fb443c85f331e319123f0027a5 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Wed, 1 Apr 2015 13:14:57 +0200
Subject: [PATCH] Systemd service unit files.
As of August 2014, all Linux distributions include systemd and most of
them enable it by default.
https://en.wikipedia.org/wiki/Systemd#Adoption
There are many systemd HOWTOs, like:
https://wiki.archlinux.org/index.php/systemd
https://coreos.com/docs/launching-containers/launching/getting-started-with-systemd/
https://fedoraproject.org/wiki/Packaging:Systemd
For description of options in the service files, see:
http://www.freedesktop.org/software/systemd/man/systemd.unit.html
http://www.freedesktop.org/software/systemd/man/systemd.service.html
Installation of these files is turned on with --enable-systemd
configure option. They are installed into
PREFIX/lib/systemd/system/ by default. One can also
use --with-systemd-unitdir to specify another directory.
For now the template files reside in src/bin/keactrl/
as I haven't figured out a better place.
---
configure.ac | 12 ++++++++++
src/bin/keactrl/Makefile.am | 39 ++++++++++++++++++++++++++++++--
src/bin/keactrl/kea-dhcp-ddns.service.in | 12 ++++++++++
src/bin/keactrl/kea-dhcp4.service.in | 12 ++++++++++
src/bin/keactrl/kea-dhcp6.service.in | 12 ++++++++++
tools/path_replacer.sh.in | 4 +++-
6 files changed, 88 insertions(+), 3 deletions(-)
create mode 100644 src/bin/keactrl/kea-dhcp-ddns.service.in
create mode 100644 src/bin/keactrl/kea-dhcp4.service.in
create mode 100644 src/bin/keactrl/kea-dhcp6.service.in
diff --git a/configure.ac b/configure.ac
index a2b0daf..aa614c0 100644
index 46780d5..43c57b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1367,6 +1367,18 @@ if test "x$VALGRIND" != "xno"; then
@@ -1152,6 +1152,18 @@ if test "x$VALGRIND" != "xno"; then
found_valgrind="found"
fi
@ -58,6 +21,112 @@ index a2b0daf..aa614c0 100644
# Check for optreset in unistd.h. On BSD systems the optreset is
# used to reset the state of getopt() function. Resetting its state
# is required if command line arguments are parsed multiple times
diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am
index c83a597..827f916 100644
--- a/src/bin/keactrl/Makefile.am
+++ b/src/bin/keactrl/Makefile.am
@@ -32,9 +32,37 @@ endif
kea.conf: kea.conf.pre
$(top_builddir)/tools/path_replacer.sh $(top_srcdir)/src/bin/keactrl/kea.conf.pre $@
+INSTALL_TARGETS = install-empty
+
if INSTALL_CONFIGURATIONS
install-data-local:
+INSTALL_TARGETS += install-config-files
+
+endif
+
+if USE_SYSTEMD
+
+EXTRA_DIST += kea-dhcp4.service.in kea-dhcp6.service.in kea-dhcp-ddns.service.in
+DISTCLEANFILES += kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service
+BUILT_SOURCES += kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service
+INSTALL_TARGETS += install-systemd-files
+
+endif
+
+kea-dhcp4.service: kea-dhcp4.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+kea-dhcp6.service: kea-dhcp6.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+kea-dhcp-ddns.service: kea-dhcp-ddns.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+install-empty:
+ :
+
+install-config-files:
$(mkinstalldirs) $(DESTDIR)/@sysconfdir@/@PACKAGE@
for f in $(CONFIGFILES) ; do \
if test ! -f $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f; then \
@@ -42,4 +70,12 @@ install-data-local:
fi ; \
done
-endif
+install-systemd-files:
+ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNITDIR)
+ $(INSTALL_DATA) kea-dhcp4.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp4.service
+ $(INSTALL_DATA) kea-dhcp6.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp6.service
+ $(INSTALL_DATA) kea-dhcp-ddns.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp-ddns.service
+
+install-data-local: $(INSTALL_TARGETS)
+
+uninstall-local: $(UNINSTALL_TARGETS)
diff --git a/tools/path_replacer.sh.in b/tools/path_replacer.sh.in
index f444afc..2ce8b3b 100644
--- a/tools/path_replacer.sh.in
+++ b/tools/path_replacer.sh.in
@@ -19,12 +19,14 @@
prefix=@prefix@
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
+sbindir=@sbindir@
echo "Replacing \@prefix\@ with ${prefix}"
echo "Replacing \@sysconfdir\@ with ${sysconfdir}"
echo "Replacing \@localstatedir\@ with ${localstatedir}"
+echo "Replacing \@sbindir\@ with ${sbindir}"
echo "Input file: $1"
echo "Output file: $2"
-sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g" $1 > $2
+sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g; s@SEP@\@sbindir\@@SEP@${sbindir}@SEP@g" $1 > $2
diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am
index 827f916..547df73 100644
--- a/src/bin/keactrl/Makefile.am
+++ b/src/bin/keactrl/Makefile.am
@@ -76,6 +76,4 @@ install-systemd-files:
$(INSTALL_DATA) kea-dhcp6.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp6.service
$(INSTALL_DATA) kea-dhcp-ddns.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp-ddns.service
-install-data-local: $(INSTALL_TARGETS)
-
uninstall-local: $(UNINSTALL_TARGETS)
diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am
index 547df73..10f2233 100644
--- a/src/bin/keactrl/Makefile.am
+++ b/src/bin/keactrl/Makefile.am
@@ -36,7 +36,6 @@ INSTALL_TARGETS = install-empty
if INSTALL_CONFIGURATIONS
-install-data-local:
INSTALL_TARGETS += install-config-files
endif
@@ -76,4 +75,6 @@ install-systemd-files:
$(INSTALL_DATA) kea-dhcp6.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp6.service
$(INSTALL_DATA) kea-dhcp-ddns.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp-ddns.service
+install-data-local: $(INSTALL_TARGETS)
+
uninstall-local: $(UNINSTALL_TARGETS)
diff --git a/src/bin/keactrl/kea-dhcp-ddns.service.in b/src/bin/keactrl/kea-dhcp-ddns.service.in
new file mode 100644
index 0000000..d1e0526
@ -112,82 +181,3 @@ index 0000000..c24f584
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/path_replacer.sh.in b/tools/path_replacer.sh.in
index 43d7bff..82625ca 100644
--- a/tools/path_replacer.sh.in
+++ b/tools/path_replacer.sh.in
@@ -27,12 +27,14 @@
prefix=@prefix@
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
+sbindir=@sbindir@
echo "Replacing \@prefix\@ with ${prefix}"
echo "Replacing \@sysconfdir\@ with ${sysconfdir}"
echo "Replacing \@localstatedir\@ with ${localstatedir}"
+echo "Replacing \@sbindir\@ with ${sbindir}"
echo "Input file: $1"
echo "Output file: $2"
-sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g" $1 > $2
+sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g; s@SEP@\@sbindir\@@SEP@${sbindir}@SEP@g" $1 > $2
--
2.3.4
diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am
index ac2c894..9bd8ed0 100644
--- a/src/bin/keactrl/Makefile.am
+++ b/src/bin/keactrl/Makefile.am
@@ -35,10 +35,36 @@ kea.conf: kea.conf.pre
kea-ca.conf: kea-ca.conf.pre
$(top_builddir)/tools/path_replacer.sh $(top_srcdir)/src/bin/keactrl/kea-ca.conf.pre $@
+INSTALL_TARGETS = install-empty
if INSTALL_CONFIGURATIONS
-install-data-local:
+INSTALL_TARGETS += install-config-files
+
+endif
+
+if USE_SYSTEMD
+
+EXTRA_DIST += kea-dhcp4.service.in kea-dhcp6.service.in kea-dhcp-ddns.service.in
+DISTCLEANFILES += kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service
+BUILT_SOURCES += kea-dhcp4.service kea-dhcp6.service kea-dhcp-ddns.service
+INSTALL_TARGETS += install-systemd-files
+
+endif
+
+kea-dhcp4.service: kea-dhcp4.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+kea-dhcp6.service: kea-dhcp6.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+kea-dhcp-ddns.service: kea-dhcp-ddns.service.in
+ $(top_builddir)/tools/path_replacer.sh $< $@
+
+install-empty:
+ :
+
+install-config-files:
$(mkinstalldirs) $(DESTDIR)/@sysconfdir@/@PACKAGE@
for f in $(CONFIGFILES) ; do \
if test ! -f $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f; then \
@@ -46,4 +72,12 @@ install-data-local:
fi ; \
done
-endif
+install-systemd-files:
+ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNITDIR)
+ $(INSTALL_DATA) kea-dhcp4.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp4.service
+ $(INSTALL_DATA) kea-dhcp6.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp6.service
+ $(INSTALL_DATA) kea-dhcp-ddns.service $(DESTDIR)$(SYSTEMD_UNITDIR)/kea-dhcp-ddns.service
+
+install-data-local: $(INSTALL_TARGETS)
+
+uninstall-local: $(UNINSTALL_TARGETS)

View File

@ -3,20 +3,21 @@
%global prever beta
#%%global VERSION %%{version}-%%{patchver}
#%%global VERSION %%{version}-%%{prever}
%global VERSION %%{version}
Summary: DHCPv4, DHCPv6 and DDNS server from ISC
Name: kea
Version: 1.2.0
Release: 7%{?dist}
#%%global VERSION %%{LVERSION}-%%{patchver}
%global LVERSION %{version}-%{prever}
#%%global VERSION %%{LVERSION}
Version: 1.3.0
Release: 1%{?dist}
License: MPLv2.0 and Boost
URL: http://kea.isc.org
Source0: http://ftp.isc.org/isc/kea/%{VERSION}/kea-%{VERSION}.tar.gz
Source0: http://ftp.isc.org/isc/kea/%{LVERSION}/kea-%{LVERSION}.tar.gz
# http://kea.isc.org/ticket/3529
Patch0: kea-systemd.patch
Patch1: kea-1.3.0-hooksdir.patch
# autoreconf
BuildRequires: autoconf automake libtool
@ -64,6 +65,17 @@ Summary: Shared libraries used by Kea DHCP server
%description libs
This package contains shared libraries used by Kea DHCP server.
%package hooks
Summary: Hooks libraries for kea
Requires: kea-libs%{?_isa} = %{version}-%{release}
%description hooks
Hooking mechanism allow Kea to load one
or more dynamically-linked libraries (known as "hooks libraries")
and, at various points in its processing ("hook points"), call
functions in them. Those functions perform whatever custom
processing is required.
%package devel
Summary: Development headers and libraries for Kea DHCP server
Requires: kea-libs%{?_isa} = %{version}-%{release}
@ -74,9 +86,9 @@ Requires: boost-devel
Header files and API documentation.
%prep
%setup -q -n kea-%{VERSION}
%setup -q -n kea-%{LVERSION}
%patch0 -p1 -b .systemd
%patch1 -p1 -b .hooksdir
# install leases db in /var/lib/kea/ not /var/kea/
# http://kea.isc.org/ticket/3523
@ -170,7 +182,6 @@ EOF
%dir %{_sysconfdir}/kea/
%config(noreplace) %{_sysconfdir}/kea/kea.conf
%config(noreplace) %{_sysconfdir}/kea/keactrl.conf
%config(noreplace) %{_sysconfdir}/kea/kea-ca.conf
%dir %{_datarootdir}/kea/
%{_datarootdir}/kea/scripts
%dir /run/kea/
@ -198,6 +209,10 @@ EOF
%{_mandir}/man8/kea-ctrl-agent.8.gz
%{_mandir}/man8/kea-shell.8.gz
%files hooks
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/hooks
%files libs
#%%dir %%{_pkgdocdir}/
#%%{_pkgdocdir}/COPYING
@ -250,6 +265,9 @@ EOF
%{_libdir}/pkgconfig/dns++.pc
%changelog
* Mon Oct 23 2017 Pavel Zhukov <pzhukov@redhat.com> - 1.2.0-8
- Require openssl102
* Sun Oct 22 2017 Pavel Zhukov <pzhukov@redhat.com> - 1.2.0-7
- Rebuild with new openssl

View File

@ -1 +1 @@
SHA512 (kea-1.2.0.tar.gz) = d90571027edbce9eeb75d9ac889865dc24c2fd3ab17e44e23337ff623ca098ffd02560f01273da3c28f13734d95d5950110bc116bed527a295a9dc70addcc240
SHA512 (kea-1.3.0-beta.tar.gz) = 24d69bda059aff0187c1e99bd4825591aef1bb876502a0ad5a67457fe02e08b3738de4e0a0c55c6ac482e3c2b8de02c4528c354c6cea598e64d3c553e1fcc051