From: Pieter Lexis Date: Mon, 18 Nov 2019 09:40:09 +0000 (+0100) Subject: EL pkgs: chown dirs to service user X-Git-Tag: rec-4.3.0-beta1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=593eb1e655be3a87e99a218521638bbab9cfa9fa;p=thirdparty%2Fpdns.git EL pkgs: chown dirs to service user --- 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