Skip to content

Commit dd31572

Browse files
authored
Merge pull request #2283 from Mab879/fix_2282
Always check the current lists before inserting on blueprints
2 parents a9c51af + 6767362 commit dd31572

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/XCCDF_POLICY/xccdf_policy_remediate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ static inline int _parse_blueprint_fix(const char *fix_text, struct blueprint_cu
742742
memcpy(val, &fix_text[ovector[2]], ovector[3] - ovector[2]);
743743
val[ovector[3] - ovector[2]] = '\0';
744744

745-
if (!oscap_list_contains(customizations->kernel_append, val, (oscap_cmp_func) oscap_streq)) {
745+
if (!oscap_list_contains(tab[i].list, val, (oscap_cmp_func) oscap_streq)) {
746746
oscap_list_prepend(tab[i].list, val);
747747
} else {
748748
free(val);

tests/API/XCCDF/unittests/test_remediation_blueprint.xccdf.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ enabled = ["sshd"]
104104
<fix system="urn:redhat:osbuild:blueprint">
105105
[customizations.services]
106106
masked = ["evil"]
107+
</fix>
108+
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
109+
<check-content-ref href="test_remediation_simple.oval.xml" name="oval:moc.elpmaxe.www:def:1"/>
110+
</check>
111+
</Rule>
112+
<Rule selected="true" id="xccdf_moc.elpmaxe.www_rule_11">
113+
<title>Enable sshd</title>
114+
<fix system="urn:redhat:osbuild:blueprint">
115+
[customizations.services]
116+
enabled = ["sshd"]
107117
</fix>
108118
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
109119
<check-content-ref href="test_remediation_simple.oval.xml" name="oval:moc.elpmaxe.www:def:1"/>

0 commit comments

Comments
 (0)