summaryrefslogtreecommitdiff
path: root/debian/ssh-krb5.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/ssh-krb5.postinst')
-rw-r--r--debian/ssh-krb5.postinst54
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/ssh-krb5.postinst b/debian/ssh-krb5.postinst
new file mode 100644
index 000000000..989a66801
--- /dev/null
+++ b/debian/ssh-krb5.postinst
@@ -0,0 +1,54 @@
1#!/bin/sh
2
3set -e
4
5action="$1"
6oldversion="$2"
7
8if [ "$action" = configure ] ; then
9 if dpkg --compare-versions "$oldversion" lt-nl 1:4.3p2-7; then
10 if [ ! -L /usr/share/doc/ssh-krb5 ]; then
11 rm -rf /usr/share/doc/ssh-krb5
12 ln -s openssh-client /usr/share/doc/ssh-krb5
13 fi
14
15 # Replaced by /etc/init.d/ssh.
16 if [ -f /etc/init.d/ssh-krb5 ]; then
17 mv /etc/init.d/ssh-krb5 /etc/init.d/ssh-krb5.dpkg-old
18 update-rc.d ssh-krb5 remove || true
19 fi
20 fi
21
22 if dpkg --compare-versions "$oldversion" ge 1:4.3p2-7 || \
23 grep -qi '^[ ]*GSSAPI' /etc/ssh/sshd_config ; then
24 :
25 else
26 if grep -qi '^#GSSAPI' /etc/ssh/sshd_config ; then
27 perl -pe 's/^\#(GSSAPI(Authentication|KeyExchange))\b/$1/i' \
28 < /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new
29 chown --reference /etc/ssh/sshd_config \
30 /etc/ssh/sshd_config.dpkg-new
31 chmod --reference /etc/ssh/sshd_config \
32 /etc/ssh/sshd_config.dpkg-new
33 mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config
34 else
35 cat >> /etc/ssh/sshd_config <<EOF
36
37# GSSAPI authentication
38GSSAPIAuthentication yes
39GSSAPIKeyExchange yes
40EOF
41 fi
42 if [ -x /etc/init.d/ssh ] ; then
43 if [ -x /usr/sbin/invoke-rc.d ] ; then
44 invoke-rc.d ssh restart
45 else
46 /etc/init.d/ssh restart
47 fi
48 fi
49 fi
50fi
51
52#DEBHELPER#
53
54exit 0