[bitbake-devel,2/2] checksum: sanity check path when recursively checksumming

Submitted by Ross Burton on Aug. 13, 2018, 6:02 p.m. | Patch ID: 153707

Details

Message ID 20180813180226.18299-2-ross.burton@intel.com
State New
Headers show

Commit Message

Ross Burton Aug. 13, 2018, 6:02 p.m.
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(+)

Patch hide | download patch | download mbox

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: