Fixes and spec file improvements

This commit is contained in:
Morten Stevens 2017-10-15 21:29:15 +02:00
parent bcd47603ca
commit 79d38387ee
4 changed files with 61 additions and 24 deletions

25
pdns-mysql.patch Normal file
View File

@ -0,0 +1,25 @@
From 2be6b2dcc368ff76842b035b67f7a8170d787889 Mon Sep 17 00:00:00 2001
From: Remi Gacogne <remi.gacogne@powerdns.com>
Date: Thu, 12 Oct 2017 17:32:52 +0200
Subject: [PATCH] auth: Display the needed size when a MySQL result was
truncated
---
modules/gmysqlbackend/smysql.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc
index 5e9354254a..aab16daf9d 100644
--- a/modules/gmysqlbackend/smysql.cc
+++ b/modules/gmysqlbackend/smysql.cc
@@ -233,8 +233,8 @@ class SMySQLStatement: public SSqlStatement
row.reserve(d_fnum);
for(int i=0;i<d_fnum;i++) {
- if (*d_res_bind[i].error) {
- L<<Logger::Warning<<"Result field at row " << d_residx << " column " << i << " has errno " << *d_res_bind[i].error << endl;
+ if (err == MYSQL_DATA_TRUNCATED && *d_res_bind[i].error) {
+ L<<Logger::Warning<<"Result field at row " << d_residx << " column " << i << " has been truncated, we allocated " << d_res_bind[i].buffer_length << " bytes but at least " << *d_res_bind[i].length << " was needed" << endl;
}
if (*d_res_bind[i].is_null) {
row.push_back("");

20
pdns-systemd.patch Normal file
View File

@ -0,0 +1,20 @@
--- pdns-4.1.0-rc1/pdns/pdns.service.in.orig 2017-08-31 10:52:49.000000000 +0200
+++ pdns-4.1.0-rc1/pdns/pdns.service.in 2017-10-15 19:42:44.268439749 +0200
@@ -7,14 +7,15 @@ After=network-online.target mysqld.servi
[Service]
Type=notify
-ExecStart=@sbindir@/pdns_server --guardian=no --daemon=no --disable-syslog --write-pid=no
+ExecStart=@sbindir@/pdns_server --guardian=no --daemon=no --write-pid=no
Restart=on-failure
RestartSec=1
StartLimitInterval=0
PrivateTmp=true
PrivateDevices=true
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_CHOWN CAP_SYS_CHROOT
-NoNewPrivileges=true
+# Disabled NoNewPrivileges (#1305522)
+# NoNewPrivileges=true
# ProtectSystem=full will disallow write access to /etc and /usr, possibly
# not being able to write slaved-zones into sqlite3 or zonefiles.
ProtectSystem=full

View File

@ -1,18 +0,0 @@
[Unit]
Description=PowerDNS Authoritative Server
Documentation=man:pdns_server(8) man:pdns_control(8)
Wants=network-online.target
After=network-online.target mariadb.service postgresql.service slapd.service
[Service]
Type=forking
ExecStart=/usr/sbin/pdns_server --daemon
Restart=on-failure
StartLimitInterval=0
PrivateTmp=true
ProtectHome=true
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
[Install]
WantedBy=multi-user.target

View File

@ -4,14 +4,15 @@
Name: pdns Name: pdns
Version: 4.1.0 Version: 4.1.0
Release: 0.2.%{?prever}%{?dist} Release: 0.3.%{?prever}%{?dist}
Summary: A modern, advanced and high performance authoritative-only nameserver Summary: A modern, advanced and high performance authoritative-only nameserver
Group: System Environment/Daemons Group: System Environment/Daemons
License: GPLv2 License: GPLv2
URL: http://powerdns.com URL: http://powerdns.com
Source0: http://downloads.powerdns.com/releases/%{name}-%{version}-%{?prever}.tar.bz2 Source0: http://downloads.powerdns.com/releases/%{name}-%{version}-%{?prever}.tar.bz2
Source1: pdns.service
Patch0: pdns-disable-secpoll.patch Patch0: pdns-disable-secpoll.patch
Patch1: pdns-systemd.patch
Patch2: pdns-mysql.patch
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(post): systemd-units Requires(post): systemd-units
@ -19,8 +20,10 @@ Requires(preun): systemd-units
Requires(postun): systemd-units Requires(postun): systemd-units
BuildRequires: systemd-units BuildRequires: systemd-units
BuildRequires: systemd-devel
BuildRequires: boost-devel BuildRequires: boost-devel
BuildRequires: lua-devel BuildRequires: lua-devel
BuildRequires: libsodium-devel
BuildRequires: bison BuildRequires: bison
BuildRequires: pandoc BuildRequires: pandoc
BuildRequires: zeromq-devel BuildRequires: zeromq-devel
@ -154,6 +157,8 @@ This package contains the TinyDNS backend for %{name}
%prep %prep
%setup -q -n %{name}-%{version}-%{?prever} %setup -q -n %{name}-%{version}-%{?prever}
%patch0 -p1 -b .disable-secpoll %patch0 -p1 -b .disable-secpoll
%patch1 -p1 -b .systemd
%patch2 -p1 -b .mysql
%build %build
export CPPFLAGS="-DLDAP_DEPRECATED" export CPPFLAGS="-DLDAP_DEPRECATED"
@ -167,9 +172,11 @@ export CPPFLAGS="-DLDAP_DEPRECATED"
--with-lua \ --with-lua \
--with-dynmodules='%{backends}' \ --with-dynmodules='%{backends}' \
--enable-tools \ --enable-tools \
--enable-libsodium \
--enable-remotebackend-zeromq \ --enable-remotebackend-zeromq \
--enable-unit-tests \ --enable-unit-tests \
--enable-reproducible --enable-reproducible \
--enable-systemd
%make_build %make_build
@ -185,9 +192,6 @@ chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
%{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns_zone2ldap %{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns_zone2ldap
%{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns_zone2ldap.1 %{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns_zone2ldap.1
# Copy systemd service file
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/pdns.service
# change user/group to pdns # change user/group to pdns
# change default backend to bind # change default backend to bind
sed -i \ sed -i \
@ -232,6 +236,7 @@ exit 0
%{_mandir}/man1/pdns_zone2ldap.1.gz %{_mandir}/man1/pdns_zone2ldap.1.gz
%{_mandir}/man1/pdnsutil.1.gz %{_mandir}/man1/pdnsutil.1.gz
%{_unitdir}/pdns.service %{_unitdir}/pdns.service
%{_unitdir}/pdns@.service
%{_libdir}/%{name}/libbindbackend.so %{_libdir}/%{name}/libbindbackend.so
%dir %{_libdir}/%{name}/ %dir %{_libdir}/%{name}/
%dir %{_sysconfdir}/%{name}/ %dir %{_sysconfdir}/%{name}/
@ -319,6 +324,11 @@ exit 0
%{_libdir}/%{name}/libtinydnsbackend.so %{_libdir}/%{name}/libtinydnsbackend.so
%changelog %changelog
* Sun Oct 15 2017 Morten Stevens <mstevens@fedoraproject.org> - 4.1.0-0.3.rc1
- Added Fedora specific systemd patch
- Added upstream patch to fix an issue with MariaDB 10.2
- Enabled upstream systemd (--enable-systemd) support
* Thu Sep 21 2017 Morten Stevens <mstevens@fedoraproject.org> - 4.1.0-0.2.rc1 * Thu Sep 21 2017 Morten Stevens <mstevens@fedoraproject.org> - 4.1.0-0.2.rc1
- Switch to mariadb-connector-c-devel - Switch to mariadb-connector-c-devel
- Spec file improvements - Spec file improvements