Code review comment for lp:~neil-aldur/ubuntu/precise/iptables-persistent/fix-for-967018-905517

Revision history for this message
Chow Loong Jin (hyperair) wrote :

Okay, I've just built and tested upgrading from 0.0.20101230 (the natty package). I noticed that if both /etc/iptables/rules and /etc/iptables/rules.v4 were present, rules.v4 would be clobbered by rules. A backup would be made in rules.v4.dpkg-new, of course, but I'm not sure that's a good thing.

How about the following?

if [ -e /etc/iptables/rules -a ! -e /etc/iptables/rules.v4 ]; then
    touch /etc/iptables/rules.v4
    dpkg-maintscript-helper mv_conffile \
        /etc/iptables/rules /etc/iptables/rules.v4 0.0.20101230 -- "$@"
fi

This should prevent rules.v4 from getting clobbered if the user had, by some freak accident (perhaps an upgrade and a downgrade, and an upgrade again) both rules and rules.v4 where rules.v4 was the relevant file.

« Back to merge proposal