This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new f7232b7e YETUS-1266. Escape regex metacharacters in author plugin 
ignore list (#366)
f7232b7e is described below

commit f7232b7e86f717a1abeca4840442fa662ac7df89
Author: Nick Dimiduk <[email protected]>
AuthorDate: Mon Mar 23 12:20:58 2026 +0100

    YETUS-1266. Escape regex metacharacters in author plugin ignore list (#366)
    
    The author_postcompile function writes --author-ignore-list entries 
directly into a grep -E filter
    file without escaping. Filenames containing regex metacharacters 
(parentheses, brackets, etc.) are
    silently misinterpreted as pattern syntax, causing those files to pass 
through unfiltered.
---
 precommit/src/main/shell/plugins.d/author.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/precommit/src/main/shell/plugins.d/author.sh 
b/precommit/src/main/shell/plugins.d/author.sh
index 3a98ecae..fc33f072 100755
--- a/precommit/src/main/shell/plugins.d/author.sh
+++ b/precommit/src/main/shell/plugins.d/author.sh
@@ -147,7 +147,12 @@ function author_postcompile
   if [[ -z "${AUTHOR_IGNORE_LIST[0]}" ]]; then
     cp -p "${PATCH_DIR}/author-tags-git.txt" "${PATCH_DIR}/${AUTHOR_LOGNAME}"
   else
-    printf "^%s\n" "${AUTHOR_IGNORE_LIST[@]}" > 
"${PATCH_DIR}/author-tags-filter.txt"
+    for i in "${AUTHOR_IGNORE_LIST[@]}"; do
+      printf "%s\n" "${i}"
+    done \
+      | "${SED}" 's/[][\\.^$*+?{}()|]/\\&/g' \
+      | "${SED}" 's/^/^/' \
+      > "${PATCH_DIR}/author-tags-filter.txt"
     "${GREP}" -v -E \
       -f "${PATCH_DIR}/author-tags-filter.txt" \
       "${PATCH_DIR}/author-tags-git.txt" \

Reply via email to