diff options
Diffstat (limited to 'debian/openssh-server.preinst')
-rw-r--r-- | debian/openssh-server.preinst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst index 2c2e2687c..866cf8b1a 100644 --- a/debian/openssh-server.preinst +++ b/debian/openssh-server.preinst | |||
@@ -13,10 +13,11 @@ prepare_transfer_conffile () { | |||
13 | CONFFILE="$1" | 13 | CONFFILE="$1" |
14 | TEXT="$2" | 14 | TEXT="$2" |
15 | MODE="$3" | 15 | MODE="$3" |
16 | [ "$CONFFILES" ] || return 0 | ||
16 | [ -e "$CONFFILE" ] || return 0 | 17 | [ -e "$CONFFILE" ] || return 0 |
17 | 18 | ||
18 | md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')" | 19 | md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')" |
19 | old_md5sum="$(sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $CONFFILE'{s/^ [^ ]* //;s/ .*//;p}}" /var/lib/dpkg/status)" | 20 | old_md5sum="$(echo "$CONFFILES" | awk '$1 == "'"$CONFFILE"'" { print $2 }')" |
20 | if [ "$md5sum" = "$old_md5sum" ]; then | 21 | if [ "$md5sum" = "$old_md5sum" ]; then |
21 | echo >&2 "Transferring ownership of conffile $CONFFILE ..." | 22 | echo >&2 "Transferring ownership of conffile $CONFFILE ..." |
22 | # We have to write out the desired new text of the conffile, | 23 | # We have to write out the desired new text of the conffile, |
@@ -111,6 +112,7 @@ EOF | |||
111 | fi | 112 | fi |
112 | 113 | ||
113 | if dpkg --compare-versions "$version" lt 0; then | 114 | if dpkg --compare-versions "$version" lt 0; then |
115 | CONFFILES="$(dpkg-query -W -f '${Conffiles}\n' ssh | sed 's/^ *//')" | ||
114 | prepare_transfer_conffile /etc/default/ssh "$ETC_DEFAULT_SSH" 0644 | 116 | prepare_transfer_conffile /etc/default/ssh "$ETC_DEFAULT_SSH" 0644 |
115 | prepare_transfer_conffile /etc/init.d/ssh "$ETC_INIT_D_SSH" 0755 | 117 | prepare_transfer_conffile /etc/init.d/ssh "$ETC_INIT_D_SSH" 0755 |
116 | prepare_transfer_conffile /etc/pam.d/ssh "$ETC_PAM_D_SSH" 0644 | 118 | prepare_transfer_conffile /etc/pam.d/ssh "$ETC_PAM_D_SSH" 0644 |