-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix extra quotes in firewall string matching #944
Conversation
As reported by Steve Traylon[1] and @patricknelson[2], the munging adds extra quotes to the string. This breaks the string matching in iptables, as it looks for literal single quotes in the match. Removing the munging fixes this. [1] https://tickets.puppetlabs.com/browse/MODULES-3454?focusedCommentId=686988&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-686988 [2] 3655c6b#diff-379160b60a9bdf297b92a51d20efd8c3R1426
|
Thanks for the fix @IBBoard and references for explanation! It looks as though some unit tests are now failing as they were testing with the (incorrect!) assertion that the string match values should be wrapped in single quotes. Could you update those tests' data with the new unquoted string values? I also think you've highlighted the fact that we don't have an acceptance test that will actually test |
ARGS_TO_HASH was correct (unquoted) but HASH_TO_ARGS contained the rogue single quotes
|
That should have fixed the unit/fixture tests. I've not added any acceptance tests because a) I don't know which of several files they go in and b) from what I understand of them then I can't run them without altering my system, and I don't have anywhere to test them at the moment. I might be able to write an acceptance test in the dark and hope it works, but it doesn't seem like a good use of Travis cycles! |
Codecov Report
@@ Coverage Diff @@
## main #944 +/- ##
=======================================
Coverage ? 81.12%
=======================================
Files ? 11
Lines ? 1664
Branches ? 0
=======================================
Hits ? 1350
Misses ? 314
Partials ? 0 Continue to review full report at Codecov.
|
|
Hi @IBBoard , thank you for your contribution. |
As reported by Steve Traylon[1] and @patricknelson[2], the munging adds extra quotes to the string.
This breaks the string matching in iptables, as it looks for literal single quotes in the match.
Removing the munging fixes this.
[1] https://tickets.puppetlabs.com/browse/MODULES-3454?focusedCommentId=686988&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-686988
[2] 3655c6b#diff-379160b60a9bdf297b92a51d20efd8c3R1426