[PVE-User] Bug report: Syntax error in /etc/aliases

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Sep 3 12:48:43 CEST 2019


On 03.09.19 12:39, Musee Ullah via pve-user wrote:
> On 2019/09/03 3:14, Uwe Sauter wrote:
>> I'd suggest to do:
>> sed -i -e 's/^www:/www: /' /etc/aliases
>>
>> so that lines that were changed by a user are also caught.
> 
> just pointing out that consecutive package updates'll continuously add
> more spaces with the above since it doesn't check if there's already a
> space.
> 
> sed -E -i -e 's/^www:(\w)/www: \1/' /etc/aliases
> 
> 

That's why I said "at one single package version transition", independent
of what exactly we finally do, I'd always guarded it with a version check
inside a postinst debhelper script, e.g., like:


if dpkg --compare-versions "$2" 'lt' '6.0-X'; then
    sed ...
fi

thus it happens only if an upgrade transitions from a version pre "6.0-x"
(independent how old) to a version equal or newer than "6.0-x".
No point in checking everytime, if a admin changed it back to something
"bad" then it was probably wanted, or at least not our fault like it is
here. :) 

But you suggestion itself would work fine, in general.

cheers,
Thomas




More information about the pve-user mailing list