5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-11 13:17:36 +03:00

add postinst hook to fix /etc/aliases whitespace error

This was wrongly shipped by our ISO since quite a bit (AFAICT, at
least 4.x), so fix it up in a versioned postinst snippet.

Do so by usind sed with the following pattern:
 # sed -E -i -e 's/^www:(\w)/www: \1/' /etc/aliases
proposed by Musee Ullah[0]. It even catches a bit more than exactly
our misstep, may help if one copied this line, or added some other
addresses to this specific aliases entry.

Do this here, in pve-common, as it makes it sligthly simpler to roll
the change out to both, PVE and PMG.

[0]: https://pve.proxmox.com/pipermail/pve-user/2019-September/170998.html

Reported-by: Uwe Sauter <uwe.sauter.de@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-09-03 13:06:18 +02:00 committed by Fabian Grünbichler
parent 9e594bd42e
commit c5c5812e23

20
debian/postinst vendored Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
set -e
#DEBHELPER#
case "$1" in
configure)
if test -n "$2"; then
# TODO: remove once PVE 7.0 is released
if dpkg --compare-versions "$2" 'lt' '6.0-5'; then
sed -E -i -e 's/^www:(\w)/www: \1/' /etc/aliases
fi
fi
;;
esac
exit 0