From 8395982244bf032676624af97e5ddb9bb6636bd8 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Mon, 29 Jul 2024 23:30:24 +0200 Subject: live: validate file existence and checksum for unicast cache after copying file to cache, validate that file exists in cache and checksum correct. --- src/live/ogOperations.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index d4817f6..086a0b4 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -208,6 +208,11 @@ class OgLiveOperations: if (not os.path.exists(image_path) or not tip_check_csum(repo, name)): self._copy_image_to_cache(name) + + if (not os.path.exists(image_path)): + raise OgError(f'could not find {image_path} in cache') + if (not tip_check_csum(repo, name)): + raise OgError(f'Failed to validate checksum for {name}.img') else: if os.access(f'/opt/opengnsys/images', os.R_OK) == False: raise OgError('Cannot access /opt/opengnsys/images in read mode, check permissions') -- cgit v1.2.3-18-g5258