-
Notifications
You must be signed in to change notification settings - Fork 383
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
Support Blueprint services customization for masking #2091
Conversation
static int _xccdf_policy_rule_generate_blueprint_fix(struct xccdf_policy *policy, struct xccdf_rule *rule, const char *template, | ||
struct oscap_list *generic, | ||
struct oscap_list *services_enable, struct oscap_list *services_disable, struct oscap_list *services_mask, | ||
struct oscap_list *kernel_append) |
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.
Can we have a structure instead of having too many parameters?
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.
Yeah, why not.
struct oscap_iterator *services_mask_it = oscap_iterator_new(services_mask); | ||
while(oscap_iterator_has_more(services_mask_it)) { | ||
char *var_line = (char *) oscap_iterator_next(services_mask_it); | ||
_write_text_to_fd(output_fd, var_line); | ||
if (oscap_iterator_has_more(services_mask_it)) | ||
_write_text_to_fd(output_fd, ","); | ||
} | ||
_write_text_to_fd(output_fd, "]\n\n"); | ||
oscap_iterator_free(services_mask_it); | ||
oscap_list_free(services_mask, free); |
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.
This block seems to be a repeating theme. Can we refactor the code to reduce duplication?
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.
Sure, can be done.
[customizations.services] masked = ["service"]
f98d07c
to
e8369e4
Compare
This will now be properly parsed and organized: