8 if [ ! -e "$CONFFILE" ]; then
9 if [ -e "$CONFFILE.dpkg-old" ]; then
10 mv -f "$CONFFILE.dpkg-old" "$CONFFILE"
11 elif [ -e "$CONFFILE.moving" ]; then
12 mv -f "$CONFFILE.moving" "$CONFFILE"
17 finish_mv_conffile () {
20 if [ -e "$CONFFILE.dpkg-old" ]; then
21 rm -f "$CONFFILE.dpkg-old"
25 abort_transfer_conffile () {
27 if [ -e "$CONFFILE.moved-by-preinst" ]; then
28 echo >&2 "Aborting ownership transfer of conffile $CONFFILE ..."
29 mv -f "$CONFFILE.moved-by-preinst" "$CONFFILE"
35 abort-install|abort-upgrade)
36 if dpkg --compare-versions "$2" lt 1:4.7p1-4; then
37 abort_mv_conffile /etc/pam.d/ssh
39 abort_transfer_conffile /etc/default/ssh
40 abort_transfer_conffile /etc/init.d/ssh
41 abort_transfer_conffile /etc/pam.d/ssh
44 # Remove all non-conffiles that ssh might create, so that we
45 # can smoothly remove /etc/ssh if and only if the user
46 # hasn't dropped some other files in there. Conffiles have
47 # already been removed at this point.
48 rm -f /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub
49 rm -f /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key.pub
50 rm -f /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub
51 rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key.pub
52 rm -f /etc/ssh/sshd_config
53 rm -f /etc/ssh/sshd_not_to_be_run
54 rmdir --ignore-fail-on-non-empty /etc/ssh
56 update-rc.d ssh remove >/dev/null
58 if which deluser >/dev/null 2>&1; then
59 deluser --quiet sshd > /dev/null || true
62 finish_mv_conffile /etc/pam.d/ssh