live: check permissions when trying to fetch file via unicast

check sufficient permissions and bail out in case of issues.
master v1.3.2-12
OpenGnSys Support Team 2024-06-27 11:56:10 +02:00
parent a9d8cdd210
commit 43039749c5
1 changed files with 4 additions and 0 deletions

View File

@ -201,7 +201,11 @@ class OgLiveOperations:
not tip_check_csum(repo, name)):
self._copy_image_to_cache(name)
else:
if os.access(f'/opt/opengnsys/images', os.R_OK) == False:
raise OgError('Cannot access /opt/opengnsys/images in read mode, check permissions')
image_path = f'/opt/opengnsys/images/{name}.img'
self._restore_image(image_path, devpath)
def _restore_image_tiptorrent(self, repo, name, devpath):