firewall: Allow configuration upgrade to version 1.0.x

Closes: #2133.

There are two new defaults which need not be altered in FreedomBox:

CleanupModulesOnExit=no
(removed) AllowZoneDrifting=no

Tests:

- Without the patch, on a testing system with firewalld 0.9.x installed, run apt
update. FreedomBox considers firewalld for force upgrade and then ignores it as
shown in the logs.

- With the patch, firewalld is upgraded to 1.0.x version by FreedomBox using
force upgrade as shown in logs. After upgrade, the default zone is external and
backend is nftables.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2021-11-28 12:24:42 -08:00 committed by James Valleroy
parent 9133711baf
commit 18ed1c9267
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -107,9 +107,9 @@ def force_upgrade(helper, packages):
if 'firewalld' not in packages:
return False
# firewalld 0.6.x -> 0.7.x, 0.6.x -> 0.8.x, 0.7.x -> 0.8.x
# firewalld 0.6.x -> 0.7.x, 0.6.x -> 0.8.x, 0.7.x -> 0.8.x, 0.9.x -> 1.0.x
package = packages['firewalld']
if Version(package['current_version']) >= Version('0.9') or \
if Version(package['current_version']) >= Version('1.0') or \
Version(package['new_version']) < Version('0.7'):
return False