CFE-612: Made signal name matching case-insensitive#6199
Open
nickanderson wants to merge 3 commits into
Open
Conversation
e3c4e9e to
9d4ade1
Compare
| if (pid == 1) | ||
| { | ||
| if (RlistLen(a->signals) == 1 && RlistKeyIn(a->signals, "hup")) | ||
| if (RlistLen(a->signals) == 1 && RlistKeyIn_IgnoreCase(a->signals, "hup")) |
| if (pid == 1) | ||
| { | ||
| if (RlistLen(a->signals) == 1 && RlistKeyIn(a->signals, "hup")) | ||
| if (RlistLen(a->signals) == 1 && RlistKeyIn_IgnoreCase(a->signals, "hup")) |
Signal names can now be written in any case (TERM, Term, term, etc.) without triggering a validation error or failing to match. Ticket: CFE-612 Changelog: Title
9d4ade1 to
16ec65d
Compare
The case-insensitive signals change wrapped the entire validation alternation in (?i:...), which also made the sleep-period token [0-9]+s? case-insensitive. As a result "10S" passed policy validation, but the runtime sleep parser in verify_processes.c only accepts a lowercase 's', so "10S" was treated as an unknown signal name (SignalFromString returns -1) and reached kill(pid, -1). Move [0-9]+s? outside the (?i:...) group so case-insensitivity applies only to signal names, keeping validation aligned with the runtime. Ticket: CFE-612 Changelog: None Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
signals_case_insensitive.cf relied on a fixed 2s sleep to wait for the victim to install its SIGTERM trap and a fixed 3s sleep for the trap to write its sentinel. Both margins can be too short on a loaded CI host (false failure) and pure waste on a fast one. Replace them with bounded polls: the victim writes a ready file after installing its trap, and a small helper polls (up to ~10s) for a file to become non-empty -- one for the ready file before signalling, one for the sentinel before the check bundle reads it. Ticket: CFE-612 Changelog: None Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Signal names can now be written in any case (TERM, Term, term, etc.)
without triggering a validation error or failing to match.
Ticket: CFE-612
Changelog: Title