-
Notifications
You must be signed in to change notification settings - Fork 136
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
Make parsing on jail.conf more robust #534
Conversation
I have spotted a bug so this isn't ready to be merged yet. Will push an update soon. |
f1bffa9
to
538cf34
Compare
OK I think its good to go now. I missed adding a new line to the config if the property wasn't already set. |
One other change in behaviour is that "not set" is now just printed and doesn't go via |
jail.conf has a few tricky things about it's format (such as supporting variable expansion) so it is easiest to get jail to do the parsing for us. The changes to get required changes to set as well as we no longer are calling grep so that became a single awk script as well.
OK I realise I was just being lazy so I had fixed that now as well. Hopefully that's the last of it! |
Just basic tested with/without quotes and with/without spaces, and with pipe P.S. Letting Sample output HERE |
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.
Tested the basics and the jail
parsing and var expansion seems to be working here as expected.
Between more testing is welcome.
jail.conf has a few tricky things about it's format (such as supporting
variable expansion) so it is easiest to get jail to do the parsing for us.
The changes to
get
required changes toset
as well as we are no longer calling grep so that became a single awk script as well.I hope there are some good tests for this code! One thing that has changed is the stripping of quotes on output, if they were present. I think this is better than sometimes having (and makes things easier for me for an upcoming change). I didn't see anywhere that broke existing code but I'm just a beginner.