Match a target SSID that isn't a valid glob as plain text #7

Merged
aluminum-ice merged 1 commit from target-glob-fallback into master 2026-11-18 14:45:09 +00:00
Owner

What this PR does

Stops a target SSID that isn't a valid glob from crashing AngryOxide, the same fix #5 made for the whitelist.

  • A target SSID (--target, or a line in a targets file) is matched as a glob in TargetSSID::target_match (src/targets.rs) and in get_device_by_ssid_glob (src/devices.rs, used by the anonymous rogue M2 path). Both called Glob::new(..).unwrap(), which panics on an SSID such as Cafe [Guest (an unclosed [) the first time an AP is checked.
  • Both now go through a new util::ssid_matches_pattern(pattern, ssid): a valid glob matches as before, and an invalid one matches only that exact SSID.
  • The whitelist keeps its own helper from #5, so this commit applies to upstream master on its own, without #83 there.

Kestrel never passes --target, so this doesn't change anything Kestrel runs; it's for anyone using targets, and it waits for the next release after v0.9.5.

Checks

  • cargo build --release --locked: builds; no new warnings (the one in this crate, src/advancedtable/advtable.rs:659, is on master too).
  • cargo test --release --locked: 12 passed (9 existing, 3 new: patterns as globs, an invalid pattern matching only itself, and a TargetSSID with one).

After merging

The same commit goes upstream as its own PR, beside Ragnt/AngryOxide#83.

🤖 Generated with Claude Code

## What this PR does Stops a target SSID that isn't a valid glob from crashing AngryOxide, the same fix #5 made for the whitelist. - A target SSID (`--target`, or a line in a targets file) is matched as a glob in `TargetSSID::target_match` (`src/targets.rs`) and in `get_device_by_ssid_glob` (`src/devices.rs`, used by the anonymous rogue M2 path). Both called `Glob::new(..).unwrap()`, which panics on an SSID such as `Cafe [Guest` (an unclosed `[`) the first time an AP is checked. - Both now go through a new `util::ssid_matches_pattern(pattern, ssid)`: a valid glob matches as before, and an invalid one matches only that exact SSID. - The whitelist keeps its own helper from #5, so this commit applies to upstream `master` on its own, without #83 there. Kestrel never passes `--target`, so this doesn't change anything Kestrel runs; it's for anyone using targets, and it waits for the next release after v0.9.5. ## Checks - `cargo build --release --locked`: builds; no new warnings (the one in this crate, `src/advancedtable/advtable.rs:659`, is on `master` too). - `cargo test --release --locked`: 12 passed (9 existing, 3 new: patterns as globs, an invalid pattern matching only itself, and a `TargetSSID` with one). ## After merging The same commit goes upstream as its own PR, beside Ragnt/AngryOxide#83. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A target SSID (--target or a targets file) is matched as a glob pattern, in
TargetSSID::target_match and get_device_by_ssid_glob. An SSID that isn't a
valid pattern, such as one with an unclosed "[", made Glob::new(...).unwrap()
panic the first time an AP was checked. Both now go through
util::ssid_matches_pattern, where such a target matches only that exact SSID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch target-glob-fallback 2026-11-18 14:45:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/AngryOxide!7
No description provided.