summaryrefslogtreecommitdiff
path: root/debian/openssh-server.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-server.preinst')
-rw-r--r--debian/openssh-server.preinst28
1 files changed, 0 insertions, 28 deletions
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst
index 83fd22e59..8bb2d6f1a 100644
--- a/debian/openssh-server.preinst
+++ b/debian/openssh-server.preinst
@@ -16,36 +16,8 @@ prepare_mv_conffile () {
16 fi 16 fi
17} 17}
18 18
19if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
20 version=1.2.27
21fi
22
23if [ "$action" = upgrade ] || [ "$action" = install ] 19if [ "$action" = upgrade ] || [ "$action" = install ]
24then 20then
25 # deal with upgrading from pre-OpenSSH versions
26 key=/etc/ssh/ssh_host_key
27 export key
28 if [ -n "$version" ] && [ -x /usr/bin/ssh-keygen ] && [ -f $key ] &&
29 dpkg --compare-versions "$version" lt 1.2.28
30 then
31 # make sure that keys get updated to get rid of IDEA
32 #
33 # N.B. this only works because we've still got the old
34 # nonfree ssh-keygen at this point
35 #
36 # First, check if we need to bother
37 printf '\0\0' | 3<&0 sh -c \
38 'dd if=$key bs=1 skip=32 count=2 2>/dev/null | cmp -s - /dev/fd/3' || {
39 # this means that bytes 32&33 of the key were not both zero, in which
40 # case the key is encrypted, which we need to fix
41 chmod 600 $key
42 ssh-keygen -u -f $key >/dev/null
43 if which restorecon >/dev/null 2>&1; then
44 restorecon "$key.pub"
45 fi
46 }
47 fi
48
49 if dpkg --compare-versions "$version" lt 1:4.7p1-4; then 21 if dpkg --compare-versions "$version" lt 1:4.7p1-4; then
50 prepare_mv_conffile /etc/pam.d/ssh 22 prepare_mv_conffile /etc/pam.d/ssh
51 fi 23 fi