diff mbox series

[2/3] checksum: sanity check path when recursively checksumming

Message ID 20180813172054.17767-2-ross.burton@intel.com
State New
Headers show
Series [1/3] utils/md5_file: don't iterate line-by-line | expand

Commit Message

Ross Burton Aug. 13, 2018, 5:20 p.m. UTC
In case something goes tragically wrong, catch a request to checksum / and
refuse.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 bitbake/lib/bb/checksum.py | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/bitbake/lib/bb/checksum.py b/bitbake/lib/bb/checksum.py
index 84289208f44..4e1598fe835 100644
--- a/bitbake/lib/bb/checksum.py
+++ b/bitbake/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: