summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-28 12:23:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-28 12:38:25 +0100
commitb8b14d975a254444461ba857fc6fb8c725de8874 (patch)
tree8cf8c142b6625a2fef44ab45b76352eac26a5ff7 /lib/bb/fetch2
parent921592026c69287cdb40ffd90944d5944f28e2c3 (diff)
downloadbitbake-contrib-b8b14d975a254444461ba857fc6fb8c725de8874.tar.gz
fetch2: Ensure we don't have file downloads overwriting each other
Imagine you have an sstate mirror accessed over http and an SSTATE_MIRRORS which maps file:// urls to http:// urls. File urls set donestampneeded = False, http urls don't. This can result in races in the try_mirror_url() code since it will trigger new downloads after aquiring the lockfile as verify_donestamp() doesn't look at origud and there is no donestamp. verify_donestamp() already has code to look at origud, we're just missing some code at the start of the function to do this. Fix it to avoid these races. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2')
-rw-r--r--lib/bb/fetch2/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 464e66b98..ea72025c2 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -625,7 +625,7 @@ def verify_donestamp(ud, d, origud=None):
Returns True, if the donestamp exists and is valid, False otherwise. When
returning False, any existing done stamps are removed.
"""
- if not ud.needdonestamp:
+ if not ud.needdonestamp or (origud and not origud.needdonestamp):
return True
if not os.path.exists(ud.donestamp):