From d28a4b2520adeeaa1b9e921bf42c7c1f36552c06 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 27 May 2024 17:45:51 +0300 Subject: [PATCH] license-check.sh: Use '--' with slightly untrusted filenames Names from git ls-files should be safe but if one runs it on a tree without the .git dir and there are extra files, it's safer to have the end of arguments marked with '--'. --- build-aux/license-check.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-aux/license-check.sh b/build-aux/license-check.sh index ce1f60c5..85540727 100644 --- a/build-aux/license-check.sh +++ b/build-aux/license-check.sh @@ -100,11 +100,11 @@ FILES=$(printf '%s\n' "$FILES" | sort) # Find the tagged files. TAGGED=$(printf '%s\n' "$FILES" \ - | tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI") + | tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI" --) # Find the tagged 0BSD files. TAGGED_0BSD=$(printf '%s\n' "$TAGGED" \ - | tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI 0BSD") + | tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI 0BSD" --) # Find the tagged non-0BSD files, that is, remove the 0BSD-tagged files # from the list of tagged files. @@ -127,7 +127,7 @@ FILES=$(printf '%s\n' "$FILES" | grep -Ev \ # These are old translations that haven't been updated after 2024-02-14. # Eventually these should go away. PD_PO=$(printf '%s\n' "$FILES" | grep '\.po$' | tr '\n' '\000' \ - | xargs -0r grep -Fl '# This file is put in the public domain.') + | xargs -0r grep -Fl '# This file is put in the public domain.' --) if test -n "$PD_PO"; then # Remove the public domain .po files from the list.