Fix rsyslog logfiles bash remediation for omfile paths and globs#14715
Open
Mab879 wants to merge 1 commit into
Open
Fix rsyslog logfiles bash remediation for omfile paths and globs#14715Mab879 wants to merge 1 commit into
Mab879 wants to merge 1 commit into
Conversation
Split NUL-separated omfile matches into separate paths before chmod, expand $IncludeConfig globs in a nullglob subshell, and skip non-regular files. Document eval trust boundary for include path expansion.
|
Skipping CI for Draft Pull Request. |
Member
Author
|
/retest-required |
|
@Mab879: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
comps
reviewed
May 16, 2026
| # newline-concatenated string being appended as one bogus array element (breaks chmod). | ||
| ACTION_OMFILE_LINES=$(LC_ALL=C grep -iozP "action\s*\(\s*type\s*=\s*\"omfile\"[^\)]*\)" "${LOG_FILE}" 2>/dev/null || true) | ||
| [[ -n "${ACTION_OMFILE_LINES}" ]] || continue | ||
| _ACTION_NL=$(printf '%s' "${ACTION_OMFILE_LINES}" | tr '\0' '\n') |
Collaborator
There was a problem hiding this comment.
I'm pretty sure this doesn't do anything, bash variables cannot contain zeros.
$ printf '\x00\x01\x02' | hexdump -C
00000000 00 01 02 |...|
00000003
$ a=$(printf '\x00\x01\x02')
bash: warning: command substitution: ignored null byte in input
$ echo ${#a}
2
$ printf '\x00\x01\x02' > tmpf
$ read a < tmpf
$ echo ${#a}
2
$ printf '%s' "$a" | hexdump -C
00000000 01 02 |..|
00000002
$ hexdump -C <<<"$a"
00000000 01 02 0a |...|
00000003
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Split NUL-separated omfile matches into separate paths before chmod, expand $IncludeConfig globs in a nullglob subshell, and skip non-regular files. Document eval trust boundary for include path expansion.
Rationale:
Fixes #14570
Review Hints:
Review the contest test results and ensure they pass.