diff options
author | Corinna Vinschen <vinschen@redhat.com> | 2019-01-26 23:42:40 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-01-28 09:57:58 +1100 |
commit | 1d05b4adcba08ab068466e5c08dee2f5417ec53a (patch) | |
tree | 76dc5f1df18a06fb2fa39280eccec8bae587dab3 /contrib | |
parent | 89843de0c4c733501f6b4f988098e6e06963df37 (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')
-rw-r--r-- | contrib/cygwin/ssh-host-config | 16 |
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 | |||
669 | fi | 669 | fi |
670 | 670 | ||
671 | # handle sshd_config | 671 | # handle sshd_config |
672 | # make sure not to change the existing file | ||
673 | mod_before="" | ||
674 | if [ -e "${SYSCONFDIR}/sshd_config" ] | ||
675 | then | ||
676 | mod_before=$(stat "${SYSCONFDIR}/sshd_config" | grep '^Modify:') | ||
677 | fi | ||
672 | csih_install_config "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt | 678 | csih_install_config "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt |
679 | mod_now=$(stat "${SYSCONFDIR}/sshd_config" | grep '^Modify:') | ||
673 | if ! /usr/bin/cmp "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults/${SYSCONFDIR}/sshd_config" >/dev/null 2>&1 | 680 | if ! /usr/bin/cmp "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults/${SYSCONFDIR}/sshd_config" >/dev/null 2>&1 |
674 | then | 681 | then |
675 | sshd_config_configured=yes | 682 | sshd_config_configured=yes |
676 | fi | 683 | fi |
677 | sshd_strictmodes || let warning_cnt+=$? | 684 | if [ "${mod_before}" != "${mod_now}" ] |
678 | sshd_privsep || let warning_cnt+=$? | 685 | then |
679 | sshd_config_tweak || let warning_cnt+=$? | 686 | sshd_strictmodes || let warning_cnt+=$? |
687 | sshd_config_tweak || let warning_cnt+=$? | ||
688 | fi | ||
689 | #sshd_privsep || let warning_cnt+=$? | ||
680 | update_services_file || let warning_cnt+=$? | 690 | update_services_file || let warning_cnt+=$? |
681 | update_inetd_conf || let warning_cnt+=$? | 691 | update_inetd_conf || let warning_cnt+=$? |
682 | install_service || let warning_cnt+=$? | 692 | install_service || let warning_cnt+=$? |