From 593eb1e655be3a87e99a218521638bbab9cfa9fa Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 18 Nov 2019 10:40:09 +0100 Subject: [PATCH] EL pkgs: chown dirs to service user --- builder-support/specs/pdns.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/builder-support/specs/pdns.spec b/builder-support/specs/pdns.spec index 856d6ec3e4..d594cf67d3 100644 --- a/builder-support/specs/pdns.spec +++ b/builder-support/specs/pdns.spec @@ -262,6 +262,15 @@ getent passwd pdns >/dev/null || \ -c "PowerDNS user" pdns exit 0 +%if 0%{?rhel} >= 7 +if [ "`stat -c '%U:%G' %{_sysconfdir}/%{name}`" = "root:root" ]; then + chown -R root:pdns /etc/powerdns + # Make sure that pdns can read it; the default used to be 0600 + chmod g+r /etc/powerdns/pdns.conf +fi +chown -R pdns:pdns /var/lib/powerdns || : +%endif + %post %if 0%{?rhel} >= 7 %systemd_post pdns.service -- 2.47.2