[pdns/el6] Fixed permissions of pdns.conf file (rhbz#646510)

Morten Stevens mstevens at fedoraproject.org
Sat Oct 20 22:24:33 UTC 2012


commit 7006d966b01a72f799408c01ac8f2c94515ed4d5
Author: Morten Stevens <mstevens at imt-systems.com>
Date:   Sun Oct 21 00:23:59 2012 +0200

    Fixed permissions of pdns.conf file (rhbz#646510)

 pdns-default-config.patch |    9 +++++++
 pdns.spec                 |   58 ++++++++++++++++++++++++--------------------
 2 files changed, 41 insertions(+), 26 deletions(-)
---
diff --git a/pdns-default-config.patch b/pdns-default-config.patch
new file mode 100644
index 0000000..8025627
--- /dev/null
+++ b/pdns-default-config.patch
@@ -0,0 +1,9 @@
+--- pdns-2.9.22.6/pdns/pdns.conf-dist.orig	2012-01-16 09:30:30.000000000 +0100
++++ pdns-2.9.22.6/pdns/pdns.conf-dist	2012-10-20 16:49:35.282964083 +0200
+@@ -1,3 +1,6 @@
++setuid=pdns
++setgid=pdns
++launch=bind
+ # Autogenerated configuration file template
+ #################################
+ # allow-axfr-ips	Allow zonetransfers only to these subnets
diff --git a/pdns.spec b/pdns.spec
index 5fc6894..fd38bf8 100644
--- a/pdns.spec
+++ b/pdns.spec
@@ -1,22 +1,26 @@
-Summary:	A modern, advanced and high performance authoritative-only nameserver
-Name:		pdns
-Version:	2.9.22.6
-Release:	1%{?dist}
-
-Group:		System Environment/Daemons
-License:	GPLv2
-URL:		http://powerdns.com
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Source0:	http://downloads.powerdns.com/releases/%{name}-%{version}.tar.gz
-Patch0:		%{name}-fixinit.patch
-Patch1:		pdns-fix-postgres-detection.patch
-Patch2:		pdns-fix-crash-on-sigstop.patch
-
-Requires(post):	%{_sbindir}/useradd, /sbin/chkconfig
-Requires(preun):	/sbin/service, /sbin/chkconfig
-
-BuildRequires:	boost-devel, chrpath
-Provides:	powerdns = %{version}-%{release}
+Summary: A modern, advanced and high performance authoritative-only nameserver
+Name: pdns
+Version: 2.9.22.6
+Release: 2%{?dist}
+License: GPLv2
+Group: System Environment/Daemons
+URL: http://powerdns.com
+Source0: http://downloads.powerdns.com/releases/%{name}-%{version}.tar.gz
+
+# Patches
+
+Patch0: pdns-default-config.patch
+Patch1: pdns-fixinit.patch
+Patch2: pdns-fix-postgres-detection.patch
+Patch3: pdns-fix-crash-on-sigstop.patch
+
+Requires(post): %{_sbindir}/useradd, /sbin/chkconfig
+Requires(preun): /sbin/service, /sbin/chkconfig
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: boost-devel
+BuildRequires: chrpath
+Provides: powerdns = %{version}-%{release}
 
 %description
 The PowerDNS Nameserver is a modern, advanced and high performance
@@ -81,9 +85,10 @@ This package contains the SQLite backend for %{name}
 
 %prep
 %setup -q
-%patch0 -p1 -b .fixinit
-%patch1 -p1 -b .postgres
-%patch2 -p1 -b .sigstop
+%patch0 -p1 -b .default-config-patch
+%patch1 -p1 -b .fixinit
+%patch2 -p1 -b .postgres
+%patch3 -p1 -b .sigstop
 
 %build
 export CPPFLAGS="-DLDAP_DEPRECATED %{optflags}"
@@ -107,9 +112,7 @@ make install DESTDIR=%{buildroot}
 %{__install} -p -D -m 0755 pdns/pdns %{buildroot}%{_initrddir}/pdns
 %{__mv} %{buildroot}%{_sysconfdir}/%{name}/pdns.conf{-dist,}
 
-# add the pdns user to the config file
-sed -i '1i\setuid=pdns' %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
-sed -i '2i\setgid=pdns' %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
+chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
 
 # strip the static rpath from the binaries
 chrpath --delete %{buildroot}%{_bindir}/pdns_control
@@ -182,6 +185,10 @@ fi
 
 
 %changelog
+* Sat Oct 20 2012 Morten Stevens <mstevens at imt-systems.com> - 2.9.22.6-2
+- Fixed permissions of pdns.conf file (rhbz#646510)
+- Set bind as default backend
+
 * Wed Feb 01 2012 Ruben Kerkhof <ruben at rubenkerkhof.com> 2.9.22.6-1
 - Upstream released new version. Fixes crash introduced in 2.9.22.5
 
@@ -266,4 +273,3 @@ fi
 - Subpackages now require %%{version}-%%{release}
 * Sat Dec 16 2006 <ruben at rubenkerkhof.com> 2.9.20-1
 - Initial import
-


More information about the scm-commits mailing list