Correct existing unbound_control.key permissions

Do it only once when upgrading from the old version, which generated the
key wrong way. If the administrator wants to have control just for root
user, make it possible afterwards.

Resolves: RHEL-73862
This commit is contained in:
Petr Menšík 2025-08-29 15:10:33 +02:00
parent 68dbd9baf7
commit 8bbf515fbc

View File

@ -432,6 +432,11 @@ fi
%postun anchor
%systemd_postun_with_restart unbound-anchor.service unbound-anchor.timer
%triggerun -- unbound < 1.20.0-14
if [ "$(stat -c '%%a %%G' %{_sysconfdir}/%{name}/unbound_control.key 2>/dev/null)" = '600 unbound' ]; then
%{_bindir}/chmod g+r "%{_sysconfdir}/%{name}/unbound_control.key" || :
fi
%check
pushd %{dir_primary}
#pushd pythonmod