1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

strip_and_copy_image: abort on broken symlinks

Also guard against other processes removing the files we are about to
copy.

closes fdroid/fdroidserver#783
This commit is contained in:
Marcus Hoffmann 2020-06-04 12:30:40 +02:00
parent 4c69411387
commit 581e433832

View File

@ -797,6 +797,13 @@ def _strip_and_copy_image(in_file, outpath):
"""
logging.debug('copying ' + in_file + ' ' + outpath)
if not os.path.exists(in_file):
if os.path.islink(in_file):
logging.warning(_("Broken symlink: {path}").format(path=in_file))
else:
logging.warning(_("File disappeared while processing it: {path}").format(path=in_file))
return
if os.path.isdir(outpath):
out_file = os.path.join(outpath, os.path.basename(in_file))
else: