fix: force data filter for tar archive extraction

(python3.14 default anyway)
This commit is contained in:
2026-02-19 01:13:50 +02:00
parent 6fe2eade26
commit 422196d413
3 changed files with 8 additions and 6 deletions

View File

@@ -81,11 +81,13 @@ class Backup(Handler):
Returns:
set[Path]: map of the filesystem paths
"""
paths = set(configuration.include.glob("*.ini"))
# configuration files
root, _ = configuration.check_loaded()
paths.add(root) # the configuration itself
paths.add(SQLite.database_path(configuration)) # database
paths = set(configuration.includes)
paths.add(root)
# database
paths.add(SQLite.database_path(configuration))
# local caches
repository_paths = configuration.repository_paths

View File

@@ -47,7 +47,7 @@ class Restore(Handler):
report(bool): force enable or disable reporting
"""
with tarfile.open(args.path) as archive:
archive.extractall(path=args.output) # nosec
archive.extractall(path=args.output, filter="data")
@staticmethod
def _set_repo_restore_parser(root: SubParserAction) -> argparse.ArgumentParser:

View File

@@ -34,7 +34,7 @@ def test_run(args: argparse.Namespace, configuration: Configuration, mocker: Moc
_, repository_id = configuration.check_loaded()
Restore.run(args, repository_id, configuration, report=False)
extract_mock.extractall.assert_called_once_with(path=args.output)
extract_mock.extractall.assert_called_once_with(path=args.output, filter="data")
def test_disallow_multi_architecture_run() -> None: