diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/openssh-client.postinst | 9 | ||||
-rw-r--r-- | debian/openssh-client.postrm | 13 | ||||
-rw-r--r-- | debian/openssh-client.preinst | 49 | ||||
-rw-r--r-- | debian/openssh-server.postinst.in | 10 | ||||
-rw-r--r-- | debian/openssh-server.postrm | 12 | ||||
-rw-r--r-- | debian/openssh-server.preinst | 40 | ||||
-rwxr-xr-x | debian/rules | 11 | ||||
-rw-r--r-- | debian/substitute-conffile.pl | 26 |
9 files changed, 5 insertions, 170 deletions
diff --git a/debian/changelog b/debian/changelog index 07aeeb4d1..c1ada9437 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -6,6 +6,11 @@ openssh (1:6.2p2-2) UNRELEASED; urgency=low | |||
6 | is not really necessary since one of static-network-up and failsafe-boot | 6 | is not really necessary since one of static-network-up and failsafe-boot |
7 | is guaranteed to happen and will trigger entry to the default runlevel, | 7 | is guaranteed to happen and will trigger entry to the default runlevel, |
8 | and we don't care about ssh starting before the network (LP: #1098299). | 8 | and we don't care about ssh starting before the network (LP: #1098299). |
9 | * Drop conffile handling for upgrades from pre-split ssh package; this was | ||
10 | originally added in 1:4.3p2-7 / 1:4.3p2-8, and contained a truly ghastly | ||
11 | hack around a misbehaviour in sarge's dpkg. Since this is now four | ||
12 | Debian releases ago, we can afford to drop this and simplify the | ||
13 | packaging. | ||
9 | 14 | ||
10 | -- Colin Watson <cjwatson@debian.org> Tue, 21 May 2013 17:49:35 +0100 | 15 | -- Colin Watson <cjwatson@debian.org> Tue, 21 May 2013 17:49:35 +0100 |
11 | 16 | ||
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst index cff282d70..2f884b7b7 100644 --- a/debian/openssh-client.postinst +++ b/debian/openssh-client.postinst | |||
@@ -94,13 +94,6 @@ set_ssh_agent_permissions() { | |||
94 | fi | 94 | fi |
95 | } | 95 | } |
96 | 96 | ||
97 | commit_transfer_conffile () { | ||
98 | CONFFILE="$1" | ||
99 | if [ -e "$CONFFILE.moved-by-preinst" ]; then | ||
100 | rm -f "$CONFFILE.moved-by-preinst" | ||
101 | fi | ||
102 | } | ||
103 | |||
104 | 97 | ||
105 | fix_rsh_diversion | 98 | fix_rsh_diversion |
106 | create_alternatives | 99 | create_alternatives |
@@ -109,7 +102,5 @@ if [ "$2" = "1:3.5p1-1" ]; then | |||
109 | fix_ssh_group | 102 | fix_ssh_group |
110 | fi | 103 | fi |
111 | set_ssh_agent_permissions | 104 | set_ssh_agent_permissions |
112 | commit_transfer_conffile /etc/ssh/moduli | ||
113 | commit_transfer_conffile /etc/ssh/ssh_config | ||
114 | 105 | ||
115 | exit 0 | 106 | exit 0 |
diff --git a/debian/openssh-client.postrm b/debian/openssh-client.postrm index eb6fde06b..2b29a098b 100644 --- a/debian/openssh-client.postrm +++ b/debian/openssh-client.postrm | |||
@@ -2,20 +2,7 @@ | |||
2 | 2 | ||
3 | #DEBHELPER# | 3 | #DEBHELPER# |
4 | 4 | ||
5 | abort_transfer_conffile () { | ||
6 | CONFFILE="$1" | ||
7 | if [ -e "$CONFFILE.moved-by-preinst" ]; then | ||
8 | echo >&2 "Aborting ownership transfer of conffile $CONFFILE ..." | ||
9 | mv -f "$CONFFILE.moved-by-preinst" "$CONFFILE" | ||
10 | return 0 | ||
11 | fi | ||
12 | } | ||
13 | |||
14 | case $1 in | 5 | case $1 in |
15 | abort-install|abort-upgrade) | ||
16 | abort_transfer_conffile /etc/ssh/moduli | ||
17 | abort_transfer_conffile /etc/ssh/ssh_config | ||
18 | ;; | ||
19 | purge) | 6 | purge) |
20 | # Remove all non-conffiles that ssh might create, so that we | 7 | # Remove all non-conffiles that ssh might create, so that we |
21 | # can smoothly remove /etc/ssh if and only if the user | 8 | # can smoothly remove /etc/ssh if and only if the user |
diff --git a/debian/openssh-client.preinst b/debian/openssh-client.preinst deleted file mode 100644 index 0b29c051d..000000000 --- a/debian/openssh-client.preinst +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | ETC_SSH_MODULI=@ETC_SSH_MODULI@ | ||
4 | |||
5 | ETC_SSH_SSH_CONFIG=@ETC_SSH_SSH_CONFIG@ | ||
6 | |||
7 | action="$1" | ||
8 | version="$2" | ||
9 | |||
10 | prepare_transfer_conffile () { | ||
11 | CONFFILE="$1" | ||
12 | TEXT="$2" | ||
13 | MODE="$3" | ||
14 | [ "$CONFFILES" ] || return 0 | ||
15 | [ -e "$CONFFILE" ] || return 0 | ||
16 | |||
17 | md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')" | ||
18 | old_md5sum="$(echo "$CONFFILES" | awk '$1 == "'"$CONFFILE"'" { print $2 }')" | ||
19 | if [ "$md5sum" = "$old_md5sum" ]; then | ||
20 | echo >&2 "Transferring ownership of conffile $CONFFILE ..." | ||
21 | # We have to write out the desired new text of the conffile, | ||
22 | # which is tricky in the preinst, hence the nasty way we | ||
23 | # have to hardcode the text here. Fortunately, this is only | ||
24 | # necessary with sarge's dpkg and older. | ||
25 | if echo "$TEXT" | head -n1 | grep -q '^@.*@$'; then | ||
26 | echo >&2 'Unsubstituted conffile text! Please report this bug.' | ||
27 | exit 1 | ||
28 | fi | ||
29 | printf '%s' "$TEXT" >"$CONFFILE.dpkg-new" | ||
30 | chmod "$MODE" "$CONFFILE.dpkg-new" | ||
31 | mv -f "$CONFFILE" "$CONFFILE.moved-by-preinst" | ||
32 | mv -f "$CONFFILE.dpkg-new" "$CONFFILE" | ||
33 | return 0 | ||
34 | fi | ||
35 | } | ||
36 | |||
37 | case $action in | ||
38 | install|upgrade) | ||
39 | if dpkg --compare-versions "$version" lt 0; then | ||
40 | CONFFILES="$(dpkg-query -W -f '${Conffiles}\n' ssh 2>/dev/null | sed 's/^ *//')" | ||
41 | prepare_transfer_conffile /etc/ssh/moduli "$ETC_SSH_MODULI" 0644 | ||
42 | prepare_transfer_conffile /etc/ssh/ssh_config "$ETC_SSH_SSH_CONFIG" 0644 | ||
43 | fi | ||
44 | ;; | ||
45 | esac | ||
46 | |||
47 | #DEBHELPER# | ||
48 | |||
49 | exit 0 | ||
diff --git a/debian/openssh-server.postinst.in b/debian/openssh-server.postinst.in index 9aa568292..9869c9b48 100644 --- a/debian/openssh-server.postinst.in +++ b/debian/openssh-server.postinst.in | |||
@@ -440,13 +440,6 @@ setup_init() { | |||
440 | esac | 440 | esac |
441 | } | 441 | } |
442 | 442 | ||
443 | commit_transfer_conffile () { | ||
444 | CONFFILE="$1" | ||
445 | if [ -e "$CONFFILE.moved-by-preinst" ]; then | ||
446 | rm -f "$CONFFILE.moved-by-preinst" | ||
447 | fi | ||
448 | } | ||
449 | |||
450 | commit_mv_conffile () { | 443 | commit_mv_conffile () { |
451 | OLDCONFFILE="$1" | 444 | OLDCONFFILE="$1" |
452 | NEWCONFFILE="$2" | 445 | NEWCONFFILE="$2" |
@@ -477,9 +470,6 @@ if dpkg --compare-versions "$2" lt 1:5.2p1-1; then | |||
477 | remove_old_init_links | 470 | remove_old_init_links |
478 | fi | 471 | fi |
479 | setup_init | 472 | setup_init |
480 | commit_transfer_conffile /etc/default/ssh | ||
481 | commit_transfer_conffile /etc/init.d/ssh | ||
482 | commit_transfer_conffile /etc/pam.d/ssh | ||
483 | commit_mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd | 473 | commit_mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd |
484 | # Renamed to /etc/ssh/moduli in 2.9.9 (!) | 474 | # Renamed to /etc/ssh/moduli in 2.9.9 (!) |
485 | if dpkg --compare-versions "$2" lt 1:4.7p1-1; then | 475 | if dpkg --compare-versions "$2" lt 1:4.7p1-1; then |
diff --git a/debian/openssh-server.postrm b/debian/openssh-server.postrm index 655c1ae17..bc55df118 100644 --- a/debian/openssh-server.postrm +++ b/debian/openssh-server.postrm | |||
@@ -22,23 +22,11 @@ finish_mv_conffile () { | |||
22 | fi | 22 | fi |
23 | } | 23 | } |
24 | 24 | ||
25 | abort_transfer_conffile () { | ||
26 | CONFFILE="$1" | ||
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" | ||
30 | return 0 | ||
31 | fi | ||
32 | } | ||
33 | |||
34 | case $1 in | 25 | case $1 in |
35 | abort-install|abort-upgrade) | 26 | abort-install|abort-upgrade) |
36 | if dpkg --compare-versions "$2" lt 1:4.7p1-4; then | 27 | if dpkg --compare-versions "$2" lt 1:4.7p1-4; then |
37 | abort_mv_conffile /etc/pam.d/ssh | 28 | abort_mv_conffile /etc/pam.d/ssh |
38 | fi | 29 | fi |
39 | abort_transfer_conffile /etc/default/ssh | ||
40 | abort_transfer_conffile /etc/init.d/ssh | ||
41 | abort_transfer_conffile /etc/pam.d/ssh | ||
42 | ;; | 30 | ;; |
43 | purge) | 31 | purge) |
44 | # Remove all non-conffiles that ssh might create, so that we | 32 | # Remove all non-conffiles that ssh might create, so that we |
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst index 510070645..9f3fa05ed 100644 --- a/debian/openssh-server.preinst +++ b/debian/openssh-server.preinst | |||
@@ -1,41 +1,8 @@ | |||
1 | #!/bin/sh -e | 1 | #!/bin/sh -e |
2 | 2 | ||
3 | ETC_DEFAULT_SSH=@ETC_DEFAULT_SSH@ | ||
4 | |||
5 | ETC_INIT_D_SSH=@ETC_INIT_D_SSH@ | ||
6 | |||
7 | ETC_PAM_D_SSH=@ETC_PAM_D_SSH@ | ||
8 | |||
9 | action=$1 | 3 | action=$1 |
10 | version=$2 | 4 | version=$2 |
11 | 5 | ||
12 | prepare_transfer_conffile () { | ||
13 | CONFFILE="$1" | ||
14 | TEXT="$2" | ||
15 | MODE="$3" | ||
16 | [ "$CONFFILES" ] || return 0 | ||
17 | [ -e "$CONFFILE" ] || return 0 | ||
18 | |||
19 | md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')" | ||
20 | old_md5sum="$(echo "$CONFFILES" | awk '$1 == "'"$CONFFILE"'" { print $2 }')" | ||
21 | if [ "$md5sum" = "$old_md5sum" ]; then | ||
22 | echo >&2 "Transferring ownership of conffile $CONFFILE ..." | ||
23 | # We have to write out the desired new text of the conffile, | ||
24 | # which is tricky in the preinst, hence the nasty way we | ||
25 | # have to hardcode the text here. Fortunately, this is only | ||
26 | # necessary with sarge's dpkg and older. | ||
27 | if echo "$TEXT" | head -n1 | grep -q '^@.*@$'; then | ||
28 | echo >&2 'Unsubstituted conffile text! Please report this bug.' | ||
29 | exit 1 | ||
30 | fi | ||
31 | printf '%s' "$TEXT" >"$CONFFILE.dpkg-new" | ||
32 | chmod "$MODE" "$CONFFILE.dpkg-new" | ||
33 | mv -f "$CONFFILE" "$CONFFILE.moved-by-preinst" | ||
34 | mv -f "$CONFFILE.dpkg-new" "$CONFFILE" | ||
35 | return 0 | ||
36 | fi | ||
37 | } | ||
38 | |||
39 | prepare_mv_conffile () { | 6 | prepare_mv_conffile () { |
40 | CONFFILE="$1" | 7 | CONFFILE="$1" |
41 | [ -e "$CONFFILE" ] || return 0 | 8 | [ -e "$CONFFILE" ] || return 0 |
@@ -124,13 +91,6 @@ EOF | |||
124 | } | 91 | } |
125 | fi | 92 | fi |
126 | 93 | ||
127 | if dpkg --compare-versions "$version" lt 0; then | ||
128 | CONFFILES="$(dpkg-query -W -f '${Conffiles}\n' ssh 2>/dev/null | sed 's/^ *//')" | ||
129 | prepare_transfer_conffile /etc/default/ssh "$ETC_DEFAULT_SSH" 0644 | ||
130 | prepare_transfer_conffile /etc/init.d/ssh "$ETC_INIT_D_SSH" 0755 | ||
131 | prepare_transfer_conffile /etc/pam.d/ssh "$ETC_PAM_D_SSH" 0644 | ||
132 | fi | ||
133 | |||
134 | if dpkg --compare-versions "$version" lt 1:4.7p1-4; then | 94 | if dpkg --compare-versions "$version" lt 1:4.7p1-4; then |
135 | prepare_mv_conffile /etc/pam.d/ssh | 95 | prepare_mv_conffile /etc/pam.d/ssh |
136 | fi | 96 | fi |
diff --git a/debian/rules b/debian/rules index db7f81f49..c78653be0 100755 --- a/debian/rules +++ b/debian/rules | |||
@@ -219,17 +219,6 @@ override_dh_shlibdeps: | |||
219 | 219 | ||
220 | override_dh_installdeb: $(DISTRIBUTOR_REPLACE) | 220 | override_dh_installdeb: $(DISTRIBUTOR_REPLACE) |
221 | dh_installdeb | 221 | dh_installdeb |
222 | perl -i debian/substitute-conffile.pl \ | ||
223 | ETC_SSH_MODULI debian/openssh-client/etc/ssh/moduli \ | ||
224 | ETC_SSH_SSH_CONFIG debian/openssh-client/etc/ssh/ssh_config \ | ||
225 | debian/openssh-client/DEBIAN/preinst | ||
226 | # Yes, ETC_PAM_D_SSH is meant to be spelled that way, to match the | ||
227 | # old configuration file name we need to transfer. | ||
228 | perl -i debian/substitute-conffile.pl \ | ||
229 | ETC_DEFAULT_SSH debian/openssh-server/etc/default/ssh \ | ||
230 | ETC_INIT_D_SSH debian/openssh-server/etc/init.d/ssh \ | ||
231 | ETC_PAM_D_SSH debian/openssh-server/etc/pam.d/sshd \ | ||
232 | debian/openssh-server/DEBIAN/preinst | ||
233 | 222 | ||
234 | override_dh_gencontrol: | 223 | override_dh_gencontrol: |
235 | dh_gencontrol -- -V'openssh-server:Recommends=$(server_recommends)' | 224 | dh_gencontrol -- -V'openssh-server:Recommends=$(server_recommends)' |
diff --git a/debian/substitute-conffile.pl b/debian/substitute-conffile.pl deleted file mode 100644 index 7dd23363e..000000000 --- a/debian/substitute-conffile.pl +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #! /usr/bin/perl -p | ||
2 | |||
3 | # This is needed for a nasty preinst hack to work around a bug in sarge's | ||
4 | # version of dpkg. It substitutes the literal text of conffiles into preinst | ||
5 | # scripts so that they can be used when moving conffiles between packages. | ||
6 | |||
7 | BEGIN { | ||
8 | %texts = (); | ||
9 | while (@ARGV > 1) { | ||
10 | my $name = $ARGV[0]; | ||
11 | shift; | ||
12 | local *FILE; | ||
13 | open FILE, '<', $ARGV[0]; | ||
14 | local $/ = undef; | ||
15 | my $text = <FILE>; | ||
16 | close FILE; | ||
17 | # Quote for the shell. | ||
18 | $text =~ s/'/'\\''/g; | ||
19 | shift; | ||
20 | $texts{$name} = $text; | ||
21 | } | ||
22 | } | ||
23 | |||
24 | for my $name (keys %texts) { | ||
25 | s/\@$name\@/'$texts{$name}'/g; | ||
26 | } | ||