summaryrefslogtreecommitdiff
path: root/contrib/cygwin/ssh-host-config
diff options
context:
space:
mode:
authorCorinna Vinschen <vinschen@redhat.com>2019-01-26 23:42:40 +0100
committerDamien Miller <djm@mindrot.org>2019-01-28 09:57:58 +1100
commit1d05b4adcba08ab068466e5c08dee2f5417ec53a (patch)
tree76dc5f1df18a06fb2fa39280eccec8bae587dab3 /contrib/cygwin/ssh-host-config
parent89843de0c4c733501f6b4f988098e6e06963df37 (diff)
Cygwin: only tweak sshd_config file if it's new, drop creating sshd user
The sshd_config tweaks were executed even if the old file was still in place. Fix that. Also disable sshd user creation. It's not used on Cygwin.
Diffstat (limited to 'contrib/cygwin/ssh-host-config')
-rw-r--r--contrib/cygwin/ssh-host-config16
1 files changed, 13 insertions, 3 deletions
diff --git a/contrib/cygwin/ssh-host-config b/contrib/cygwin/ssh-host-config
index 52916d14b..cc36ea102 100644
--- a/contrib/cygwin/ssh-host-config
+++ b/contrib/cygwin/ssh-host-config
@@ -669,14 +669,24 @@ then
669fi 669fi
670 670
671# handle sshd_config 671# handle sshd_config
672# make sure not to change the existing file
673mod_before=""
674if [ -e "${SYSCONFDIR}/sshd_config" ]
675then
676 mod_before=$(stat "${SYSCONFDIR}/sshd_config" | grep '^Modify:')
677fi
672csih_install_config "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt 678csih_install_config "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt
679mod_now=$(stat "${SYSCONFDIR}/sshd_config" | grep '^Modify:')
673if ! /usr/bin/cmp "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults/${SYSCONFDIR}/sshd_config" >/dev/null 2>&1 680if ! /usr/bin/cmp "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults/${SYSCONFDIR}/sshd_config" >/dev/null 2>&1
674then 681then
675 sshd_config_configured=yes 682 sshd_config_configured=yes
676fi 683fi
677sshd_strictmodes || let warning_cnt+=$? 684if [ "${mod_before}" != "${mod_now}" ]
678sshd_privsep || let warning_cnt+=$? 685then
679sshd_config_tweak || let warning_cnt+=$? 686 sshd_strictmodes || let warning_cnt+=$?
687 sshd_config_tweak || let warning_cnt+=$?
688fi
689#sshd_privsep || let warning_cnt+=$?
680update_services_file || let warning_cnt+=$? 690update_services_file || let warning_cnt+=$?
681update_inetd_conf || let warning_cnt+=$? 691update_inetd_conf || let warning_cnt+=$?
682install_service || let warning_cnt+=$? 692install_service || let warning_cnt+=$?