]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Change home directory to /var/lib/pdns
authorMorten Stevens <mstevens@fedoraproject.org>
Thu, 8 Feb 2024 15:02:40 +0000 (16:02 +0100)
committerGitHub <noreply@github.com>
Thu, 8 Feb 2024 15:02:40 +0000 (16:02 +0100)
Check: https://bugzilla.redhat.com/show_bug.cgi?id=2262487

builder-support/specs/pdns.spec

index 9f265eda1d543b040e40aa13cb45315941d6dd7a..8d69fec37b7532c0d3699960868300c027a2d99b 100644 (file)
@@ -242,6 +242,8 @@ chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
 %{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns-zone2ldap
 %{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns-zone2ldap.1
 
+%{__install } -d %{buildroot}/%{_sharedstatedir}/%{name}
+
 # The EL7 and 8 systemd actually supports %t, but its version number is older than that, so we do use seperate runtime dirs, but don't rely on RUNTIME_DIRECTORY
 %if 0%{?rhel} < 9
 sed -e 's!/pdns_server!& --socket-dir=%t/pdns!' -i %{buildroot}/%{_unitdir}/pdns.service
@@ -252,12 +254,16 @@ sed -e 's!/pdns_server!& --socket-dir=%t/pdns-%i!' -e 's!RuntimeDirectory=pdns!&
 
 %check
 PDNS_TEST_NO_IPV6=1 make %{?_smp_mflags} -C pdns check || (cat pdns/test-suite.log && false)
-
+       
 %pre
 getent group pdns >/dev/null || groupadd -r pdns
 getent passwd pdns >/dev/null || \
-       useradd -r -g pdns -d / -s /sbin/nologin \
-       -c "PowerDNS user" pdns
+       useradd -r -g pdns -d /var/lib/pdns -s /sbin/nologin \
+       -c "PowerDNS Authoritative Server" pdns
+# Change home directory to /var/lib/pdns
+if [[ $(getent passwd pdns | cut -d: -f6) == "/" ]]; then
+    usermod -d /var/lib/pdns pdns
+fi
 exit 0
 
 %if 0%{?rhel} >= 7
@@ -284,6 +290,7 @@ systemctl daemon-reload ||:
 %doc pdns/bind-dnssec.4.2.0_to_4.3.0_schema.sqlite3.sql pdns/bind-dnssec.schema.sqlite3.sql
 %config(noreplace) %{_sysconfdir}/%{name}/pdns.conf
 %dir %{_libdir}/%{name}/
+%dir %attr(-,pdns,pdns) %{_sharedstatedir}/%{name}
 %{_bindir}/pdns-zone2ldap
 %{_bindir}/pdns_control
 %{_bindir}/pdnsutil