diff options
author | Colin Watson <cjwatson@debian.org> | 2005-07-09 23:06:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-07-09 23:06:59 +0000 |
commit | 8e5cf830fdb7e1b39c9666fd5df379c2d127669d (patch) | |
tree | ae998c779b6ccf001a34d8e0e9aea88854341af8 /debian/openssh-server.postinst | |
parent | 316983acd1f20d11c03937f17667b83f6c1bba98 (diff) |
Do the IDEA host key check on a temporary file to avoid altering
/etc/ssh/ssh_host_key itself (closes: #312312).
Diffstat (limited to 'debian/openssh-server.postinst')
-rw-r--r-- | debian/openssh-server.postinst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst index 02d01f2d8..ef1412ca7 100644 --- a/debian/openssh-server.postinst +++ b/debian/openssh-server.postinst | |||
@@ -26,11 +26,13 @@ check_idea_key() { | |||
26 | # check for old host_key files using IDEA, which openssh does not | 26 | # check for old host_key files using IDEA, which openssh does not |
27 | # support | 27 | # support |
28 | if [ -f /etc/ssh/ssh_host_key ] ; then | 28 | if [ -f /etc/ssh/ssh_host_key ] ; then |
29 | if ssh-keygen -p -N '' -f /etc/ssh/ssh_host_key 2>&1 | \ | 29 | cp -a /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.check_idea |
30 | if ssh-keygen -p -N '' -f /etc/ssh/ssh_host_key.check_idea 2>&1 | \ | ||
30 | grep -q 'unknown cipher' 2>/dev/null; then | 31 | grep -q 'unknown cipher' 2>/dev/null; then |
31 | mv /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.old | 32 | mv /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.old |
32 | mv /etc/ssh/ssh_host_key.pub /etc/ssh/ssh_host_key.pub.old | 33 | mv /etc/ssh/ssh_host_key.pub /etc/ssh/ssh_host_key.pub.old |
33 | fi | 34 | fi |
35 | rm -f /etc/ssh/ssh_host_key.check_idea | ||
34 | fi | 36 | fi |
35 | } | 37 | } |
36 | 38 | ||