summaryrefslogtreecommitdiff
path: root/debian/config
diff options
context:
space:
mode:
Diffstat (limited to 'debian/config')
-rw-r--r--debian/config100
1 files changed, 100 insertions, 0 deletions
diff --git a/debian/config b/debian/config
new file mode 100644
index 000000000..c25f2ae3f
--- /dev/null
+++ b/debian/config
@@ -0,0 +1,100 @@
1#!/bin/sh
2
3action=$1
4version=$2
5
6if [ -d /etc/ssh-nonfree -a ! -d /etc/ssh ]; then
7 version=1.2.27
8 cp -a /etc/ssh-nonfree /etc/ssh
9fi
10
11# Source debconf library.
12. /usr/share/debconf/confmodule
13db_version 2.0
14
15if [ -n "$version" ] && dpkg --compare-versions "$version" lt 1:3.0p1-1
16then
17 db_input medium ssh/ssh2_keys_merged
18fi
19
20if [ -e /etc/init.d/ssh ] && ! grep -q pidfile /etc/init.d/ssh
21then
22 db_fset ssh/use_old_init_script seen false
23 db_input medium ssh/use_old_init_script || true
24 db_go
25
26 db_get ssh/use_old_init_script
27 [ "$RET" = "false" ] && exit 0
28else
29 db_set ssh/use_old_init_script true
30 db_fset ssh/use_old_init_script seen true
31fi
32
33if [ -z "$version" -a ! -e /etc/ssh/sshd_config ]
34then
35 db_input medium ssh/protocol2_only || true
36fi
37
38if [ -e /etc/ssh/sshd_config ]
39then
40 if dpkg --compare-versions "$version" lt-nl 1:1.3 ;
41 then db_input medium ssh/new_config || true
42 db_go
43 db_get ssh/new_config
44 if [ "$RET" = "true" ];
45 then db_input medium ssh/protocol2_only ||true
46 db_input high ssh/privsep_ask ||true
47 else db_input high ssh/privsep_tell ||true
48 fi
49 else db_input high ssh/privsep_tell ||true
50 fi
51else db_input high ssh/privsep_tell ||true
52fi
53
54db_input medium ssh/SUID_client || true
55
56# To be correct during initial installation, this relies on the desired
57# default for run_sshd being "true".
58if [ -e /etc/ssh/sshd_not_to_be_run ]
59then
60 db_set ssh/run_sshd false
61else
62 db_set ssh/run_sshd true
63fi
64db_input medium ssh/run_sshd || true
65
66if [ -x /usr/sbin/in.telnetd ] && grep -q "^telnet\b" /etc/inetd.conf
67then
68 if ! /usr/sbin/in.telnetd -? 2>&1 | grep -q ssl 2>/dev/null
69 then
70 db_input low ssh/insecure_telnetd || true
71 fi
72fi
73
74key=/etc/ssh/ssh_host_key
75export key
76if [ -n "$version" ] && [ -f $key ] && [ ! -x /usr/bin/ssh-keygen ] &&
77 dpkg --compare-versions "$version" lt 1.2.28
78then
79 # make sure that keys get updated to get rid of IDEA; preinst
80 # actually does the work, but if the old ssh-keygen is not found,
81 # it can't do that -- thus, we tell the user that he must create
82 # a new host key.
83 echo -en '\0\0' | 3<&0 sh -c \
84 'dd if=$key bs=1 skip=32 count=2 2>/dev/null | cmp -s - /dev/fd/3' || {
85 # this means that bytes 32&33 of the key were not both zero, in which
86 # case the key is encrypted, which we need to fix
87 db_input high ssh/encrypted_host_key_but_no_keygen || true
88 }
89fi
90
91
92db_input low ssh/forward_warning || true
93
94if dpkg --compare-versions "$version" lt-nl 1:3.5p1-3; then
95 db_input high ssh/user_environment_tell || true
96fi
97
98db_go
99
100exit 0