summaryrefslogtreecommitdiff
path: root/debian/openssh-server.postinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2004-08-02 17:29:06 +0000
committerColin Watson <cjwatson@debian.org>2004-08-02 17:29:06 +0000
commit4e43fff8597edbb2e708ac4df413795f5ca805cb (patch)
tree409d281439c493595b3b11e58550a49a97298d41 /debian/openssh-server.postinst
parent0d718f4a4cf76da2c4de58475a4affba01a7e823 (diff)
Add a heuristic to try to make sure the sshd_config upgrade to >= 3.7
happens even though we don't know what version we're upgrading from.
Diffstat (limited to 'debian/openssh-server.postinst')
-rw-r--r--debian/openssh-server.postinst10
1 files changed, 8 insertions, 2 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index 64f9985a8..28af3f490 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -90,10 +90,16 @@ create_sshdconfig() {
90 if dpkg --compare-versions "$oldversion" lt-nl 1:1.3 ; then 90 if dpkg --compare-versions "$oldversion" lt-nl 1:1.3 ; then
91 db_get ssh/new_config 91 db_get ssh/new_config
92 if [ "$RET" = "false" ] ; then return 0; fi 92 if [ "$RET" = "false" ] ; then return 0; fi
93 elif dpkg --compare-versions "$oldversion" lt-nl 1:3.8p1-1 && \ 93 elif (dpkg --compare-versions "$oldversion" lt-nl 1:3.8p1-1 && \
94 ! grep -iq ^UsePAM /etc/ssh/sshd_config ; then 94 ! grep -iq ^UsePAM /etc/ssh/sshd_config) || \
95 grep -Eiq '^(PAMAuthenticationViaKbdInt|RhostsAuthentication)' \
96 /etc/ssh/sshd_config ; then
95 # Upgrade from pre-3.7: UsePAM needed to maintain standard 97 # Upgrade from pre-3.7: UsePAM needed to maintain standard
96 # Debian configuration. 98 # Debian configuration.
99 # Note that --compare-versions is sadly not reliable enough
100 # here due to the package split of ssh into openssh-client
101 # and openssh-server. The extra grep for some deprecated
102 # options should with any luck be a good enough heuristic.
97 echo -n 'Upgrading sshd_config (old version in .dpkg-old) ...' 103 echo -n 'Upgrading sshd_config (old version in .dpkg-old) ...'
98 cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-old 104 cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-old
99 perl -pe 's/^(PAMAuthenticationViaKbdInt|RhostsAuthentication)\b/#$1/i' \ 105 perl -pe 's/^(PAMAuthenticationViaKbdInt|RhostsAuthentication)\b/#$1/i' \