Rule validation treats .1.2.3.4 and *.1.2.3.4 differently
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read rejectionReason(forRemoteHost:) in Sources/Shared/RuleTransport.swift around lines 181-193 and compare how the *. and . prefixes are stripped before the IP/CIDR check (the .-prefix path currently skips it). Normalise both spellings to the same suffix and run the existing cases in Scripts/test_rule_transport.sh first to see the harness. Add a case asserting .1.2.3.4 is rejected like *.1.2.3.4; done when both are rejected for the same reason and the script passes.
Written by the indexing model from the issue text.
Description
Since #199, a host rule written as .example.com means exactly the same as *.example.com. The validation in Sources/Shared/RuleTransport.swift (rejectionReason(forRemoteHost:), around lines 181-193) still treats them differently when the part after the prefix is an IP address or CIDR: *.1.2.3.4 is rejected, while .1.2.3.4 is accepted.
It is harmless today, because .1.2.3.4 can only ever match that literal host text, but the two spellings should be validated the same way.
Done when: .-prefixed and *.-prefixed host patterns go through the same check, so .1.2.3.4 is rejected for the same reason as *.1.2.3.4, with a case for it in Scripts/test_rule_transport.sh.
- Dominant language
- Swift
- Stars
- 49
- Forks
- 5
- Avg merge
- 14h 18m
- Merged PRs (30d)
- 102
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from isaaclins/freesnitch
-
area:netext bug priority:low status:queued type:diagnostics
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
isaaclins/freesnitch#457 ·
Maintainers usually reply within 1 day
-
area:gui bug priority:low status:queued
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
isaaclins/freesnitch#450 · 1 comment ·
Maintainers usually reply within 1 day
-
area:gui bug priority:low status:queued type:correctness
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
isaaclins/freesnitch#443 ·
Maintainers usually reply within 1 day
-
area:gui bug priority:low status:queued
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
isaaclins/freesnitch#428 ·
Maintainers usually reply within 1 day
-
area:shared bug priority:high status:queued type:correctness
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
isaaclins/freesnitch#284 ·
Maintainers usually reply within 1 day
All issues in isaaclins/freesnitch
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Photivra/nope-camera#168 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day