diff --git a/freeipa.spec b/freeipa.spec index 8e14a7b..08c93f4 100644 --- a/freeipa.spec +++ b/freeipa.spec @@ -161,7 +161,7 @@ Name: %{package_name} Version: %{IPA_VERSION} -Release: 5%{?dist} +Release: 6%{?dist} Summary: The Identity, Policy and Audit system License: GPLv3+ @@ -1159,6 +1159,18 @@ if [ -f '/etc/ssh/sshd_config' -a $restore -ge 2 ]; then /bin/systemctl condrestart sshd.service 2>&1 || : fi + # If the snippet has been created, ensure that it is included + # either by /etc/ssh/sshd_config.d/*.conf or directly + if [ -f '/etc/ssh/sshd_config.d/04-ipa.conf' ]; then + if ! grep -E -q '^\s*Include\s*/etc/ssh/sshd_config.d/\*\.conf' /etc/ssh/sshd_config 2> /dev/null ; then + if ! grep -E -q '^\s*Include\s*/etc/ssh/sshd_config.d/04-ipa\.conf' /etc/ssh/sshd_config 2> /dev/null ; then + # Include the snippet + echo "Include /etc/ssh/sshd_config.d/04-ipa.conf" > /etc/ssh/sshd_config.ipanew + cat /etc/ssh/sshd_config >> /etc/ssh/sshd_config.ipanew + mv -fZ --backup=existing --suffix .ipaold /etc/ssh/sshd_config.ipanew /etc/ssh/sshd_config + fi + fi + fi fi @@ -1530,6 +1542,10 @@ fi %endif %changelog +* Tue Oct 13 2020 Alexander Bokovoy - 4.8.10-6 +- Handle sshd_config upgrade properly + Fixes: rhbz#1887928 + * Tue Sep 29 2020 Alexander Bokovoy - 4.8.10-5 - Properly handle upgrade case when systemd-resolved is enabled