From 6e950945da7a2acbb48fa4138208018f09d66991 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 22 May 2013 01:45:40 +0100 Subject: Switch to new unified layout for Upstart jobs as documented in https://wiki.ubuntu.com/UpstartCompatibleInitScripts: the init script checks for a running Upstart, and we now let dh_installinit handle most of the heavy lifting in maintainer scripts. Ubuntu users should be essentially unaffected except that sshd may no longer start automatically in chroots if the running Upstart predates 0.9.0; but the main goal is simply not to break when openssh-server is installed in a chroot. --- debian/ssh-krb5.postinst | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 debian/ssh-krb5.postinst (limited to 'debian/ssh-krb5.postinst') diff --git a/debian/ssh-krb5.postinst b/debian/ssh-krb5.postinst new file mode 100644 index 000000000..f799accfe --- /dev/null +++ b/debian/ssh-krb5.postinst @@ -0,0 +1,61 @@ +#!/bin/sh + +set -e + +action="$1" +oldversion="$2" + +if [ "$action" = configure ] ; then + # Make sure that GSSAPI is enabled. If there is no uncommented GSSAPI + # configuration, uncomment any commented-out configuration if present + # (this will catch the case of a fresh install of openssh-server). + # Otherwise, add configuration turning on GSSAPIAuthentication and + # GSSAPIKeyExchange. + # + # If there is some configuration, we may be upgrading from ssh-krb5. It + # enabled GSSAPIKeyExchange without any configuration option. Therefore, + # if it isn't explicitly set, always enable it for compatible behavior + # with ssh-krb5. + if dpkg --compare-versions "$oldversion" ge 1:4.3p2-9; then + : + else + changed= + if grep -qi '^[ ]*GSSAPI' /etc/ssh/sshd_config ; then + if grep -qi '^[ ]*GSSAPIKeyExchange' /etc/ssh/sshd_config ; then + : + else + changed=true + cat >> /etc/ssh/sshd_config < /etc/ssh/sshd_config.dpkg-new + chown --reference /etc/ssh/sshd_config \ + /etc/ssh/sshd_config.dpkg-new + chmod --reference /etc/ssh/sshd_config \ + /etc/ssh/sshd_config.dpkg-new + mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config + else + cat >> /etc/ssh/sshd_config <