fix(#120): ensure message handling in journal logging command#121
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens journal logging by ensuring messages passed to the external logger command cannot be misinterpreted as command-line options when they begin with -.
Changes:
- Add
--to theloggerinvocation in_write_to_journalto end option parsing before the message argument.
Copilot AI
added a commit
that referenced
this pull request
Jun 6, 2026
Adds test_write_to_journal_passes_double_dash_before_message to test_journal_logging.sh to assert that log_to_journal passes -- before the message argument when calling logger, preventing option-injection for messages that begin with a hyphen (e.g. '-n not-an-option'). Uses assert_contains on the captured stub output instead of assert_file_contains to avoid a grep quirk where patterns starting with '--' are misinterpreted as long option names on this platform. Closes review comment #121 (comment)
…_journal` (#122) * Initial plan * test: add regression test for -- separator in _write_to_journal Adds test_write_to_journal_passes_double_dash_before_message to test_journal_logging.sh to assert that log_to_journal passes -- before the message argument when calling logger, preventing option-injection for messages that begin with a hyphen (e.g. '-n not-an-option'). Uses assert_contains on the captured stub output instead of assert_file_contains to avoid a grep quirk where patterns starting with '--' are misinterpreted as long option names on this platform. Closes review comment #121 (comment) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
GingerGraham
pushed a commit
that referenced
this pull request
Jun 6, 2026
## [2.5.5](2.5.4...2.5.5) (2026-06-06) ### Bug Fixes * **#120:** ensure message handling in journal logging command ([#121](#121))
Owner
Author
|
🎉 This PR is included in version 2.5.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
This pull request makes a minor update to the logging functionality by improving how messages are passed to the
loggercommand in thelogging.shscript.--argument before the message in theloggercommand to ensure that messages beginning with a hyphen are not misinterpreted as options. (logging.sh)