From: Ross Burton <ross.burton@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/3] checksum: sanity check path when recursively checksumming
Date: Mon, 13 Aug 2018 18:20:53 +0100 [thread overview]
Message-ID: <20180813172054.17767-2-ross.burton@intel.com> (raw)
In-Reply-To: <20180813172054.17767-1-ross.burton@intel.com>
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(+)
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:
--
2.11.0
next prev parent reply other threads:[~2018-08-13 17:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 17:20 [PATCH 1/3] utils/md5_file: don't iterate line-by-line Ross Burton
2018-08-13 17:20 ` Ross Burton [this message]
2018-08-13 17:20 ` [PATCH 3/3] classes: sanity-check LIC_FILES_CHKSUM Ross Burton
2018-08-13 17:32 ` ✗ patchtest: failure for "utils/md5_file: don't iterate ..." and 2 more Patchwork
2018-08-13 18:03 ` [PATCH 1/3] utils/md5_file: don't iterate line-by-line akuster808
2018-08-13 18:04 ` Burton, Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180813172054.17767-2-ross.burton@intel.com \
--to=ross.burton@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox