aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-08-13 19:02:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-14 16:32:39 +0100
commite7cd4c86ef8a2c2bbf068e84c83fdc9e052b6e3d (patch)
treea570c782f2733e53ec83d4e94dc3cc6454e5e06b
parentd49483eb733ee27325349246fa37a84140c0941d (diff)
downloadbitbake-e7cd4c86ef8a2c2bbf068e84c83fdc9e052b6e3d.tar.gz
bitbake-e7cd4c86ef8a2c2bbf068e84c83fdc9e052b6e3d.tar.bz2
bitbake-e7cd4c86ef8a2c2bbf068e84c83fdc9e052b6e3d.zip
checksum: sanity check path when recursively checksumming
In case something goes tragically wrong, catch a request to checksum / and refuse. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/checksum.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bb/checksum.py b/lib/bb/checksum.py
index 84289208..4e1598fe 100644
--- a/lib/bb/checksum.py
+++ b/lib/bb/checksum.py
@@ -97,6 +97,8 @@ class FileChecksumCache(MultiProcessCache):
def checksum_dir(pth):
# Handle directories recursively
+ if pth == "/":
+ bb.fatal("Refusing to checksum /")
dirchecksums = []
for root, dirs, files in os.walk(pth):
for name in files: