1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

Bug #2729: Race condition in hash calculation in downloader.sh

This commit is contained in:
Jaime Melis 2014-02-18 12:43:38 +01:00
parent 4797588156
commit e18be2d517

View File

@ -188,8 +188,10 @@ esac
file_type=$(get_type "$command")
decompressor=$(get_decompressor "$file_type")
# Note: the 'cat' at the end of this pipeline forces the pipe to wait until
# all the 'tee' processes are finished
$command | tee >( decompress "$decompressor" "$TO" ) \
>( hasher $HASH_TYPE ) >/dev/null
>( hasher $HASH_TYPE ) | cat >/dev/null
if [ "$?" != "0" ]; then
echo "Error copying" >&2