Skip to content

Commit 3a9fbd4

Browse files
committed
Always check the current lists before inserting on blueprints
Fixes #2282
1 parent 50f042e commit 3a9fbd4

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
@@ -724,7 +724,7 @@ static inline int _parse_blueprint_fix(const char *fix_text, struct blueprint_cu
724724
memcpy(val, &fix_text[ovector[2]], ovector[3] - ovector[2]);
725725
val[ovector[3] - ovector[2]] = '\0';
726726

727-
if (!oscap_list_contains(customizations->kernel_append, val, (oscap_cmp_func) oscap_streq)) {
727+
if (!oscap_list_contains(tab[i].list, val, (oscap_cmp_func) oscap_streq)) {
728728
oscap_list_prepend(tab[i].list, val);
729729
} else {
730730
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)