summaryrefslogtreecommitdiff
path: root/debian/preinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2004-07-31 03:22:20 +0000
committerColin Watson <cjwatson@debian.org>2004-07-31 03:22:20 +0000
commit9749ef7f9b382d743b186bf06c7c2aeb0b9bebee (patch)
treeaadbcc936c4e05d344f3ae856925b62bafc8debb /debian/preinst
parentc57fe5be57af965042484e8669767f95e558b0ef (diff)
* Split the ssh binary package into openssh-client and openssh-server
(closes: #39741). openssh-server depends on openssh-client for some common functionality; it didn't seem worth creating yet another package for this. * New transitional ssh package, depending on openssh-client and openssh-server. May be removed once nothing depends on it. * When upgrading from ssh to openssh-{client,server}, it's very difficult for the maintainer scripts to find out what version we're upgrading from without dodgy dpkg hackery. I've therefore taken the opportunity to move a couple of debconf notes into NEWS files, namely ssh/ssh2_keys_merged and ssh/user_environment_tell. * In general, upgrading to this version directly from woody without first upgrading to the version in sarge is not currently guaranteed to work very smoothly due to the aforementioned version discovery problems.
Diffstat (limited to 'debian/preinst')
-rw-r--r--debian/preinst79
1 files changed, 0 insertions, 79 deletions
diff --git a/debian/preinst b/debian/preinst
deleted file mode 100644
index e22d0aa5d..000000000
--- a/debian/preinst
+++ /dev/null
@@ -1,79 +0,0 @@
1#!/bin/sh -e
2
3action=$1
4version=$2
5
6if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
7 version=1.2.27
8fi
9
10if [ "$action" = upgrade ] || [ "$action" = install ]
11then
12 # check if debconf is missing
13 if ! test -f /usr/share/debconf/confmodule
14 then
15 cat <<EOF
16
17WARNING: ssh's pre-configuration script relies on debconf to tell you
18about some problems that might prevent you from logging in if you are
19upgrading from the old, Non-free version of ssh.
20
21If this is a new installation, you don't need to worry about this.
22Just go ahead and install ssh (make sure to read .../ssh/README.Debian).
23
24If you are upgrading, but you have alternative ways of logging into
25the machine (i.e. you're sitting in front of it, or you have telnetd
26running), then you also don't need to worry too much, because you can
27fix it up afterwards if there's a problem.
28
29If you're upgrading from an older (non-free) version of ssh, and ssh
30is the only way you have to access this machine, then you should
31probably abort the installation of ssh, install debconf, and then
32retry the installation of ssh.
33
34EOF
35 echo -n "Do you want to install SSH anyway [yN]: "
36 read input
37 expr "$input" : '[Yy]' >/dev/null || exit 1
38
39 # work around for missing debconf
40 db_get() { : ; }
41 RET=true
42 if [ -d /etc/ssh-nonfree ] && [ ! -d /etc/ssh ]; then
43 cp -a /etc/ssh-nonfree /etc/ssh
44 fi
45 else
46 # Source debconf library.
47 . /usr/share/debconf/confmodule
48 db_version 2.0
49 fi
50
51 db_get ssh/use_old_init_script
52 if [ "$RET" = "false" ]; then
53 echo "ssh config: Aborting because ssh/use_old_init_script = false" >&2
54 exit 1
55 fi
56
57 # deal with upgrading from pre-OpenSSH versions
58 key=/etc/ssh/ssh_host_key
59 export key
60 if [ -n "$version" ] && [ -x /usr/bin/ssh-keygen ] && [ -f $key ] &&
61 dpkg --compare-versions "$version" lt 1.2.28
62 then
63 # make sure that keys get updated to get rid of IDEA
64 #
65 # N.B. this only works because we've still got the old
66 # nonfree ssh-keygen at this point
67 #
68 # First, check if we need to bother
69 echo -en '\0\0' | 3<&0 sh -c \
70 'dd if=$key bs=1 skip=32 count=2 2>/dev/null | cmp -s - /dev/fd/3' || {
71 # this means that bytes 32&33 of the key were not both zero, in which
72 # case the key is encrypted, which we need to fix
73 chmod 600 $key
74 ssh-keygen -u -f $key >/dev/null
75 }
76 fi
77fi
78
79#DEBHELPER#