From: Adolf Belka Date: Mon, 26 Feb 2024 15:05:01 +0000 (+0100) Subject: backup.pl: Fixes bug#13404 - Clear out OpenVPN certs before doing restore X-Git-Tag: v2.29-core185~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c790899f7383dae7f734a44c1570da1c9246b778;p=ipfire-2.x.git backup.pl: Fixes bug#13404 - Clear out OpenVPN certs before doing restore - Existing situation is if four new client connections are created and then it is decided to restore to an earlier stage the new certficates will be in the certs directory but not usable from the WUI page as they are no longer shown in the client connection table as that now shows the ones from the restored backup. - This patch clears the /var/ipfire/ovpn/certs/ directory before restoring the contents of the backup so that the certs directory only holds what was in the backup. Fixes: Bug#13404 Tested-by: Adolf Belka Signed-off-by: Adolf Belka Signed-off-by: Michael Tremer --- diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 7992f21c58..b434207400 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -75,6 +75,10 @@ make_backup() { restore_backup() { local filename="${1}" + # remove all openvpn certs to prevent old unusable + # certificates being left in directory after a restore + rm -f /var/ipfire/ovpn/certs/* + # Extract backup if ! tar xvzpf "${filename}" -C / \ --exclude-from="/var/ipfire/backup/exclude" \