From 55355726d58fef8548abde4fbcfc549a90d4a868 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sat, 1 Sep 2018 20:24:00 -0400 Subject: [PATCH] backups: Use valid filename for export Signed-off-by: James Valleroy Reviewed-by: Joseph Nuthalapati --- plinth/modules/backups/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/modules/backups/__init__.py b/plinth/modules/backups/__init__.py index db7095de9..85edf57c1 100644 --- a/plinth/modules/backups/__init__.py +++ b/plinth/modules/backups/__init__.py @@ -21,6 +21,7 @@ FreedomBox app to manage backup archives. import json import os +from django.utils.text import get_valid_filename from django.utils.translation import ugettext_lazy as _ from plinth import actions @@ -105,7 +106,9 @@ def delete_archive(name): def export_archive(name, location): if location[-1] != '/': location += '/' - filename = location + 'FreedomBox-backups/' + name + '.tar.gz' + + filename = location + 'FreedomBox-backups/' + get_valid_filename( + name) + '.tar.gz' actions.superuser_run('backups', ['export', '--name', name, '--filename', filename])