Teach our check-DNS script to ignore temporary files (#27285)

A plain `grep` was occasionally attempting to grep temporaary files that
were being created and deleted concurrently by other sanity check
scripts, leading to TOCTOU problems. This now only searches indexed
files (thanks for the suggestion, @ctiller!).

We still need to exclude `third_party` since upb is not a submodule.
`git grep` will ignore all submodules by default, so the other
third_party subfolders were already excluded.
pull/27182/head
AJ Heller 4 years ago committed by GitHub
parent ce95fd2586
commit b555b2f86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      tools/run_tests/sanity/check_do_not_submit.sh

@ -16,9 +16,8 @@
# Checks if any file contains "DO NOT SUBMIT"
cd "$(dirname "$0")/../../.." || exit 1
grep -Irn \
--exclude='check_do_not_submit.sh' \
--exclude-dir='.git/' \
--exclude-dir='third_party/' \
'DO NOT SUBMIT'
git grep -Irn 'DO NOT SUBMIT' -- \
'./*' \
':!*check_do_not_submit.sh' \
':!third_party/'
test $? -eq 1 || exit 1

Loading…
Cancel
Save