diff options
author | Lukacs Berki <lberki@google.com> | 2015-10-16 14:48:33 +0000 |
---|---|---|
committer | Laszlo Csomor <laszlocsomor@google.com> | 2015-10-16 15:17:10 +0000 |
commit | 58c29aed98a3292a8d59bc0a72bc12c9b33024f4 (patch) | |
tree | b25a3adfddd3b5eb911d7c9f1be3b4773c187d0e | |
parent | 26ac1f51215edffa87f8c139cd2f56bd499dbff0 (diff) |
Make the check for the sanity of install_base_key more stringent.
A previous commit caused install_base_key to be a large .zip file instead of 32 alphanumeric characters. Thus, when Bazel tried to extract itself, it tried to create a directory of the name "$INSTALL_BASE/<40M path segment>/<long path>", and it allocated said 40M each time it walked up a path segment trying to create parent directories.
--
MOS_MIGRATED_REVID=105600489
-rw-r--r-- | src/main/cpp/blaze.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc index 1e051b6a2c..02682115b9 100644 --- a/src/main/cpp/blaze.cc +++ b/src/main/cpp/blaze.cc @@ -189,9 +189,10 @@ class GetInstallKeyFileProcessor : public devtools_ijar::ZipExtractorProcessor { const devtools_ijar::u1 *data, const size_t size) { string str(reinterpret_cast<const char *>(data), size); blaze_util::StripWhitespace(&str); - if (str.size() < 32) { + if (str.size() != 32) { die(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR, - "\nFailed to extract install_base_key: file too short"); + "\nFailed to extract install_base_key: file size mismatch " + "(should be 32, is %zd)", str.size()); } *install_base_key_ = str; } |