From 86efae55d50cd80b644b9b9e0b296d1e52697ef5 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 14 Feb 2022 10:00:32 +0100 Subject: Always compute MD5 of cached image Do not rely on MD5 checksum file from the cache on tiptorrent transfers. Otherwise, cloning engine could restore a corrupted image. --- client/engine/Image.lib | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/engine/Image.lib b/client/engine/Image.lib index 98d3d19b..75541dca 100755 --- a/client/engine/Image.lib +++ b/client/engine/Image.lib @@ -240,10 +240,7 @@ if [ "$#" -eq 4 ] || [ "$#" -eq 5 ]; then IMGCACHEDIR=$(ogGetMountPoint $(ogFindCache))/opt/opengnsys/images IMGPATH="$IMGCACHEDIR/$IMGFILE" if [ -f "$IMGPATH" ]; then - if [ ! -f "$IMGPATH".full.sum ]; then - md5sum "$IMGPATH" | cut -f1 -d " " > "$IMGPATH".full.sum - fi - MD5FILE=$(cat "$IMGPATH".full.sum) + MD5FILE=$(md5sum "$IMGPATH" | cut -f1 -d " ") MD5WGET=$(wget -qO - "$ogrepo:9999/$IMGFILE.full.sum") if [ "$MD5FILE" != "$MD5WGET" ]; then ogTiptorrentGetToCache "$IMGPATH" "$IMGFILE" -- cgit v1.2.3-18-g5258