author | Mike Sullivan <Mike.Sullivan@Oracle.COM> |
Tue, 11 Oct 2016 16:58:27 -0700 | |
changeset 7091 | 08a4029cbd6c |
parent 5985 | 6b195cad32d4 |
permissions | -rw-r--r-- |
5985
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
1 |
This patch is from the community and resolves the issue when XCCDF rule |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
2 |
role=unscored is set, the rule is not counted against the score of the |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
3 |
benchmark. This patch will no longer be needed once we pull in the |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
4 |
latest version of openscap from the cummunity. |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
5 |
|
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
6 |
--- openscap-1.2.6/src/XCCDF/result_scoring.c.~1~ 2015-10-02 08:22:02.497343616 -0700 |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
7 |
+++ openscap-1.2.6/src/XCCDF/result_scoring.c 2016-01-07 08:57:38.143524150 -0800 |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
8 |
@@ -71,7 +71,10 @@ |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
9 |
const char *rule_id = xccdf_rule_get_id((const struct xccdf_rule *) item); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
10 |
rule_result = xccdf_result_get_rule_result_by_id(test_result, rule_id); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
11 |
if (rule_result == NULL) { |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
12 |
- dE("Rule result ID(%s) not fount", rule_id); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
13 |
+ dE("Rule result ID(%s) not found", rule_id); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
14 |
+ return NULL; |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
15 |
+ } |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
16 |
+ if (xccdf_rule_result_get_role(rule_result) == XCCDF_ROLE_UNSCORED) { |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
17 |
return NULL; |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
18 |
} |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
19 |
|
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
20 |
@@ -168,7 +171,10 @@ |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
21 |
const char *rule_id = xccdf_rule_get_id((const struct xccdf_rule *) item); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
22 |
rule_result = xccdf_result_get_rule_result_by_id(test_result, rule_id); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
23 |
if (rule_result == NULL) { |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
24 |
- dE("Rule result ID(%s) not fount", rule_id); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
25 |
+ dE("Rule result ID(%s) not found", rule_id); |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
26 |
+ return NULL; |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
27 |
+ } |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
28 |
+ if (xccdf_rule_result_get_role(rule_result) == XCCDF_ROLE_UNSCORED) { |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
29 |
return NULL; |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
30 |
} |
6b195cad32d4
22353495 setting the XCCDF rule's role to unscored, has no effect on the scoring
Jacob Varughese <jacob.varughese@oracle.com>
parents:
diff
changeset
|
31 |