From e06f305b47663b3f20839e989b21a8e759179f16 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 3 Jun 2024 18:17:19 +0200 Subject: webmap-download: Use sha256_hex() for lock file names. Instead of sha1_hex(). --- webmap-download | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webmap-download b/webmap-download index 583c5dd..4936e24 100755 --- a/webmap-download +++ b/webmap-download @@ -27,7 +27,7 @@ import argparse import itertools from pathlib import Path from email.utils import parsedate_to_datetime, formatdate -from hashlib import sha1 +from hashlib import sha256 import requests import common @@ -214,7 +214,7 @@ if __name__ == '__main__': # place an exclusive lock on a lockfile as the destination can be used by other layers # hence might be updated in parallel if lockdir_fd is not None: - lockfile = sha1(dest.encode('utf-8')).hexdigest() + '.lck' + lockfile = sha256(dest.encode('utf-8')).hexdigest() + '.lck' # use O_TRUNC to bump lockfile's mtime lock_fd = os.open(lockfile, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, mode=0o644, dir_fd=lockdir_fd) try: -- cgit v1.2.3