Skip to content

Commit 136e8f1

Browse files
apply change request. fail result when no suitable fix found.
1 parent 4a89569 commit 136e8f1

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/XCCDF_POLICY/xccdf_policy_remediate.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ int xccdf_policy_rule_result_remediate(struct xccdf_policy *policy, struct xccdf
508508
if (fix == NULL) {
509509
// We want to append xccdf:message about missing fix.
510510
_rule_add_info_message(rr, "No suitable fix found.");
511-
xccdf_rule_result_set_result(rr, XCCDF_RESULT_ERROR);
511+
xccdf_rule_result_set_result(rr, XCCDF_RESULT_FAIL);
512512
misc_error=1;
513513
}
514514
}
@@ -518,16 +518,6 @@ int xccdf_policy_rule_result_remediate(struct xccdf_policy *policy, struct xccdf
518518
while (xccdf_check_iterator_has_more(check_it))
519519
check = xccdf_check_iterator_next(check_it);
520520
xccdf_check_iterator_free(check_it);
521-
522-
// this following condition seems to be unwanted, no standard specifies that
523-
// a fix shouldn't be ran for a multicheck.
524-
525-
/*if (check != NULL && xccdf_check_get_multicheck(check)) {
526-
// Do not try to apply fix for multi-check.
527-
_rule_add_info_message(rr, "cannot apply fix for multicheck.");
528-
xccdf_rule_result_set_result(rr, XCCDF_RESULT_ERROR);
529-
misc_error=1;
530-
}*/
531521

532522
if(misc_error == 0){
533523
/* Initialize the fix. */

tests/API/XCCDF/unittests/test_remediation_fix_without_system.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $OSCAP xccdf validate $result
2121

2222
assert_exists 1 '//rule-result'
2323
assert_exists 1 '//rule-result/result'
24-
assert_exists 1 '//rule-result/result[text()="error"]'
24+
assert_exists 1 '//rule-result/result[text()="fail"]'
2525
assert_exists 0 '//rule-result/fix'
2626
assert_exists 1 '//rule-result/message[text()="No suitable fix found."]'
2727
assert_exists 1 '//score'

0 commit comments

Comments
 (0)