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 parsing issue when a backslash as the last character on sudoers file line #7440
Conversation
1b14fb6
to
2fb0ab1
Compare
e2cdc6a
to
ce6d484
Compare
Looks good to me (I reviewed, but don't have the ability approve a PR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @iko1, thanks so much for this! Do you think we need to add/update the sudoers_test
to handle this case?
@sharvilshah, Indeed, the change should be covered in unit test. I'm thinking about adding the following tests:
If you have any other edge cases that should be covered, please elaborate them here |
Those sound great, thanks! |
60991f8
to
2155516
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks
This PR fixes the bug reported at #7421. I handle the case that a line contains a backslash as last character.
The code aggregates multiple lines within a "rule_details" column. The aggregation logic starts when a line ends with backslash and end when EOF or the next line doesn't end with a backlash.
The code deletes the backslash character in favor of clearness.
Any feedback is more than welcome, Thanks!