| 1 | /** |
| 2 | * @file oval_resultTest.c |
| 3 | * \brief Open Vulnerability and Assessment Language |
| 4 | * |
| 5 | * See more details at http://oval.mitre.org/ |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2009--2014 Red Hat Inc., Durham, North Carolina. |
| 10 | * All Rights Reserved. |
| 11 | * |
| 12 | * This library is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU Lesser General Public |
| 14 | * License as published by the Free Software Foundation; either |
| 15 | * version 2.1 of the License, or (at your option) any later version. |
| 16 | * |
| 17 | * This library is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 20 | * Lesser General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU Lesser General Public |
| 23 | * License along with this library; if not, write to the Free Software |
| 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 | * |
| 26 | * Authors: |
| 27 | * "David Niemoller" <[email protected]> |
| 28 | * "Peter Vrabec" <[email protected]> |
| 29 | * Šimon Lukašík |
| 30 | */ |
| 31 | |
| 32 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 33 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 34 | #endif |
| 35 | |
| 36 | #include <string.h> |
| 37 | #include <ctype.h> |
| 38 | #include "oval_agent_api_impl.h"cxx . . $ `<file>/src/OVAL/oval_agent_api_impl.h`/ |
| 39 | #ifdef OVAL_PROBES_ENABLEDcxx . . $ `build/config.h:67:9`! |
| 40 | #include "oval_probe_impl.h"cxx . . $ `<file>/src/OVAL/oval_probe_impl.h`/ |
| 41 | #endif |
| 42 | #include "results/oval_results_impl.h"cxx . . $ `<file>/src/OVAL/results/oval_results_impl.h`/ |
| 43 | #include "results/oval_status_counter.h"cxx . . $ `<file>/src/OVAL/results/oval_status_counter.h`/ |
| 44 | #include "oval_cmp_impl.h"cxx . . $ `<file>/src/OVAL/results/oval_cmp_impl.h`/ |
| 45 | #include "adt/oval_collection_impl.h"cxx . . $ `<file>/src/OVAL/adt/oval_collection_impl.h`/ |
| 46 | #include "adt/oval_string_map_impl.h"cxx . . $ `<file>/src/OVAL/adt/oval_string_map_impl.h`/ |
| 47 | #include "collectVarRefs_impl.h"cxx . . $ `<file>/src/OVAL/collectVarRefs_impl.h`/ |
| 48 | #include "public/oval_types.h"cxx . . $ `<file>/src/OVAL/public/oval_types.h`/ |
| 49 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 50 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 51 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 52 | |
| 53 | typedef struct oval_result_testcxx . . $ oval_result_test# { |
| 54 | struct oval_result_systemcxx . . $ oval_result_system# *systemcxx . . $ oval_result_test#system.; |
| 55 | struct oval_testcxx . . $ oval_test# *testcxx . . $ oval_result_test#test.; |
| 56 | oval_result_tcxx . . $ oval_result_t# resultcxx . . $ oval_result_test#result.; |
| 57 | struct oval_collectioncxx . . $ oval_collection# *messagescxx . . $ oval_result_test#messages.; |
| 58 | struct oval_collectioncxx . . $ oval_collection# *itemscxx . . $ oval_result_test#items.; |
| 59 | struct oval_collectioncxx . . $ oval_collection# *bindingscxx . . $ oval_result_test#bindings.; |
| 60 | int instancecxx . . $ oval_result_test#instance.; |
| 61 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! bindings_initializedcxx . . $ oval_result_test#bindings_initialized.; |
| 62 | } oval_result_test_tcxx . . $ oval_result_test_t#; |
| 63 | |
| 64 | struct oval_result_testcxx . . $ oval_result_test# *oval_result_test_newcxx . . $ oval_result_test_new(17a46a2b354fb6eb).(struct oval_result_systemcxx . . $ oval_result_system# *sys, char *tstid) |
| 65 | { |
| 66 | oval_result_test_tcxx . . $ oval_result_test_t# *test = (oval_result_test_tcxx . . $ oval_result_test_t# *) |
| 67 | malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_result_test_tcxx . . $ oval_result_test_t#)); |
| 68 | if (test == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 69 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 70 | |
| 71 | struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(sys); |
| 72 | struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(syschar_model); |
| 73 | test->systemcxx . . $ oval_result_test#system. = sys; |
| 74 | test->testcxx . . $ oval_result_test#test. = oval_definition_model_get_new_testcxx . . $ oval_definition_model_get_new_test(c765f99071e189c).(definition_model, tstid); |
| 75 | test->messagescxx . . $ oval_result_test#messages. = oval_collection_newcxx . . $ oval_collection_new(18476da3f812812d).(); |
| 76 | test->resultcxx . . $ oval_result_test#result. = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 77 | test->instancecxx . . $ oval_result_test#instance. = 1; |
| 78 | test->itemscxx . . $ oval_result_test#items. = oval_collection_newcxx . . $ oval_collection_new(18476da3f812812d).(); |
| 79 | test->bindingscxx . . $ oval_result_test#bindings. = oval_collection_newcxx . . $ oval_collection_new(18476da3f812812d).(); |
| 80 | test->bindings_initializedcxx . . $ oval_result_test#bindings_initialized. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 81 | return test; |
| 82 | } |
| 83 | |
| 84 | struct oval_result_testcxx . . $ oval_result_test# *oval_result_test_clonecxx . . $ oval_result_test_clone(167630a09afaa8cf). |
| 85 | (struct oval_result_systemcxx . . $ oval_result_system# *new_system, struct oval_result_testcxx . . $ oval_result_test# *old_test) { |
| 86 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(old_test); |
| 87 | |
| 88 | const char *testid = oval_result_test_get_idcxx . . $ oval_result_test_get_id(a65fe3b568e8bf5).(old_test); |
| 89 | struct oval_result_testcxx . . $ oval_result_test# *new_test = oval_result_test_newcxx . . $ oval_result_test_new(17a46a2b354fb6eb).(new_system, (char *) testid); |
| 90 | struct oval_result_item_iteratorcxx . . $ oval_result_item_iterator# *old_items = oval_result_test_get_itemscxx . . $ oval_result_test_get_items(39eccb4e00b508db).(old_test); |
| 91 | while (oval_result_item_iterator_has_morecxx . . $ oval_result_item_iterator_has_more(a237e157d1921aa4).(old_items)) { |
| 92 | struct oval_result_itemcxx . . $ oval_result_item# *old_item = oval_result_item_iterator_nextcxx . . $ oval_result_item_iterator_next(82225cab81b266fe).(old_items); |
| 93 | struct oval_result_itemcxx . . $ oval_result_item# *new_item = oval_result_item_clonecxx . . $ oval_result_item_clone(a55a5a6bb7b56625).(new_system, old_item); |
| 94 | oval_result_test_add_itemcxx . . $ oval_result_test_add_item(70d52eaa6ff6c17d).(new_test, new_item); |
| 95 | } |
| 96 | oval_result_item_iterator_freecxx . . $ oval_result_item_iterator_free(cc5d1a6fd9e0d5a0).(old_items); |
| 97 | |
| 98 | struct oval_variable_binding_iteratorcxx . . $ oval_variable_binding_iterator# *old_bindings = oval_result_test_get_bindingscxx . . $ oval_result_test_get_bindings(f33289e3d5e96a2a).(old_test); |
| 99 | while (oval_variable_binding_iterator_has_morecxx . . $ oval_variable_binding_iterator_has_more(422cba9ccf408239).(old_bindings)) { |
| 100 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *old_binding = oval_variable_binding_iterator_nextcxx . . $ oval_variable_binding_iterator_next(4e13e803cf09d396).(old_bindings); |
| 101 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *new_binding = oval_variable_binding_clonecxx . . $ oval_variable_binding_clone(c98cad892206d52e).(old_binding, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 102 | oval_result_test_add_bindingcxx . . $ oval_result_test_add_binding(94139c95afeea5f2).(new_test, new_binding); |
| 103 | } |
| 104 | oval_variable_binding_iterator_freecxx . . $ oval_variable_binding_iterator_free(70e37e87cc950ccc).(old_bindings); |
| 105 | |
| 106 | struct oval_message_iteratorcxx . . $ oval_message_iterator# *old_messages = oval_result_test_get_messagescxx . . $ oval_result_test_get_messages(5232250ab749b372).(old_test); |
| 107 | while (oval_message_iterator_has_morecxx . . $ oval_message_iterator_has_more(b31325b2695bb32b).(old_messages)) { |
| 108 | struct oval_messagecxx . . $ oval_message# *old_message = oval_message_iterator_nextcxx . . $ oval_message_iterator_next(cbc1fe322dec6ca1).(old_messages); |
| 109 | struct oval_messagecxx . . $ oval_message# *new_message = oval_message_clonecxx . . $ oval_message_clone(4cb544f7206d6d3d).(old_message); |
| 110 | oval_result_test_add_messagecxx . . $ oval_result_test_add_message(fa262aaf05b1ed79).(new_test, new_message); |
| 111 | } |
| 112 | oval_message_iterator_freecxx . . $ oval_message_iterator_free(4473d1ac42e808b3).(old_messages); |
| 113 | |
| 114 | oval_result_test_set_instancecxx . . $ oval_result_test_set_instance(fb3068d9953bab86).(new_test, oval_result_test_get_instancecxx . . $ oval_result_test_get_instance(a648399b15cec842).(old_test)); |
| 115 | oval_result_test_set_resultcxx . . $ oval_result_test_set_result(912ee9d5a821ac83).(new_test, old_test->resultcxx . . $ oval_result_test#result.); |
| 116 | |
| 117 | return new_test; |
| 118 | } |
| 119 | |
| 120 | struct oval_result_testcxx . . $ oval_result_test# *make_result_test_from_oval_testcxx . . $ make_result_test_from_oval_test(5934dc8ae7e49345).(struct oval_result_systemcxx . . $ oval_result_system# *sys, struct oval_testcxx . . $ oval_test# *oval_test, int variable_instance) { |
| 121 | char *test_id = oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(oval_test); |
| 122 | struct oval_result_testcxx . . $ oval_result_test# *test = oval_result_test_newcxx . . $ oval_result_test_new(17a46a2b354fb6eb).(sys, test_id); |
| 123 | oval_result_test_set_instancecxx . . $ oval_result_test_set_instance(fb3068d9953bab86).(test, variable_instance); |
| 124 | return test; |
| 125 | } |
| 126 | |
| 127 | void oval_result_test_freecxx . . $ oval_result_test_free(3cafb9f5e9f38405).(struct oval_result_testcxx . . $ oval_result_test# *test) |
| 128 | { |
| 129 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(test); |
| 130 | |
| 131 | oval_collection_free_itemscxx . . $ oval_collection_free_items(637ec69504f927f1).(test->messagescxx . . $ oval_result_test#messages., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_message_freecxx . . $ oval_message_free(d6c5b9e19e2907b1).); |
| 132 | oval_collection_free_itemscxx . . $ oval_collection_free_items(637ec69504f927f1).(test->itemscxx . . $ oval_result_test#items., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_result_item_freecxx . . $ oval_result_item_free(71e2752eaf01fd79).); |
| 133 | oval_collection_free_itemscxx . . $ oval_collection_free_items(637ec69504f927f1).(test->bindingscxx . . $ oval_result_test#bindings., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_variable_binding_freecxx . . $ oval_variable_binding_free(1929543c1fab5c81).); |
| 134 | |
| 135 | test->systemcxx . . $ oval_result_test#system. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 136 | test->testcxx . . $ oval_result_test#test. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 137 | test->messagescxx . . $ oval_result_test#messages. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 138 | test->resultcxx . . $ oval_result_test#result. = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 139 | test->itemscxx . . $ oval_result_test#items. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 140 | test->bindingscxx . . $ oval_result_test#bindings. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 141 | test->instancecxx . . $ oval_result_test#instance. = 1; |
| 142 | freecxx . . $ free(5d22bdacc48458e8).(test); |
| 143 | } |
| 144 | |
| 145 | struct oval_result_systemcxx . . $ oval_result_system# *oval_result_test_get_systemcxx . . $ oval_result_test_get_system(5fd1e535b43d28cd).(struct oval_result_testcxx . . $ oval_result_test# *rtest) |
| 146 | { |
| 147 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 148 | |
| 149 | return rtest->systemcxx . . $ oval_result_test#system.; |
| 150 | } |
| 151 | |
| 152 | struct oval_testcxx . . $ oval_test# *oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(struct oval_result_testcxx . . $ oval_result_test# *rtest) |
| 153 | { |
| 154 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 155 | |
| 156 | return ((struct oval_result_testcxx . . $ oval_result_test# *)rtest)->testcxx . . $ oval_result_test#test.; |
| 157 | } |
| 158 | |
| 159 | int ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(struct oresultscxx . . $ oresults# *ores, oval_result_tcxx . . $ oval_result_t# res) |
| 160 | { |
| 161 | switch (res) { |
| 162 | case OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.: |
| 163 | ores->true_cntcxx . . $ oresults#true_cnt.++; |
| 164 | break; |
| 165 | case OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.: |
| 166 | ores->false_cntcxx . . $ oresults#false_cnt.++; |
| 167 | break; |
| 168 | case OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.: |
| 169 | ores->unknown_cntcxx . . $ oresults#unknown_cnt.++; |
| 170 | break; |
| 171 | case OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.: |
| 172 | ores->error_cntcxx . . $ oresults#error_cnt.++; |
| 173 | break; |
| 174 | case OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.: |
| 175 | ores->noteval_cntcxx . . $ oresults#noteval_cnt.++; |
| 176 | break; |
| 177 | case OVAL_RESULT_NOT_APPLICABLEcxx . . $ OVAL_RESULT_NOT_APPLICABLE.: |
| 178 | ores->notappl_cntcxx . . $ oresults#notappl_cnt.++; |
| 179 | break; |
| 180 | default: |
| 181 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Invalid oval result type: %d.", res); |
| 182 | return 1; |
| 183 | } |
| 184 | |
| 185 | return 0; |
| 186 | } |
| 187 | |
| 188 | void ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(struct oresultscxx . . $ oresults# *ores) |
| 189 | { |
| 190 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(ores, 0, sizeof (*ores)); |
| 191 | } |
| 192 | |
| 193 | oval_result_tcxx . . $ oval_result_t# ores_get_result_bychkcxx . . $ ores_get_result_bychk(7e1e77bf9117db0c).(struct oresultscxx . . $ oresults# *ores, oval_check_tcxx . . $ oval_check_t# check) |
| 194 | { |
| 195 | oval_result_tcxx . . $ oval_result_t# result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 196 | |
| 197 | if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && |
| 198 | ores->false_cntcxx . . $ oresults#false_cnt. == 0 && |
| 199 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && |
| 200 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && |
| 201 | ores->notappl_cntcxx . . $ oresults#notappl_cnt. == 0 && |
| 202 | ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) |
| 203 | return OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 204 | |
| 205 | if (ores->notappl_cntcxx . . $ oresults#notappl_cnt. > 0 && |
| 206 | ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0 && |
| 207 | ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->true_cntcxx . . $ oresults#true_cnt. == 0) |
| 208 | return OVAL_RESULT_NOT_APPLICABLEcxx . . $ OVAL_RESULT_NOT_APPLICABLE.; |
| 209 | |
| 210 | switch (check) { |
| 211 | case OVAL_CHECK_ALLcxx . . $ OVAL_CHECK_ALL.: |
| 212 | if (ores->true_cntcxx . . $ oresults#true_cnt. > 0 && |
| 213 | ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 214 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 215 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. > 0) { |
| 216 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 217 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 218 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 219 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 220 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 221 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 222 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 223 | } |
| 224 | break; |
| 225 | case OVAL_CHECK_AT_LEAST_ONEcxx . . $ OVAL_CHECK_AT_LEAST_ONE.: |
| 226 | if (ores->true_cntcxx . . $ oresults#true_cnt. > 0) { |
| 227 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 228 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. > 0 && |
| 229 | ores->true_cntcxx . . $ oresults#true_cnt. == 0 && |
| 230 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 231 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 232 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 233 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 234 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 235 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 236 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 237 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 238 | } |
| 239 | break; |
| 240 | case OVAL_CHECK_NONE_EXISTcxx . . $ OVAL_CHECK_NONE_EXIST.: |
| 241 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("The 'none exist' CheckEnumeration value has been deprecated. " |
| 242 | "Converted to check='none satisfy'."); |
| 243 | /* FALLTHROUGH */ |
| 244 | case OVAL_CHECK_NONE_SATISFYcxx . . $ OVAL_CHECK_NONE_SATISFY.: |
| 245 | if (ores->true_cntcxx . . $ oresults#true_cnt. > 0) { |
| 246 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 247 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 248 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 249 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 250 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 251 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 252 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 253 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. > 0 && |
| 254 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && |
| 255 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0 && ores->true_cntcxx . . $ oresults#true_cnt. == 0) { |
| 256 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 257 | } |
| 258 | break; |
| 259 | case OVAL_CHECK_ONLY_ONEcxx . . $ OVAL_CHECK_ONLY_ONE.: |
| 260 | if (ores->true_cntcxx . . $ oresults#true_cnt. == 1 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 261 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 262 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. > 1) { |
| 263 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 264 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. < 2 && ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 265 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 266 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. < 2 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 267 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 268 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. < 2 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 269 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 270 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. != 1 && ores->false_cntcxx . . $ oresults#false_cnt. > 0) { |
| 271 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 272 | } |
| 273 | break; |
| 274 | default: |
| 275 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Invalid check value: %d.", check); |
| 276 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 277 | } |
| 278 | |
| 279 | return result; |
| 280 | } |
| 281 | |
| 282 | oval_result_tcxx . . $ oval_result_t# ores_get_result_byoprcxx . . $ ores_get_result_byopr(81735a73c930a9ac).(struct oresultscxx . . $ oresults# *ores, oval_operator_tcxx . . $ oval_operator_t# op) |
| 283 | { |
| 284 | oval_result_tcxx . . $ oval_result_t# result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 285 | |
| 286 | if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && |
| 287 | ores->false_cntcxx . . $ oresults#false_cnt. == 0 && |
| 288 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && |
| 289 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && |
| 290 | ores->notappl_cntcxx . . $ oresults#notappl_cnt. == 0 && |
| 291 | ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) |
| 292 | return OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 293 | |
| 294 | if (ores->notappl_cntcxx . . $ oresults#notappl_cnt. > 0 && |
| 295 | ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0 && |
| 296 | ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->true_cntcxx . . $ oresults#true_cnt. == 0) |
| 297 | return OVAL_RESULT_NOT_APPLICABLEcxx . . $ OVAL_RESULT_NOT_APPLICABLE.; |
| 298 | |
| 299 | switch (op) { |
| 300 | case OVAL_OPERATOR_ANDcxx . . $ OVAL_OPERATOR_AND.: |
| 301 | if (ores->true_cntcxx . . $ oresults#true_cnt. > 0 && |
| 302 | ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 303 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 304 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. > 0) { |
| 305 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 306 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 307 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 308 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 309 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 310 | } else if (ores->false_cntcxx . . $ oresults#false_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 311 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 312 | } |
| 313 | break; |
| 314 | case OVAL_OPERATOR_ONEcxx . . $ OVAL_OPERATOR_ONE.: |
| 315 | if (ores->true_cntcxx . . $ oresults#true_cnt. == 1 && |
| 316 | ores->false_cntcxx . . $ oresults#false_cnt. >= 0 && |
| 317 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0 && ores->notappl_cntcxx . . $ oresults#notappl_cnt. >= 0) { |
| 318 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 319 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. >= 2 && |
| 320 | ores->false_cntcxx . . $ oresults#false_cnt. >= 0 && |
| 321 | ores->error_cntcxx . . $ oresults#error_cnt. >= 0 && |
| 322 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. >= 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. >= 0 && ores->notappl_cntcxx . . $ oresults#notappl_cnt. >= 0) { |
| 323 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 324 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && |
| 325 | ores->false_cntcxx . . $ oresults#false_cnt. >= 0 && |
| 326 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && |
| 327 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0 && ores->notappl_cntcxx . . $ oresults#notappl_cnt. >= 0) { |
| 328 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 329 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. < 2 && |
| 330 | ores->false_cntcxx . . $ oresults#false_cnt. >= 0 && |
| 331 | ores->error_cntcxx . . $ oresults#error_cnt. > 0 && |
| 332 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. >= 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. >= 0 && ores->notappl_cntcxx . . $ oresults#notappl_cnt. >= 0) { |
| 333 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 334 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. < 2 && |
| 335 | ores->false_cntcxx . . $ oresults#false_cnt. >= 0 && |
| 336 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && |
| 337 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. >= 1 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. >= 0 && ores->notappl_cntcxx . . $ oresults#notappl_cnt. >= 0) { |
| 338 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 339 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. < 2 && |
| 340 | ores->false_cntcxx . . $ oresults#false_cnt. >= 0 && |
| 341 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && |
| 342 | ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0 && ores->notappl_cntcxx . . $ oresults#notappl_cnt. >= 0) { |
| 343 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 344 | } |
| 345 | break; |
| 346 | case OVAL_OPERATOR_ORcxx . . $ OVAL_OPERATOR_OR.: |
| 347 | if (ores->true_cntcxx . . $ oresults#true_cnt. > 0) { |
| 348 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 349 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && |
| 350 | ores->false_cntcxx . . $ oresults#false_cnt. > 0 && |
| 351 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 352 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 353 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 354 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 355 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 356 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 357 | } else if (ores->true_cntcxx . . $ oresults#true_cnt. == 0 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 358 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 359 | } |
| 360 | break; |
| 361 | case OVAL_OPERATOR_XORcxx . . $ OVAL_OPERATOR_XOR.: |
| 362 | if ((ores->true_cntcxx . . $ oresults#true_cnt. % 2) == 1 && ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 363 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 364 | } else if ((ores->true_cntcxx . . $ oresults#true_cnt. % 2) == 0 && |
| 365 | ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. == 0) { |
| 366 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 367 | } else if (ores->error_cntcxx . . $ oresults#error_cnt. > 0) { |
| 368 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 369 | } else if (ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. > 0) { |
| 370 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 371 | } else if (ores->error_cntcxx . . $ oresults#error_cnt. == 0 && ores->unknown_cntcxx . . $ oresults#unknown_cnt. == 0 && ores->noteval_cntcxx . . $ oresults#noteval_cnt. > 0) { |
| 372 | result = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.; |
| 373 | } |
| 374 | break; |
| 375 | default: |
| 376 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Invalid operator value: %d.", op); |
| 377 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 378 | break; |
| 379 | } |
| 380 | |
| 381 | return result; |
| 382 | } |
| 383 | |
| 384 | static inline oval_result_tcxx . . $ oval_result_t# _evaluate_sysent_with_variablecxx . . $ _evaluate_sysent_with_variable(5fbaadc51b808977).(struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model, struct oval_variablecxx . . $ oval_variable# *state_entity_var, const char *sys_data, oval_operation_tcxx . . $ oval_operation_t# state_entity_operation, oval_check_tcxx . . $ oval_check_t# var_check) |
| 385 | { |
| 386 | oval_syschar_collection_flag_tcxx . . $ oval_syschar_collection_flag_t# flag; |
| 387 | oval_result_tcxx . . $ oval_result_t# ent_val_res; |
| 388 | |
| 389 | if (0 != oval_syschar_model_compute_variablecxx . . $ oval_syschar_model_compute_variable(64fb93a449c1c5bc).(syschar_model, state_entity_var)) { |
| 390 | return -1; |
| 391 | } |
| 392 | |
| 393 | flag = oval_variable_get_collection_flagcxx . . $ oval_variable_get_collection_flag(e1154c96d0101da8).(state_entity_var); |
| 394 | switch (flag) { |
| 395 | case SYSCHAR_FLAG_COMPLETEcxx . . $ SYSCHAR_FLAG_COMPLETE.: |
| 396 | case SYSCHAR_FLAG_INCOMPLETEcxx . . $ SYSCHAR_FLAG_INCOMPLETE.:{ |
| 397 | struct oresultscxx . . $ oresults# var_ores; |
| 398 | struct oval_value_iteratorcxx . . $ oval_value_iterator# *val_itr; |
| 399 | |
| 400 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&var_ores); |
| 401 | |
| 402 | val_itr = oval_variable_get_valuescxx . . $ oval_variable_get_values(325344158909f348).(state_entity_var); |
| 403 | while (oval_value_iterator_has_morecxx . . $ oval_value_iterator_has_more(753adc45e63e3dec).(val_itr)) { |
| 404 | struct oval_valuecxx . . $ oval_value# *var_val; |
| 405 | char *state_entity_val_text = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 406 | oval_result_tcxx . . $ oval_result_t# var_val_res; |
| 407 | |
| 408 | var_val = oval_value_iterator_nextcxx . . $ oval_value_iterator_next(c6f435863c40c2c6).(val_itr); |
| 409 | state_entity_val_text = oval_value_get_textcxx . . $ oval_value_get_text(cab4e37bbd1656d5).(var_val); |
| 410 | if (state_entity_val_text == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 411 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Found NULL variable value text."); |
| 412 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&var_ores, OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.); |
| 413 | break; |
| 414 | } |
| 415 | oval_datatype_tcxx . . $ oval_datatype_t# state_entity_val_datatype = oval_value_get_datatypecxx . . $ oval_value_get_datatype(9f2201a27f3b3b4).(var_val); |
| 416 | |
| 417 | var_val_res = oval_str_cmp_strcxx . . $ oval_str_cmp_str(97cba3a0fb0a0268).(state_entity_val_text, state_entity_val_datatype, sys_data, state_entity_operation); |
| 418 | if (var_val_res == OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.) { |
| 419 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Can't compare variable '%s' value = '%s' with collected item entity = '%s'", |
| 420 | oval_variable_get_id(state_entity_var), state_entity_val_text, sys_data); |
| 421 | } |
| 422 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&var_ores, var_val_res); |
| 423 | } |
| 424 | oval_value_iterator_freecxx . . $ oval_value_iterator_free(1b9ed96dce1b7286).(val_itr); |
| 425 | |
| 426 | ent_val_res = ores_get_result_bychkcxx . . $ ores_get_result_bychk(7e1e77bf9117db0c).(&var_ores, var_check); |
| 427 | } break; |
| 428 | case SYSCHAR_FLAG_ERRORcxx . . $ SYSCHAR_FLAG_ERROR.: |
| 429 | case SYSCHAR_FLAG_DOES_NOT_EXISTcxx . . $ SYSCHAR_FLAG_DOES_NOT_EXIST.: |
| 430 | case SYSCHAR_FLAG_NOT_COLLECTEDcxx . . $ SYSCHAR_FLAG_NOT_COLLECTED.: |
| 431 | case SYSCHAR_FLAG_NOT_APPLICABLEcxx . . $ SYSCHAR_FLAG_NOT_APPLICABLE.: |
| 432 | ent_val_res = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 433 | break; |
| 434 | default: |
| 435 | ent_val_res = -1; |
| 436 | } |
| 437 | |
| 438 | return ent_val_res; |
| 439 | } |
| 440 | |
| 441 | struct record_field_instancecxx . . $ record_field_instance# { |
| 442 | char *namecxx . . $ record_field_instance#name.; |
| 443 | char *valuecxx . . $ record_field_instance#value.; |
| 444 | oval_datatype_tcxx . . $ oval_datatype_t# data_typecxx . . $ record_field_instance#data_type.; |
| 445 | oval_check_tcxx . . $ oval_check_t# ent_checkcxx . . $ record_field_instance#ent_check.; |
| 446 | oval_operation_tcxx . . $ oval_operation_t# operationcxx . . $ record_field_instance#operation.; |
| 447 | struct oval_variablecxx . . $ oval_variable# *varcxx . . $ record_field_instance#var.; |
| 448 | oval_check_tcxx . . $ oval_check_t# var_checkcxx . . $ record_field_instance#var_check.; |
| 449 | }; |
| 450 | |
| 451 | static struct record_field_instancecxx . . $ record_field_instance# _oval_record_field_iterator_next_instancecxx . . $ _oval_record_field_iterator_next_instance(1ef343ca40fdca65).(struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *iterator) |
| 452 | { |
| 453 | struct record_field_instancecxx . . $ record_field_instance# instance; |
| 454 | struct oval_record_fieldcxx . . $ oval_record_field# *rf = oval_record_field_iterator_nextcxx . . $ oval_record_field_iterator_next(7c2c0ee515333432).(iterator); |
| 455 | instance.namecxx . . $ record_field_instance#name. = oval_record_field_get_namecxx . . $ oval_record_field_get_name(f090a65955c953b6).(rf); |
| 456 | instance.valuecxx . . $ record_field_instance#value. = oval_record_field_get_valuecxx . . $ oval_record_field_get_value(f090a65955c953b6).(rf); |
| 457 | instance.data_typecxx . . $ record_field_instance#data_type. = oval_record_field_get_datatypecxx . . $ oval_record_field_get_datatype(5e8d642923d2495b).(rf); |
| 458 | if (oval_record_field_get_typecxx . . $ oval_record_field_get_type(ecb30557f2d1d66b).(rf) == OVAL_RECORD_FIELD_STATEcxx . . $ OVAL_RECORD_FIELD_STATE.) { |
| 459 | instance.ent_checkcxx . . $ record_field_instance#ent_check. = oval_record_field_get_ent_checkcxx . . $ oval_record_field_get_ent_check(e2c47bbf8284f3bf).(rf); |
| 460 | instance.operationcxx . . $ record_field_instance#operation. = oval_record_field_get_operationcxx . . $ oval_record_field_get_operation(caaa327258e6d219).(rf); |
| 461 | instance.varcxx . . $ record_field_instance#var. = oval_record_field_get_variablecxx . . $ oval_record_field_get_variable(dfe0208103c09cd0).(rf); |
| 462 | instance.var_checkcxx . . $ record_field_instance#var_check. = oval_record_field_get_var_checkcxx . . $ oval_record_field_get_var_check(e2c47bbf8284f3bf).(rf); |
| 463 | } |
| 464 | return instance; |
| 465 | } |
| 466 | |
| 467 | static oval_result_tcxx . . $ oval_result_t# _evaluate_sysent_recordcxx . . $ _evaluate_sysent_record(c95c551a12589115).(struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model, struct oval_state_contentcxx . . $ oval_state_content# *state_content, struct oval_sysentcxx . . $ oval_sysent# *item_entity) |
| 468 | { |
| 469 | struct oresultscxx . . $ oresults# record_ores; |
| 470 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&record_ores); |
| 471 | /* During analysis of a system characteristics item, each record field is |
| 472 | * analyzed and then the overall result for elements of the record type is |
| 473 | * computed by logically ANDing the results for each field and applying |
| 474 | * the entity_check attribute. |
| 475 | */ |
| 476 | struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *state_it = oval_state_content_get_record_fieldscxx . . $ oval_state_content_get_record_fields(80ae0df7f9ce32f5).(state_content); |
| 477 | while (oval_record_field_iterator_has_morecxx . . $ oval_record_field_iterator_has_more(f257abe5c2e43c5d).(state_it)) { |
| 478 | struct record_field_instancecxx . . $ record_field_instance# state_rf = _oval_record_field_iterator_next_instancecxx . . $ _oval_record_field_iterator_next_instance(1ef343ca40fdca65).(state_it); |
| 479 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! field_found = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 480 | struct oresultscxx . . $ oresults# field_ores; |
| 481 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&field_ores); |
| 482 | struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *item_it = oval_sysent_get_record_fieldscxx . . $ oval_sysent_get_record_fields(f7c5d78b86516de6).(item_entity); |
| 483 | while (oval_record_field_iterator_has_morecxx . . $ oval_record_field_iterator_has_more(f257abe5c2e43c5d).(item_it)) { |
| 484 | struct record_field_instancecxx . . $ record_field_instance# item_rf = _oval_record_field_iterator_next_instancecxx . . $ _oval_record_field_iterator_next_instance(1ef343ca40fdca65).(item_it); |
| 485 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(state_rf.namecxx . . $ record_field_instance#name., item_rf.namecxx . . $ record_field_instance#name.) == 0) { |
| 486 | field_found = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 487 | oval_result_tcxx . . $ oval_result_t# fields_comparison_result; |
| 488 | if (state_rf.varcxx . . $ record_field_instance#var. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 489 | fields_comparison_result = _evaluate_sysent_with_variablecxx . . $ _evaluate_sysent_with_variable(5fbaadc51b808977).(syschar_model, state_rf.varcxx . . $ record_field_instance#var., item_rf.valuecxx . . $ record_field_instance#value., state_rf.operationcxx . . $ record_field_instance#operation., state_rf.var_checkcxx . . $ record_field_instance#var_check.); |
| 490 | } else { |
| 491 | fields_comparison_result = oval_str_cmp_strcxx . . $ oval_str_cmp_str(97cba3a0fb0a0268).(state_rf.valuecxx . . $ record_field_instance#value., state_rf.data_typecxx . . $ record_field_instance#data_type., item_rf.valuecxx . . $ record_field_instance#value., state_rf.operationcxx . . $ record_field_instance#operation.); |
| 492 | } |
| 493 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&field_ores, fields_comparison_result); |
| 494 | } |
| 495 | } |
| 496 | oval_record_field_iterator_freecxx . . $ oval_record_field_iterator_free(6968805da7579f07).(item_it); |
| 497 | /* When analyzing system characteristics an error should be reported |
| 498 | * for the result of a field that is present in the OVAL State, but |
| 499 | * not found in the system characteristics item. |
| 500 | */ |
| 501 | if (!field_found) { |
| 502 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&record_ores, OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.); |
| 503 | } else { |
| 504 | oval_result_tcxx . . $ oval_result_t# field_result = ores_get_result_bychkcxx . . $ ores_get_result_bychk(7e1e77bf9117db0c).(&field_ores, state_rf.ent_checkcxx . . $ record_field_instance#ent_check.); |
| 505 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&record_ores, field_result); |
| 506 | } |
| 507 | } |
| 508 | oval_record_field_iterator_freecxx . . $ oval_record_field_iterator_free(6968805da7579f07).(state_it); |
| 509 | return ores_get_result_byoprcxx . . $ ores_get_result_byopr(81735a73c930a9ac).(&record_ores, OVAL_OPERATOR_ANDcxx . . $ OVAL_OPERATOR_AND.); |
| 510 | } |
| 511 | |
| 512 | static inline oval_result_tcxx . . $ oval_result_t# _evaluate_sysentcxx . . $ _evaluate_sysent(18ef3a5069462f9f).(struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model, struct oval_sysentcxx . . $ oval_sysent# *item_entity, struct oval_entitycxx . . $ oval_entity# *state_entity, oval_operation_tcxx . . $ oval_operation_t# state_entity_operation, struct oval_state_contentcxx . . $ oval_state_content# *content) |
| 513 | { |
| 514 | if (oval_sysent_get_statuscxx . . $ oval_sysent_get_status(bbe986facd39a980).(item_entity) == SYSCHAR_STATUS_DOES_NOT_EXISTcxx . . $ SYSCHAR_STATUS_DOES_NOT_EXIST.) { |
| 515 | return OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 516 | } else if (oval_entity_get_varref_typecxx . . $ oval_entity_get_varref_type(ad657afef3bd7ab6).(state_entity) == OVAL_ENTITY_VARREF_ATTRIBUTEcxx . . $ OVAL_ENTITY_VARREF_ATTRIBUTE.) { |
| 517 | struct oval_variablecxx . . $ oval_variable# *state_entity_var; |
| 518 | if ((state_entity_var = oval_entity_get_variablecxx . . $ oval_entity_get_variable(fe3169ea470c913).(state_entity)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 519 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL variable"); |
| 520 | return -1; |
| 521 | } |
| 522 | const char *sys_data = oval_sysent_get_valuecxx . . $ oval_sysent_get_value(cdd7c218673d284b).(item_entity); |
| 523 | oval_check_tcxx . . $ oval_check_t# var_check = oval_state_content_get_var_checkcxx . . $ oval_state_content_get_var_check(b164d4787670ef67).(content); |
| 524 | |
| 525 | return _evaluate_sysent_with_variablecxx . . $ _evaluate_sysent_with_variable(5fbaadc51b808977).(syschar_model, |
| 526 | state_entity_var, sys_data, |
| 527 | state_entity_operation, var_check); |
| 528 | } else { |
| 529 | struct oval_valuecxx . . $ oval_value# *state_entity_val; |
| 530 | char *state_entity_val_text; |
| 531 | oval_datatype_tcxx . . $ oval_datatype_t# state_entity_val_datatype; |
| 532 | |
| 533 | oval_datatype_tcxx . . $ oval_datatype_t# state_entity_type = oval_entity_get_datatypecxx . . $ oval_entity_get_datatype(f8b1ce42a33ef434).(state_entity); |
| 534 | if (state_entity_type == OVAL_DATATYPE_RECORDcxx . . $ OVAL_DATATYPE_RECORD.) { |
| 535 | if (state_entity_operation != OVAL_OPERATION_EQUALScxx . . $ OVAL_OPERATION_EQUALS.) { |
| 536 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("The only allowed operation for comparing record types is 'equals'."); |
| 537 | return OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 538 | } |
| 539 | return _evaluate_sysent_recordcxx . . $ _evaluate_sysent_record(c95c551a12589115).(syschar_model, content, item_entity); |
| 540 | } else { |
| 541 | if ((state_entity_val = oval_entity_get_valuecxx . . $ oval_entity_get_value(eeaa91aa0aedface).(state_entity)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 542 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL entity value"); |
| 543 | return -1; |
| 544 | } |
| 545 | if ((state_entity_val_text = oval_value_get_textcxx . . $ oval_value_get_text(cab4e37bbd1656d5).(state_entity_val)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 546 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL entity value text"); |
| 547 | return -1; |
| 548 | } |
| 549 | state_entity_val_datatype = oval_value_get_datatypecxx . . $ oval_value_get_datatype(9f2201a27f3b3b4).(state_entity_val); |
| 550 | |
| 551 | const char *sys_data = oval_sysent_get_valuecxx . . $ oval_sysent_get_value(cdd7c218673d284b).(item_entity); |
| 552 | return oval_str_cmp_strcxx . . $ oval_str_cmp_str(97cba3a0fb0a0268).(state_entity_val_text, state_entity_val_datatype, sys_data, state_entity_operation); |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | static oval_result_tcxx . . $ oval_result_t# eval_itemcxx . . $ eval_item(efcba709cd6e08c8).(struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model, struct oval_sysitemcxx . . $ oval_sysitem# *cur_sysitem, struct oval_statecxx . . $ oval_state# *state) |
| 558 | { |
| 559 | struct oval_state_content_iteratorcxx . . $ oval_state_content_iterator# *state_contents_itr; |
| 560 | struct oresultscxx . . $ oresults# ste_ores; |
| 561 | oval_operator_tcxx . . $ oval_operator_t# operator; |
| 562 | oval_result_tcxx . . $ oval_result_t# result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 563 | |
| 564 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&ste_ores); |
| 565 | |
| 566 | state_contents_itr = oval_state_get_contentscxx . . $ oval_state_get_contents(e38d902cdc6b5c2d).(state); |
| 567 | while (oval_state_content_iterator_has_morecxx . . $ oval_state_content_iterator_has_more(344811bbb4806d19).(state_contents_itr)) { |
| 568 | struct oval_state_contentcxx . . $ oval_state_content# *content; |
| 569 | struct oval_entitycxx . . $ oval_entity# *state_entity; |
| 570 | char *state_entity_name; |
| 571 | oval_operation_tcxx . . $ oval_operation_t# state_entity_operation; |
| 572 | oval_check_tcxx . . $ oval_check_t# entity_check; |
| 573 | oval_existence_tcxx . . $ oval_existence_t# check_existence; |
| 574 | oval_result_tcxx . . $ oval_result_t# ste_ent_res; |
| 575 | struct oval_sysent_iteratorcxx . . $ oval_sysent_iterator# *item_entities_itr; |
| 576 | struct oresultscxx . . $ oresults# ent_ores; |
| 577 | struct oval_status_countercxx . . $ oval_status_counter# counter; |
| 578 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! found_matching_item; |
| 579 | |
| 580 | if ((content = oval_state_content_iterator_nextcxx . . $ oval_state_content_iterator_next(43c3368aa9ccef0c).(state_contents_itr)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 581 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL state content"); |
| 582 | goto fail; |
| 583 | } |
| 584 | if ((state_entity = oval_state_content_get_entitycxx . . $ oval_state_content_get_entity(20470541c08ba23c).(content)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 585 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL entity"); |
| 586 | goto fail; |
| 587 | } |
| 588 | if ((state_entity_name = oval_entity_get_namecxx . . $ oval_entity_get_name(29acad8590bc6a3f).(state_entity)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 589 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL entity name"); |
| 590 | goto fail; |
| 591 | } |
| 592 | |
| 593 | if (oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(state_entity_name, "line") && |
| 594 | oval_state_get_subtypecxx . . $ oval_state_get_subtype(41aca620b69caf1a).(state) == (oval_subtype_tcxx . . $ oval_subtype_t#) OVAL_INDEPENDENT_TEXT_FILE_CONTENTcxx . . $ OVAL_INDEPENDENT_TEXT_FILE_CONTENT.) { |
| 595 | /* Hack: textfilecontent_state/line shall be compared against textfilecontent_item/text. |
| 596 | * |
| 597 | * textfilecontent_test and textfilecontent54_test share the same syschar |
| 598 | * (textfilecontent_item). In OVAL 5.3 and below this syschar did not hold any usable |
| 599 | * information ('text' ent). In OVAL 5.4 textfilecontent_test was deprecated. But the |
| 600 | * 'text' ent has been added to textfilecontent_item, making it potentially usable. */ |
| 601 | oval_schema_version_tcxx . . $ oval_schema_version_t# over = oval_state_get_platform_schema_versioncxx . . $ oval_state_get_platform_schema_version(4df827b57b1119ed).(state); |
| 602 | if (oval_schema_version_cmpcxx . . $ oval_schema_version_cmp(b4d0c2bfb97f274f).(over, OVAL_SCHEMA_VERSIONcxx . . $ `src/OVAL/public/oval_schema_version.h:39:9`!(5.4)) >= 0) { |
| 603 | /* The OVAL-5.3 does not have textfilecontent_item/text */ |
| 604 | state_entity_name = "text"; |
| 605 | } |
| 606 | } |
| 607 | |
| 608 | entity_check = oval_state_content_get_ent_checkcxx . . $ oval_state_content_get_ent_check(b164d4787670ef67).(content); |
| 609 | check_existence = oval_state_content_get_check_existencecxx . . $ oval_state_content_get_check_existence(443dcc0a44cf91f3).(content); |
| 610 | state_entity_operation = oval_entity_get_operationcxx . . $ oval_entity_get_operation(7e30f6bdd49dced).(state_entity); |
| 611 | |
| 612 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&ent_ores); |
| 613 | found_matching_item = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 614 | oval_status_counter_clearcxx . . $ oval_status_counter_clear(ecba5bc42d52ae9e).(&counter); |
| 615 | |
| 616 | item_entities_itr = oval_sysitem_get_sysentscxx . . $ oval_sysitem_get_sysents(bf4f75dc7c1645cb).(cur_sysitem); |
| 617 | while (oval_sysent_iterator_has_morecxx . . $ oval_sysent_iterator_has_more(59acec8e8c3c2bb8).(item_entities_itr)) { |
| 618 | struct oval_sysentcxx . . $ oval_sysent# *item_entity; |
| 619 | oval_result_tcxx . . $ oval_result_t# ent_val_res; |
| 620 | char *item_entity_name; |
| 621 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# item_status; |
| 622 | |
| 623 | item_entity = oval_sysent_iterator_nextcxx . . $ oval_sysent_iterator_next(4140414cfcc52c9e).(item_entities_itr); |
| 624 | if (item_entity == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 625 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL internal error: found NULL sysent"); |
| 626 | oval_sysent_iterator_freecxx . . $ oval_sysent_iterator_free(f5d8b29a351f840a).(item_entities_itr); |
| 627 | goto fail; |
| 628 | } |
| 629 | item_status = oval_sysent_get_statuscxx . . $ oval_sysent_get_status(bbe986facd39a980).(item_entity); |
| 630 | oval_status_counter_add_statuscxx . . $ oval_status_counter_add_status(47819b92859af7e).(&counter, item_status); |
| 631 | |
| 632 | item_entity_name = oval_sysent_get_namecxx . . $ oval_sysent_get_name(cdd7c218673d284b).(item_entity); |
| 633 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(item_entity_name, state_entity_name)) |
| 634 | continue; |
| 635 | |
| 636 | found_matching_item = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 637 | |
| 638 | /* copy mask attribute from state to item */ |
| 639 | if (oval_entity_get_maskcxx . . $ oval_entity_get_mask(ec1837a8906f93c7).(state_entity)) |
| 640 | oval_sysent_set_maskcxx . . $ oval_sysent_set_mask(e216175c9e7b8544).(item_entity,1); |
| 641 | |
| 642 | ent_val_res = _evaluate_sysentcxx . . $ _evaluate_sysent(18ef3a5069462f9f).(syschar_model, item_entity, state_entity, |
| 643 | state_entity_operation, content); |
| 644 | if (ent_val_res == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.) { |
| 645 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Entity '%s'='%s' of item '%s' matches corresponding entity in state '%s'.", |
| 646 | oval_sysent_get_name(item_entity), |
| 647 | oval_sysent_get_value(item_entity), |
| 648 | oval_sysitem_get_id(cur_sysitem), oval_state_get_id(state)); |
| 649 | } |
| 650 | if (ent_val_res == OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.) { |
| 651 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Comparing entity '%s'='%s' of item '%s' to corresponding entity in state '%s' was not successful.", |
| 652 | oval_sysent_get_name(item_entity), |
| 653 | oval_sysent_get_value(item_entity), |
| 654 | oval_sysitem_get_id(cur_sysitem), oval_state_get_id(state)); |
| 655 | } |
| 656 | if (((signed) ent_val_res) == -1) { |
| 657 | oval_sysent_iterator_freecxx . . $ oval_sysent_iterator_free(f5d8b29a351f840a).(item_entities_itr); |
| 658 | goto fail; |
| 659 | } |
| 660 | |
| 661 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&ent_ores, ent_val_res); |
| 662 | } |
| 663 | oval_sysent_iterator_freecxx . . $ oval_sysent_iterator_free(f5d8b29a351f840a).(item_entities_itr); |
| 664 | |
| 665 | if (!found_matching_item) |
| 666 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Entity name '%s' from state (id: '%s') not found in item (id: '%s').", |
| 667 | state_entity_name, oval_state_get_id(state), oval_sysitem_get_id(cur_sysitem)); |
| 668 | |
| 669 | oval_result_tcxx . . $ oval_result_t# cres = oval_status_counter_get_resultcxx . . $ oval_status_counter_get_result(7d350049d44bd0c3).(&counter, check_existence); |
| 670 | /* The entity check results are only relevant when the check existence is satisfied */ |
| 671 | if (cres == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.) { |
| 672 | ste_ent_res = ores_get_result_bychkcxx . . $ ores_get_result_bychk(7e1e77bf9117db0c).(&ent_ores, entity_check); |
| 673 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&ste_ores, ste_ent_res); |
| 674 | } else { |
| 675 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&ste_ores, cres); |
| 676 | } |
| 677 | } |
| 678 | oval_state_content_iterator_freecxx . . $ oval_state_content_iterator_free(526a40962d3af9e1).(state_contents_itr); |
| 679 | |
| 680 | operator = oval_state_get_operatorcxx . . $ oval_state_get_operator(48b1e7ff30d26459).(state); |
| 681 | result = ores_get_result_byoprcxx . . $ ores_get_result_byopr(81735a73c930a9ac).(&ste_ores, operator); |
| 682 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Item '%s' compared to state '%s' with result %s.", |
| 683 | oval_sysitem_get_id(cur_sysitem), oval_state_get_id(state), |
| 684 | oval_result_get_text(result)); |
| 685 | |
| 686 | return result; |
| 687 | |
| 688 | fail: |
| 689 | oval_state_content_iterator_freecxx . . $ oval_state_content_iterator_free(526a40962d3af9e1).(state_contents_itr); |
| 690 | |
| 691 | return OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 692 | } |
| 693 | |
| 694 | #define ITEMMAPcxx . . $ `src/OVAL/results/oval_resultTest.c:694:9`! (struct oval_string_map *)args[2] |
| 695 | #define TESTcxx . . $ `src/OVAL/results/oval_resultTest.c:695:9`! (struct oval_result_test *)args[1] |
| 696 | #define SYSTEMcxx . . $ `src/OVAL/results/oval_resultTest.c:696:9`! (struct oval_result_system *)args[0] |
| 697 | |
| 698 | static void _oval_test_item_consumercxx . . $ _oval_test_item_consumer(3f31a01c2262612e).(struct oval_result_itemcxx . . $ oval_result_item# *item, void **args) { |
| 699 | struct oval_sysitemcxx . . $ oval_sysitem# *oval_sysitem = oval_result_item_get_sysitemcxx . . $ oval_result_item_get_sysitem(259f8984404b0f42).(item); |
| 700 | char *item_id = oval_sysitem_get_idcxx . . $ oval_sysitem_get_id(d34333a20a23cb5d).(oval_sysitem); |
| 701 | struct oval_result_itemcxx . . $ oval_result_item# *mapped_item = oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(ITEMMAPcxx . . $ `src/OVAL/results/oval_resultTest.c:694:9`!, item_id); |
| 702 | if (mapped_item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 703 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(ITEMMAPcxx . . $ `src/OVAL/results/oval_resultTest.c:694:9`!, item_id, item); |
| 704 | oval_result_test_add_itemcxx . . $ oval_result_test_add_item(70d52eaa6ff6c17d).(TESTcxx . . $ `src/OVAL/results/oval_resultTest.c:695:9`!, item); |
| 705 | } else { |
| 706 | oval_result_item_freecxx . . $ oval_result_item_free(71e2752eaf01fd79).(item); |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | static oval_result_tcxx . . $ oval_result_t# eval_check_statecxx . . $ eval_check_state(2c842dd0b861573b).(struct oval_testcxx . . $ oval_test# *test, void **args) |
| 711 | { |
| 712 | struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model; |
| 713 | struct oval_result_item_iteratorcxx . . $ oval_result_item_iterator# *ritems_itr; |
| 714 | struct oresultscxx . . $ oresults# item_ores; |
| 715 | oval_result_tcxx . . $ oval_result_t# result; |
| 716 | oval_check_tcxx . . $ oval_check_t# ste_check; |
| 717 | oval_operator_tcxx . . $ oval_operator_t# ste_opr; |
| 718 | |
| 719 | ste_check = oval_test_get_checkcxx . . $ oval_test_get_check(52b877f2832a591f).(test); |
| 720 | ste_opr = oval_test_get_state_operatorcxx . . $ oval_test_get_state_operator(312b811947068aed).(test); |
| 721 | syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(SYSTEMcxx . . $ `src/OVAL/results/oval_resultTest.c:696:9`!); |
| 722 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&item_ores); |
| 723 | |
| 724 | char *state_names = oval_test_get_state_namescxx . . $ oval_test_get_state_names(6776e4970683fd20).(test); |
| 725 | if (state_names) { |
| 726 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("In test '%s' %s of the collected items must satisfy these states: %s.", |
| 727 | oval_test_get_id(test), oval_check_get_description(ste_check), state_names); |
| 728 | freecxx . . $ free(5d22bdacc48458e8).(state_names); |
| 729 | } |
| 730 | |
| 731 | ritems_itr = oval_result_test_get_itemscxx . . $ oval_result_test_get_items(39eccb4e00b508db).(TESTcxx . . $ `src/OVAL/results/oval_resultTest.c:695:9`!); |
| 732 | while (oval_result_item_iterator_has_morecxx . . $ oval_result_item_iterator_has_more(a237e157d1921aa4).(ritems_itr)) { |
| 733 | struct oval_result_itemcxx . . $ oval_result_item# *ritem; |
| 734 | struct oval_sysitemcxx . . $ oval_sysitem# *item; |
| 735 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# item_status; |
| 736 | struct oresultscxx . . $ oresults# ste_ores; |
| 737 | struct oval_state_iteratorcxx . . $ oval_state_iterator# *ste_itr; |
| 738 | oval_result_tcxx . . $ oval_result_t# item_res; |
| 739 | |
| 740 | ritem = oval_result_item_iterator_nextcxx . . $ oval_result_item_iterator_next(82225cab81b266fe).(ritems_itr); |
| 741 | item = oval_result_item_get_sysitemcxx . . $ oval_result_item_get_sysitem(259f8984404b0f42).(ritem); |
| 742 | |
| 743 | item_status = oval_sysitem_get_statuscxx . . $ oval_sysitem_get_status(8d86bb6c9b97c092).(item); |
| 744 | switch (item_status) { |
| 745 | case SYSCHAR_STATUS_ERRORcxx . . $ SYSCHAR_STATUS_ERROR.: |
| 746 | case SYSCHAR_STATUS_NOT_COLLECTEDcxx . . $ SYSCHAR_STATUS_NOT_COLLECTED.: |
| 747 | item_res = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 748 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&item_ores, item_res); |
| 749 | oval_result_item_set_resultcxx . . $ oval_result_item_set_result(8631a518ec41ba60).(ritem, item_res); |
| 750 | continue; |
| 751 | case SYSCHAR_STATUS_DOES_NOT_EXISTcxx . . $ SYSCHAR_STATUS_DOES_NOT_EXIST.: |
| 752 | item_res = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 753 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&item_ores, item_res); |
| 754 | oval_result_item_set_resultcxx . . $ oval_result_item_set_result(8631a518ec41ba60).(ritem, item_res); |
| 755 | continue; |
| 756 | default: |
| 757 | break; |
| 758 | } |
| 759 | |
| 760 | ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&ste_ores); |
| 761 | |
| 762 | ste_itr = oval_test_get_statescxx . . $ oval_test_get_states(b738fee4834aaaa6).(test); |
| 763 | while (oval_state_iterator_has_morecxx . . $ oval_state_iterator_has_more(bbfacbd9c1bc3d63).(ste_itr)) { |
| 764 | struct oval_statecxx . . $ oval_state# *ste; |
| 765 | oval_result_tcxx . . $ oval_result_t# ste_res; |
| 766 | |
| 767 | ste = oval_state_iterator_nextcxx . . $ oval_state_iterator_next(f0883bc3981b419).(ste_itr); |
| 768 | ste_res = eval_itemcxx . . $ eval_item(efcba709cd6e08c8).(syschar_model, item, ste); |
| 769 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&ste_ores, ste_res); |
| 770 | } |
| 771 | oval_state_iterator_freecxx . . $ oval_state_iterator_free(37c8c23faa65426a).(ste_itr); |
| 772 | |
| 773 | item_res = ores_get_result_byoprcxx . . $ ores_get_result_byopr(81735a73c930a9ac).(&ste_ores, ste_opr); |
| 774 | ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&item_ores, item_res); |
| 775 | oval_result_item_set_resultcxx . . $ oval_result_item_set_result(8631a518ec41ba60).(ritem, item_res); |
| 776 | } |
| 777 | oval_result_item_iterator_freecxx . . $ oval_result_item_iterator_free(cc5d1a6fd9e0d5a0).(ritems_itr); |
| 778 | |
| 779 | result = ores_get_result_bychkcxx . . $ ores_get_result_bychk(7e1e77bf9117db0c).(&item_ores, ste_check); |
| 780 | |
| 781 | return result; |
| 782 | } |
| 783 | |
| 784 | static oval_result_tcxx . . $ oval_result_t# eval_check_existencecxx . . $ eval_check_existence(723cafd624a27766).(oval_existence_tcxx . . $ oval_existence_t# check_existence, int exists_cnt, int error_cnt) |
| 785 | { |
| 786 | oval_result_tcxx . . $ oval_result_t# result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 787 | |
| 788 | switch (check_existence) { |
| 789 | case OVAL_ALL_EXISTcxx . . $ OVAL_ALL_EXIST.: |
| 790 | if (exists_cnt >= 1 && error_cnt == 0) { |
| 791 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 792 | } else if (exists_cnt == 0 && error_cnt == 0) { |
| 793 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 794 | } else if (exists_cnt >= 0 && error_cnt >= 1) { |
| 795 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 796 | } |
| 797 | break; |
| 798 | case OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST.: |
| 799 | if (exists_cnt >= 0 && error_cnt == 0) { |
| 800 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 801 | } else if (exists_cnt >= 1 && error_cnt >= 1) { |
| 802 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 803 | } else if (exists_cnt == 0 && error_cnt >= 1) { |
| 804 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 805 | } |
| 806 | break; |
| 807 | case OVAL_AT_LEAST_ONE_EXISTScxx . . $ OVAL_AT_LEAST_ONE_EXISTS.: |
| 808 | if (exists_cnt >= 1 && error_cnt >= 0) { |
| 809 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 810 | } else if (exists_cnt == 0 && error_cnt == 0) { |
| 811 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 812 | } else if (exists_cnt == 0 && error_cnt >= 1) { |
| 813 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 814 | } |
| 815 | break; |
| 816 | case OVAL_NONE_EXISTcxx . . $ OVAL_NONE_EXIST.: |
| 817 | if (exists_cnt == 0 && error_cnt == 0) { |
| 818 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 819 | } else if (exists_cnt >= 1 && error_cnt == 0) { |
| 820 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 821 | } else if (exists_cnt == 0 && error_cnt >= 1) { |
| 822 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 823 | } |
| 824 | break; |
| 825 | case OVAL_ONLY_ONE_EXISTScxx . . $ OVAL_ONLY_ONE_EXISTS.: |
| 826 | if (exists_cnt == 1 && error_cnt == 0) { |
| 827 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 828 | } else if (exists_cnt >= 2 && error_cnt >= 0) { |
| 829 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 830 | } else if (exists_cnt == 0 && error_cnt == 0) { |
| 831 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 832 | } else if (exists_cnt == 0 && error_cnt >= 1) { |
| 833 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 834 | } else if (exists_cnt == 1 && error_cnt >= 1) { |
| 835 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 836 | } |
| 837 | break; |
| 838 | default: |
| 839 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Invalid check_existence value: %d.", check_existence); |
| 840 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 841 | break; |
| 842 | } |
| 843 | |
| 844 | return result; |
| 845 | } |
| 846 | |
| 847 | static oval_result_tcxx . . $ oval_result_t# |
| 848 | _oval_result_test_evaluate_itemscxx . . $ _oval_result_test_evaluate_items(4efe9b5c81077a3c).(struct oval_testcxx . . $ oval_test# *test, struct oval_syscharcxx . . $ oval_syschar# *syschar_object, void **args) |
| 849 | { |
| 850 | struct oval_sysitem_iteratorcxx . . $ oval_sysitem_iterator# *collected_items_itr; |
| 851 | oval_result_tcxx . . $ oval_result_t# result; |
| 852 | int exists_cnt, error_cnt; |
| 853 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! hasstate; |
| 854 | const char *test_id, *object_id, *flag_text; |
| 855 | oval_check_tcxx . . $ oval_check_t# test_check; |
| 856 | oval_existence_tcxx . . $ oval_existence_t# test_check_existence; |
| 857 | struct oval_state_iteratorcxx . . $ oval_state_iterator# *ste_itr; |
| 858 | oval_syschar_collection_flag_tcxx . . $ oval_syschar_collection_flag_t# flag; |
| 859 | struct oval_objectcxx . . $ oval_object# *object; |
| 860 | |
| 861 | exists_cnt = error_cnt = 0; |
| 862 | test_id = oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(test); |
| 863 | collected_items_itr = oval_syschar_get_sysitemcxx . . $ oval_syschar_get_sysitem(4522ba9011fcd99).(syschar_object); |
| 864 | while (oval_sysitem_iterator_has_morecxx . . $ oval_sysitem_iterator_has_more(199ed6c71fdbb36b).(collected_items_itr)) { |
| 865 | struct oval_sysitemcxx . . $ oval_sysitem# *item; |
| 866 | char *item_id; |
| 867 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# item_status; |
| 868 | struct oval_result_itemcxx . . $ oval_result_item# *ritem; |
| 869 | |
| 870 | item = oval_sysitem_iterator_nextcxx . . $ oval_sysitem_iterator_next(310575caa1da8688).(collected_items_itr); |
| 871 | if (item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 872 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Iterator returned null."); |
| 873 | oval_sysitem_iterator_freecxx . . $ oval_sysitem_iterator_free(bdd00e768e40dec5).(collected_items_itr); |
| 874 | return OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 875 | } |
| 876 | |
| 877 | item_status = oval_sysitem_get_statuscxx . . $ oval_sysitem_get_status(8d86bb6c9b97c092).(item); |
| 878 | if (item_status == SYSCHAR_STATUS_EXISTScxx . . $ SYSCHAR_STATUS_EXISTS.) |
| 879 | exists_cnt++; |
| 880 | if (item_status == SYSCHAR_STATUS_ERRORcxx . . $ SYSCHAR_STATUS_ERROR.) |
| 881 | error_cnt++; |
| 882 | |
| 883 | item_id = oval_sysitem_get_idcxx . . $ oval_sysitem_get_id(d34333a20a23cb5d).(item); |
| 884 | ritem = oval_result_item_newcxx . . $ oval_result_item_new(299bfdc2f1ffac96).(SYSTEMcxx . . $ `src/OVAL/results/oval_resultTest.c:696:9`!, item_id); |
| 885 | oval_result_item_set_resultcxx . . $ oval_result_item_set_result(8631a518ec41ba60).(ritem, OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.); |
| 886 | _oval_test_item_consumercxx . . $ _oval_test_item_consumer(3f31a01c2262612e).(ritem, args); |
| 887 | } |
| 888 | oval_sysitem_iterator_freecxx . . $ oval_sysitem_iterator_free(bdd00e768e40dec5).(collected_items_itr); |
| 889 | |
| 890 | test_check = oval_test_get_checkcxx . . $ oval_test_get_check(52b877f2832a591f).(test); |
| 891 | test_check_existence = oval_test_get_existencecxx . . $ oval_test_get_existence(7e0630d105fa339e).(test); |
| 892 | ste_itr = oval_test_get_statescxx . . $ oval_test_get_states(b738fee4834aaaa6).(test); |
| 893 | hasstate = oval_state_iterator_has_morecxx . . $ oval_state_iterator_has_more(bbfacbd9c1bc3d63).(ste_itr); |
| 894 | oval_state_iterator_freecxx . . $ oval_state_iterator_free(37c8c23faa65426a).(ste_itr); |
| 895 | object = oval_syschar_get_objectcxx . . $ oval_syschar_get_object(b82ea9461ca3ba19).(syschar_object); |
| 896 | object_id = object ? oval_object_get_idcxx . . $ oval_object_get_id(c789946d38fecc83).(object) : "<UNKNOWN>"; |
| 897 | |
| 898 | switch (test_check_existence) { |
| 899 | case OVAL_ALL_EXISTcxx . . $ OVAL_ALL_EXIST.: |
| 900 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' requires that every object defined by '%s' exists on the system.", test_id, object_id); |
| 901 | break; |
| 902 | case OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST.: |
| 903 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' requires that zero or more objects defined by '%s' exist on the system.", test_id, object_id); |
| 904 | break; |
| 905 | case OVAL_AT_LEAST_ONE_EXISTScxx . . $ OVAL_AT_LEAST_ONE_EXISTS.: |
| 906 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' requires that at least one object defined by '%s' exists on the system.", test_id, object_id); |
| 907 | break; |
| 908 | case OVAL_NONE_EXISTcxx . . $ OVAL_NONE_EXIST.: |
| 909 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' requires that none of the objects defined by '%s' exist on the system.", test_id, object_id); |
| 910 | break; |
| 911 | case OVAL_ONLY_ONE_EXISTScxx . . $ OVAL_ONLY_ONE_EXISTS.: |
| 912 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' requires that only one object defined by '%s' exists on the system.", test_id, object_id); |
| 913 | break; |
| 914 | default: |
| 915 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Check_existence parameter of test '%s' is unknown. This may indicate a bug in OpenSCAP.", test_id); |
| 916 | } |
| 917 | |
| 918 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("%d objects defined by '%s' exist on the system.", exists_cnt, object_id); |
| 919 | if (!hasstate) { |
| 920 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' does not contain any state to compare object with.", test_id); |
| 921 | } |
| 922 | flag = oval_syschar_get_flagcxx . . $ oval_syschar_get_flag(faee96ff7b702646).(syschar_object); |
| 923 | flag_text = oval_syschar_collection_flag_get_textcxx . . $ oval_syschar_collection_flag_get_text(5fdf4cba2f095175).(flag); |
| 924 | |
| 925 | switch (flag) { |
| 926 | case SYSCHAR_FLAG_ERRORcxx . . $ SYSCHAR_FLAG_ERROR.: |
| 927 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("An error occurred while collecting items matching object '%s'. (flag=%s)", object_id, flag_text); |
| 928 | if (test_check_existence == OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST. |
| 929 | && !hasstate) { |
| 930 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 931 | } else { |
| 932 | result = OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 933 | } |
| 934 | break; |
| 935 | case SYSCHAR_FLAG_NOT_COLLECTEDcxx . . $ SYSCHAR_FLAG_NOT_COLLECTED.: |
| 936 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("No attempt was made to collect items matching object '%s'. (flag=%s)", object_id, flag_text); |
| 937 | if (test_check_existence == OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST. |
| 938 | && !hasstate) { |
| 939 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 940 | } else { |
| 941 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 942 | } |
| 943 | break; |
| 944 | case SYSCHAR_FLAG_NOT_APPLICABLEcxx . . $ SYSCHAR_FLAG_NOT_APPLICABLE.: |
| 945 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Object '%s' is not applicable to the system. (flag=%s)", object_id, flag_text); |
| 946 | if (test_check_existence == OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST. |
| 947 | && !hasstate) { |
| 948 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 949 | } else { |
| 950 | result = OVAL_RESULT_NOT_APPLICABLEcxx . . $ OVAL_RESULT_NOT_APPLICABLE.; |
| 951 | } |
| 952 | break; |
| 953 | case SYSCHAR_FLAG_DOES_NOT_EXISTcxx . . $ SYSCHAR_FLAG_DOES_NOT_EXIST.: |
| 954 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("No item matching object '%s' was found on the system. (flag=%s)", object_id, flag_text); |
| 955 | if (test_check_existence == OVAL_NONE_EXISTcxx . . $ OVAL_NONE_EXIST. |
| 956 | || test_check_existence == OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST.) { |
| 957 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 958 | } else { |
| 959 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 960 | } |
| 961 | break; |
| 962 | case SYSCHAR_FLAG_COMPLETEcxx . . $ SYSCHAR_FLAG_COMPLETE.: |
| 963 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("All items matching object '%s' were collected. (flag=%s)", object_id, flag_text); |
| 964 | result = eval_check_existencecxx . . $ eval_check_existence(723cafd624a27766).(test_check_existence, exists_cnt, error_cnt); |
| 965 | if (result == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE. |
| 966 | && hasstate) { |
| 967 | result = eval_check_statecxx . . $ eval_check_state(2c842dd0b861573b).(test, args); |
| 968 | } |
| 969 | break; |
| 970 | case SYSCHAR_FLAG_INCOMPLETEcxx . . $ SYSCHAR_FLAG_INCOMPLETE.: |
| 971 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Only some of items matching object '%s' have been collected from the system. It is unknown if other matching items also exist. (flag=%s)", object_id, flag_text); |
| 972 | if (test_check_existence == OVAL_ANY_EXISTcxx . . $ OVAL_ANY_EXIST.) { |
| 973 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 974 | } else if (test_check_existence == OVAL_AT_LEAST_ONE_EXISTScxx . . $ OVAL_AT_LEAST_ONE_EXISTS. |
| 975 | && exists_cnt > 0) { |
| 976 | result = OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.; |
| 977 | } else if (test_check_existence == OVAL_NONE_EXISTcxx . . $ OVAL_NONE_EXIST. |
| 978 | && exists_cnt > 0) { |
| 979 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 980 | } else if (test_check_existence == OVAL_ONLY_ONE_EXISTScxx . . $ OVAL_ONLY_ONE_EXISTS. |
| 981 | && exists_cnt > 1) { |
| 982 | result = OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.; |
| 983 | } else { |
| 984 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 985 | } |
| 986 | |
| 987 | if (result == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE. |
| 988 | && hasstate) { |
| 989 | result = eval_check_statecxx . . $ eval_check_state(2c842dd0b861573b).(test, args); |
| 990 | if (result == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.) { |
| 991 | if (test_check != OVAL_CHECK_AT_LEAST_ONEcxx . . $ OVAL_CHECK_AT_LEAST_ONE.) { |
| 992 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 993 | } |
| 994 | } else if (result != OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.) { |
| 995 | result = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 996 | } |
| 997 | } |
| 998 | break; |
| 999 | default: { |
| 1000 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Item corresponding to object '%s' from test '%s' has an unknown flag. This may indicate a bug in OpenSCAP.", |
| 1001 | object_id, test_id); |
| 1002 | return OVAL_RESULT_ERRORcxx . . $ OVAL_RESULT_ERROR.; |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | return result; |
| 1007 | } |
| 1008 | |
| 1009 | /* this function will gather all the necessary ingredients and call 'evaluate_items' when it finds them */ |
| 1010 | static oval_result_tcxx . . $ oval_result_t# _oval_result_test_resultcxx . . $ _oval_result_test_result(48925fc1b679e66e).(struct oval_result_testcxx . . $ oval_result_test# *rtest, void **args) |
| 1011 | { |
| 1012 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1013 | |
| 1014 | /* is the test already evaluated? */ |
| 1015 | if (rtest->resultcxx . . $ oval_result_test#result. != OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.) { |
| 1016 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Found result from previous evaluation: %d, returning without further processing.", rtest->result); |
| 1017 | return (rtest->resultcxx . . $ oval_result_test#result.); |
| 1018 | } |
| 1019 | |
| 1020 | #if defined(OVAL_PROBES_ENABLEDcxx . . $ `build/config.h:67:9`!) |
| 1021 | /* get syschar of rtest */ |
| 1022 | struct oval_testcxx . . $ oval_test# *test = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(rtest); |
| 1023 | struct oval_objectcxx . . $ oval_object# * object = oval_test_get_objectcxx . . $ oval_test_get_object(7733aadd35446dd9).(test); |
| 1024 | char * object_id = oval_object_get_idcxx . . $ oval_object_get_id(c789946d38fecc83).(object); |
| 1025 | |
| 1026 | struct oval_result_systemcxx . . $ oval_result_system# *sys = oval_result_test_get_systemcxx . . $ oval_result_test_get_system(5fd1e535b43d28cd).(rtest); |
| 1027 | struct oval_results_modelcxx . . $ oval_results_model# *results_model = oval_result_system_get_results_modelcxx . . $ oval_result_system_get_results_model(2b6034f6497777d6).(sys); |
| 1028 | struct oval_probe_sessioncxx . . $ oval_probe_session# *probe_session = oval_results_model_get_probe_sessioncxx . . $ oval_results_model_get_probe_session(1396dcf88ea060a7).(results_model); |
| 1029 | if (probe_session != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1030 | /* probe test */ |
| 1031 | int ret = oval_probe_query_testcxx . . $ oval_probe_query_test(9cb337ebfe9a5d86).(probe_session, test); |
| 1032 | if (ret != 0) { |
| 1033 | return ret; |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(sys); |
| 1038 | |
| 1039 | struct oval_syscharcxx . . $ oval_syschar# * syschar = oval_syschar_model_get_syscharcxx . . $ oval_syschar_model_get_syschar(5e0330551a5ec218).(syschar_model, object_id); |
| 1040 | if (syschar == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1041 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("No syschar for object: %s", object_id); |
| 1042 | return OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 1043 | } |
| 1044 | |
| 1045 | /* evaluate items */ |
| 1046 | oval_result_tcxx . . $ oval_result_t# result = _oval_result_test_evaluate_itemscxx . . $ _oval_result_test_evaluate_items(4efe9b5c81077a3c).(test, syschar, args); |
| 1047 | |
| 1048 | return result; |
| 1049 | #else |
| 1050 | return OVAL_RESULT_UNKNOWN; |
| 1051 | #endif |
| 1052 | } |
| 1053 | |
| 1054 | static void _oval_result_test_initialize_bindingscxx . . $ _oval_result_test_initialize_bindings(3cafb9f5e9f38405).(struct oval_result_testcxx . . $ oval_result_test# *rslt_test) |
| 1055 | { |
| 1056 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rslt_test); |
| 1057 | |
| 1058 | struct oval_testcxx . . $ oval_test# *oval_test = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(rslt_test); |
| 1059 | struct oval_string_mapcxx . . $ oval_string_map# *vm; |
| 1060 | struct oval_state_iteratorcxx . . $ oval_state_iterator# *ste_itr; |
| 1061 | struct oval_iteratorcxx . . $ oval_iterator# *var_itr; |
| 1062 | |
| 1063 | vm = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 1064 | |
| 1065 | /* Gather bindings pertaining to the referenced states */ |
| 1066 | /* TODO: cache bindings collected for each state */ |
| 1067 | ste_itr = oval_test_get_statescxx . . $ oval_test_get_states(b738fee4834aaaa6).(oval_test); |
| 1068 | while (oval_state_iterator_has_morecxx . . $ oval_state_iterator_has_more(bbfacbd9c1bc3d63).(ste_itr)) { |
| 1069 | struct oval_statecxx . . $ oval_state# *ste; |
| 1070 | |
| 1071 | ste = oval_state_iterator_nextcxx . . $ oval_state_iterator_next(f0883bc3981b419).(ste_itr); |
| 1072 | oval_ste_collect_var_refscxx . . $ oval_ste_collect_var_refs(1462fae027ea6e84).(ste, vm); |
| 1073 | } |
| 1074 | oval_state_iterator_freecxx . . $ oval_state_iterator_free(37c8c23faa65426a).(ste_itr); |
| 1075 | |
| 1076 | var_itr = oval_string_map_valuescxx . . $ oval_string_map_values(52dd2feb99c28df0).(vm); |
| 1077 | while (oval_collection_iterator_has_morecxx . . $ oval_collection_iterator_has_more(de0650ab9b639739).(var_itr)) { |
| 1078 | struct oval_variablecxx . . $ oval_variable# *var; |
| 1079 | struct oval_value_iteratorcxx . . $ oval_value_iterator# *val_itr; |
| 1080 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding; |
| 1081 | |
| 1082 | var = oval_collection_iterator_nextcxx . . $ oval_collection_iterator_next(344074693c9690a9).(var_itr); |
| 1083 | binding = oval_variable_binding_newcxx . . $ oval_variable_binding_new(ac18c3aae7e0fb07).(var, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1084 | |
| 1085 | val_itr = oval_variable_get_valuescxx . . $ oval_variable_get_values(325344158909f348).(var); |
| 1086 | while (oval_value_iterator_has_morecxx . . $ oval_value_iterator_has_more(753adc45e63e3dec).(val_itr)) { |
| 1087 | struct oval_valuecxx . . $ oval_value# *val; |
| 1088 | char *txt; |
| 1089 | |
| 1090 | val = oval_value_iterator_nextcxx . . $ oval_value_iterator_next(c6f435863c40c2c6).(val_itr); |
| 1091 | txt = oval_value_get_textcxx . . $ oval_value_get_text(cab4e37bbd1656d5).(val); |
| 1092 | txt = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(txt); |
| 1093 | oval_variable_binding_add_valuecxx . . $ oval_variable_binding_add_value(7e5c0243ecffb425).(binding, txt); |
| 1094 | } |
| 1095 | oval_value_iterator_freecxx . . $ oval_value_iterator_free(1b9ed96dce1b7286).(val_itr); |
| 1096 | oval_result_test_add_bindingcxx . . $ oval_result_test_add_binding(94139c95afeea5f2).(rslt_test, binding); |
| 1097 | } |
| 1098 | oval_collection_iterator_freecxx . . $ oval_collection_iterator_free(ee496816570b41f7).(var_itr); |
| 1099 | |
| 1100 | /* Gather bindings pertaining to the collected object */ |
| 1101 | struct oval_objectcxx . . $ oval_object# *oval_object = oval_test_get_objectcxx . . $ oval_test_get_object(7733aadd35446dd9).(oval_test); |
| 1102 | if (oval_object) { |
| 1103 | char *object_id = oval_object_get_idcxx . . $ oval_object_get_id(c789946d38fecc83).(oval_object); |
| 1104 | struct oval_result_systemcxx . . $ oval_result_system# *sys = oval_result_test_get_systemcxx . . $ oval_result_test_get_system(5fd1e535b43d28cd).(rslt_test); |
| 1105 | struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(sys); |
| 1106 | struct oval_syscharcxx . . $ oval_syschar# *syschar = oval_syschar_model_get_syscharcxx . . $ oval_syschar_model_get_syschar(5e0330551a5ec218).(syschar_model, object_id); |
| 1107 | /* no syschar if system characteristics was a subset of definitions */ |
| 1108 | if(syschar) { |
| 1109 | struct oval_variable_binding_iteratorcxx . . $ oval_variable_binding_iterator# *bindings = oval_syschar_get_variable_bindingscxx . . $ oval_syschar_get_variable_bindings(7515cf8c47a48aea).(syschar); |
| 1110 | while (oval_variable_binding_iterator_has_morecxx . . $ oval_variable_binding_iterator_has_more(422cba9ccf408239).(bindings)) { |
| 1111 | struct oval_variablecxx . . $ oval_variable# *var; |
| 1112 | char *var_id; |
| 1113 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding = oval_variable_binding_iterator_nextcxx . . $ oval_variable_binding_iterator_next(4e13e803cf09d396).(bindings); |
| 1114 | |
| 1115 | var = oval_variable_binding_get_variablecxx . . $ oval_variable_binding_get_variable(14b2b3fae7aa7f8d).(binding); |
| 1116 | var_id = oval_variable_get_idcxx . . $ oval_variable_get_id(341a3c7e6ea3818b).(var); |
| 1117 | /* Don't add bindings that were already |
| 1118 | * collected from states. Assumtion is made |
| 1119 | * that object's own bindings don't contain |
| 1120 | * duplicates. |
| 1121 | */ |
| 1122 | if (oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(vm, var_id) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1123 | struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(syschar_model); |
| 1124 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding_copy = oval_variable_binding_clonecxx . . $ oval_variable_binding_clone(c98cad892206d52e).(binding, definition_model); |
| 1125 | oval_result_test_add_bindingcxx . . $ oval_result_test_add_binding(94139c95afeea5f2).(rslt_test, binding_copy); |
| 1126 | } |
| 1127 | } |
| 1128 | oval_variable_binding_iterator_freecxx . . $ oval_variable_binding_iterator_free(70e37e87cc950ccc).(bindings); |
| 1129 | } |
| 1130 | } |
| 1131 | |
| 1132 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(vm, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1133 | |
| 1134 | rslt_test->bindings_initializedcxx . . $ oval_result_test#bindings_initialized. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1135 | } |
| 1136 | |
| 1137 | oval_result_tcxx . . $ oval_result_t# oval_result_test_evalcxx . . $ oval_result_test_eval(2fe1748e889465b4).(struct oval_result_testcxx . . $ oval_result_test# *rtest) |
| 1138 | { |
| 1139 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1140 | |
| 1141 | struct oval_testcxx . . $ oval_test# *test = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(rtest); |
| 1142 | const char *type = oval_subtype_get_textcxx . . $ oval_subtype_get_text(ee6b3dcae047e21f).(oval_test_get_subtypecxx . . $ oval_test_get_subtype(ae5a5b14a3df8d45).(test)); |
| 1143 | const char *test_id = oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(test); |
| 1144 | const char *comment = oval_test_get_commentcxx . . $ oval_test_get_comment(6776e4970683fd20).(test); |
| 1145 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Evaluating %s test '%s': %s.", type, test_id, comment); |
| 1146 | |
| 1147 | if (rtest->resultcxx . . $ oval_result_test#result. == OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.) { |
| 1148 | if (oval_test_get_subtypecxx . . $ oval_test_get_subtype(ae5a5b14a3df8d45).(oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(rtest)) != OVAL_INDEPENDENT_UNKNOWNcxx . . $ OVAL_INDEPENDENT_UNKNOWN.) { |
| 1149 | struct oval_string_mapcxx . . $ oval_string_map# *tmp_map = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 1150 | void *args[] = { rtest->systemcxx . . $ oval_result_test#system., rtest, tmp_map }; |
| 1151 | dIndentcxx . . $ `src/common/debug_priv.h:66:9`!(1); |
| 1152 | rtest->resultcxx . . $ oval_result_test#result. = _oval_result_test_resultcxx . . $ _oval_result_test_result(48925fc1b679e66e).(rtest, args); |
| 1153 | dIndentcxx . . $ `src/common/debug_priv.h:66:9`!(-1); |
| 1154 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(tmp_map, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1155 | |
| 1156 | if (!rtest->bindings_initializedcxx . . $ oval_result_test#bindings_initialized.) { |
| 1157 | _oval_result_test_initialize_bindingscxx . . $ _oval_result_test_initialize_bindings(3cafb9f5e9f38405).(rtest); |
| 1158 | } |
| 1159 | } |
| 1160 | else |
| 1161 | rtest->resultcxx . . $ oval_result_test#result. = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.; |
| 1162 | } |
| 1163 | |
| 1164 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Test '%s' evaluated as %s.", test_id, oval_result_get_text(rtest->result)); |
| 1165 | |
| 1166 | return rtest->resultcxx . . $ oval_result_test#result.; |
| 1167 | } |
| 1168 | |
| 1169 | oval_result_tcxx . . $ oval_result_t# oval_result_test_get_resultcxx . . $ oval_result_test_get_result(2fe1748e889465b4).(struct oval_result_testcxx . . $ oval_result_test# * rtest) |
| 1170 | { |
| 1171 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1172 | |
| 1173 | return rtest->resultcxx . . $ oval_result_test#result.; |
| 1174 | } |
| 1175 | |
| 1176 | int oval_result_test_get_instancecxx . . $ oval_result_test_get_instance(a648399b15cec842).(struct oval_result_testcxx . . $ oval_result_test# *rtest) |
| 1177 | { |
| 1178 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1179 | |
| 1180 | return rtest->instancecxx . . $ oval_result_test#instance.; |
| 1181 | } |
| 1182 | |
| 1183 | struct oval_message_iteratorcxx . . $ oval_message_iterator# *oval_result_test_get_messagescxx . . $ oval_result_test_get_messages(5232250ab749b372).(struct oval_result_testcxx . . $ oval_result_test# *rtest) |
| 1184 | { |
| 1185 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1186 | |
| 1187 | return (struct oval_message_iteratorcxx . . $ oval_message_iterator# *) oval_collection_iteratorcxx . . $ oval_collection_iterator(8bdeb6a25e21af3e).(rtest->messagescxx . . $ oval_result_test#messages.); |
| 1188 | } |
| 1189 | |
| 1190 | struct oval_result_item_iteratorcxx . . $ oval_result_item_iterator# *oval_result_test_get_itemscxx . . $ oval_result_test_get_items(39eccb4e00b508db).(struct oval_result_testcxx . . $ oval_result_test# *rtest) |
| 1191 | { |
| 1192 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1193 | |
| 1194 | return (struct oval_result_item_iteratorcxx . . $ oval_result_item_iterator# *) |
| 1195 | oval_collection_iteratorcxx . . $ oval_collection_iterator(8bdeb6a25e21af3e).(rtest->itemscxx . . $ oval_result_test#items.); |
| 1196 | } |
| 1197 | |
| 1198 | struct oval_variable_binding_iteratorcxx . . $ oval_variable_binding_iterator# *oval_result_test_get_bindingscxx . . $ oval_result_test_get_bindings(f33289e3d5e96a2a).(struct oval_result_testcxx . . $ oval_result_test# |
| 1199 | *rtest) |
| 1200 | { |
| 1201 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rtest); |
| 1202 | |
| 1203 | return (struct oval_variable_binding_iteratorcxx . . $ oval_variable_binding_iterator# *) |
| 1204 | oval_collection_iteratorcxx . . $ oval_collection_iterator(8bdeb6a25e21af3e).(rtest->bindingscxx . . $ oval_result_test#bindings.); |
| 1205 | } |
| 1206 | |
| 1207 | void oval_result_test_set_resultcxx . . $ oval_result_test_set_result(912ee9d5a821ac83).(struct oval_result_testcxx . . $ oval_result_test# *test, oval_result_tcxx . . $ oval_result_t# result) |
| 1208 | { |
| 1209 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(test); |
| 1210 | test->resultcxx . . $ oval_result_test#result. = result; |
| 1211 | } |
| 1212 | |
| 1213 | void oval_result_test_set_instancecxx . . $ oval_result_test_set_instance(fb3068d9953bab86).(struct oval_result_testcxx . . $ oval_result_test# *test, int instance) |
| 1214 | { |
| 1215 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(test); |
| 1216 | test->instancecxx . . $ oval_result_test#instance. = instance; |
| 1217 | } |
| 1218 | |
| 1219 | void oval_result_test_add_messagecxx . . $ oval_result_test_add_message(fa262aaf05b1ed79).(struct oval_result_testcxx . . $ oval_result_test# *test, struct oval_messagecxx . . $ oval_message# *message) |
| 1220 | { |
| 1221 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(test); |
| 1222 | oval_collection_addcxx . . $ oval_collection_add(3c6bf54730c0284).(test->messagescxx . . $ oval_result_test#messages., message); |
| 1223 | } |
| 1224 | |
| 1225 | void oval_result_test_add_itemcxx . . $ oval_result_test_add_item(70d52eaa6ff6c17d).(struct oval_result_testcxx . . $ oval_result_test# *test, struct oval_result_itemcxx . . $ oval_result_item# *item) |
| 1226 | { |
| 1227 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(test); |
| 1228 | oval_collection_addcxx . . $ oval_collection_add(3c6bf54730c0284).(test->itemscxx . . $ oval_result_test#items., item); |
| 1229 | } |
| 1230 | |
| 1231 | void oval_result_test_add_bindingcxx . . $ oval_result_test_add_binding(94139c95afeea5f2).(struct oval_result_testcxx . . $ oval_result_test# *test, struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding) |
| 1232 | { |
| 1233 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(test); |
| 1234 | oval_collection_addcxx . . $ oval_collection_add(3c6bf54730c0284).(test->bindingscxx . . $ oval_result_test#bindings., binding); |
| 1235 | } |
| 1236 | |
| 1237 | //void(*oscap_consumer_func)(void*, void*); |
| 1238 | static void _oval_test_message_consumercxx . . $ _oval_test_message_consumer(7bf39ac383b24f).(struct oval_messagecxx . . $ oval_message# *message, struct oval_result_testcxx . . $ oval_result_test# *test) { |
| 1239 | oval_result_test_add_messagecxx . . $ oval_result_test_add_message(fa262aaf05b1ed79).(test, message); |
| 1240 | } |
| 1241 | |
| 1242 | static int _oval_result_test_binding_parsecxx . . $ _oval_result_test_binding_parse(570977c8a9c173da).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct oval_parser_contextcxx . . $ oval_parser_context# *context, void **args) { |
| 1243 | int return_code = 0; |
| 1244 | |
| 1245 | xmlCharcxx . . $ xmlChar# *variable_id = xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "variable_id"); |
| 1246 | |
| 1247 | struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(SYSTEMcxx . . $ `src/OVAL/results/oval_resultTest.c:696:9`!); |
| 1248 | struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(syschar_model); |
| 1249 | |
| 1250 | struct oval_variablecxx . . $ oval_variable# *variable = oval_definition_model_get_new_variablecxx . . $ oval_definition_model_get_new_variable(d0b65e206dc01f0d). |
| 1251 | (definition_model, (char *)variable_id, OVAL_VARIABLE_UNKNOWNcxx . . $ OVAL_VARIABLE_UNKNOWN.); |
| 1252 | |
| 1253 | xmlCharcxx . . $ xmlChar# *value = xmlTextReaderValuecxx . . $ xmlTextReaderValue(3322afb275581432).(reader); |
| 1254 | |
| 1255 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding = oval_variable_binding_newcxx . . $ oval_variable_binding_new(ac18c3aae7e0fb07).(variable, oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).((char *) value)); |
| 1256 | oval_result_test_add_bindingcxx . . $ oval_result_test_add_binding(94139c95afeea5f2).(TESTcxx . . $ `src/OVAL/results/oval_resultTest.c:695:9`!, binding); |
| 1257 | |
| 1258 | xmlFreecxx . . $ xmlFree.(value); |
| 1259 | xmlFreecxx . . $ xmlFree.(variable_id); |
| 1260 | |
| 1261 | return return_code; |
| 1262 | } |
| 1263 | |
| 1264 | static int _oval_result_test_parsecxx . . $ _oval_result_test_parse(570977c8a9c173da).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct oval_parser_contextcxx . . $ oval_parser_context# *context, void **args) { |
| 1265 | int return_code = 0; |
| 1266 | xmlCharcxx . . $ xmlChar# *localName = xmlTextReaderLocalNamecxx . . $ xmlTextReaderLocalName(3322afb275581432).(reader); |
| 1267 | |
| 1268 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *)localName, "message") == 0) { |
| 1269 | return_code = oval_message_parse_tagcxx . . $ oval_message_parse_tag(29f485c9b2aa6ded).(reader, context, (oscap_consumer_funccxx . . $ oscap_consumer_func#) _oval_test_message_consumercxx . . $ _oval_test_message_consumer(7bf39ac383b24f)., TESTcxx . . $ `src/OVAL/results/oval_resultTest.c:695:9`!); |
| 1270 | } else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *)localName, "tested_item") == 0) { |
| 1271 | return_code = oval_result_item_parse_tagcxx . . $ oval_result_item_parse_tag(5cfa71e0f637957f).(reader, context, SYSTEMcxx . . $ `src/OVAL/results/oval_resultTest.c:696:9`!, (oscap_consumer_funccxx . . $ oscap_consumer_func#) _oval_test_item_consumercxx . . $ _oval_test_item_consumer(3f31a01c2262612e)., args); |
| 1272 | } else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *)localName, "tested_variable") == 0) { |
| 1273 | return_code = _oval_result_test_binding_parsecxx . . $ _oval_result_test_binding_parse(570977c8a9c173da).(reader, context, args); |
| 1274 | } else { |
| 1275 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Unhandled tag: <%s>.", localName); |
| 1276 | oval_parser_skip_tagcxx . . $ oval_parser_skip_tag(b61d4daae99e998a).(reader, context); |
| 1277 | } |
| 1278 | |
| 1279 | freecxx . . $ free(5d22bdacc48458e8).(localName); |
| 1280 | |
| 1281 | return return_code; |
| 1282 | } |
| 1283 | |
| 1284 | int oval_result_test_parse_tagcxx . . $ oval_result_test_parse_tag(cf369959597901d1).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct oval_parser_contextcxx . . $ oval_parser_context# *context, void *usr) { |
| 1285 | |
| 1286 | struct oval_result_systemcxx . . $ oval_result_system# *sys = (struct oval_result_systemcxx . . $ oval_result_system# *) usr; |
| 1287 | int return_code = 0; |
| 1288 | struct oval_definition_modelcxx . . $ oval_definition_model# *dmod; |
| 1289 | struct oval_testcxx . . $ oval_test# *dtst; |
| 1290 | struct oval_result_testcxx . . $ oval_result_test# *test; |
| 1291 | xmlCharcxx . . $ xmlChar# *test_id = xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "test_id"); |
| 1292 | |
| 1293 | dmod = context->definition_modelcxx . . $ oval_parser_context#definition_model.; |
| 1294 | dtst = oval_definition_model_get_new_testcxx . . $ oval_definition_model_get_new_test(c765f99071e189c).(dmod, (char *) test_id); |
| 1295 | oval_result_tcxx . . $ oval_result_t# result = oval_result_parsecxx . . $ oval_result_parse(7314a5850c06c36d).(reader, "result", 0); |
| 1296 | int variable_instance = oval_parser_int_attributecxx . . $ oval_parser_int_attribute(a53adaee35698733).(reader, "variable_instance", 1); |
| 1297 | |
| 1298 | test = oval_result_system_get_new_testcxx . . $ oval_result_system_get_new_test(5934dc8ae7e49345).(sys, dtst, variable_instance); |
| 1299 | if (test == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1300 | return -1; |
| 1301 | oval_result_test_set_resultcxx . . $ oval_result_test_set_result(912ee9d5a821ac83).(test, result); |
| 1302 | oval_result_test_set_instancecxx . . $ oval_result_test_set_instance(fb3068d9953bab86).(test, variable_instance); |
| 1303 | |
| 1304 | struct oval_testcxx . . $ oval_test# *ovaltst = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(test); |
| 1305 | |
| 1306 | oval_existence_tcxx . . $ oval_existence_t# check_existence = oval_existence_parsecxx . . $ oval_existence_parse(b51016942f976cd6).(reader, "check_existence", OVAL_AT_LEAST_ONE_EXISTScxx . . $ OVAL_AT_LEAST_ONE_EXISTS.); |
| 1307 | oval_existence_tcxx . . $ oval_existence_t# tst_check_existence = oval_test_get_existencecxx . . $ oval_test_get_existence(7e0630d105fa339e).(ovaltst); |
| 1308 | if (tst_check_existence == OVAL_EXISTENCE_UNKNOWNcxx . . $ OVAL_EXISTENCE_UNKNOWN.) { |
| 1309 | oval_test_set_existencecxx . . $ oval_test_set_existence(bda369d17cca1746).(ovaltst, check_existence); |
| 1310 | } else if (tst_check_existence != check_existence) { |
| 1311 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("@check_existence does not match, test_id: %s.", test_id); |
| 1312 | } |
| 1313 | |
| 1314 | oval_check_tcxx . . $ oval_check_t# check = oval_check_parsecxx . . $ oval_check_parse(def8dff2972e216b).(reader, "check", OVAL_CHECK_UNKNOWNcxx . . $ OVAL_CHECK_UNKNOWN.); |
| 1315 | oval_check_tcxx . . $ oval_check_t# tst_check = oval_test_get_checkcxx . . $ oval_test_get_check(52b877f2832a591f).(ovaltst); |
| 1316 | if (tst_check == OVAL_CHECK_UNKNOWNcxx . . $ OVAL_CHECK_UNKNOWN.) { |
| 1317 | oval_test_set_checkcxx . . $ oval_test_set_check(3aea7a1311c2c81c).(ovaltst, check); |
| 1318 | } else if (tst_check != check) { |
| 1319 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("@check does not match, test_id: %s.", test_id); |
| 1320 | } |
| 1321 | |
| 1322 | int version = oval_parser_int_attributecxx . . $ oval_parser_int_attribute(a53adaee35698733).(reader, "version", 0); |
| 1323 | int tst_version = oval_test_get_versioncxx . . $ oval_test_get_version(9ebe9a7516516147).(ovaltst); |
| 1324 | if (tst_version == 0) { |
| 1325 | oval_test_set_versioncxx . . $ oval_test_set_version(8b558d84ba8269d9).(ovaltst, version); |
| 1326 | } else if (tst_version != version) { |
| 1327 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("@version does not match, test_id: %s.", test_id); |
| 1328 | } |
| 1329 | |
| 1330 | struct oval_string_mapcxx . . $ oval_string_map# *itemmap = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 1331 | void *args[] = { sys, test, itemmap }; |
| 1332 | return_code = oval_parser_parse_tagcxx . . $ oval_parser_parse_tag(4eaaf867ce26f59b).(reader, context, (oval_xml_tag_parsercxx . . $ oval_xml_tag_parser#) _oval_result_test_parsecxx . . $ _oval_result_test_parse(570977c8a9c173da)., args); |
| 1333 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(itemmap, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1334 | test->bindings_initializedcxx . . $ oval_result_test#bindings_initialized. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1335 | |
| 1336 | freecxx . . $ free(5d22bdacc48458e8).(test_id); |
| 1337 | return return_code; |
| 1338 | } |
| 1339 | |
| 1340 | static void _oval_result_binding_to_domcxx . . $ _oval_result_binding_to_dom(13f322b972ccea06).(struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# *parent) { |
| 1341 | xmlNscxx . . $ xmlNs# *ns_results = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, parent, OVAL_RESULTS_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:57:9`!); |
| 1342 | struct oval_variablecxx . . $ oval_variable# *oval_variable = oval_variable_binding_get_variablecxx . . $ oval_variable_binding_get_variable(14b2b3fae7aa7f8d).(binding); |
| 1343 | char *variable_id = oval_variable_get_idcxx . . $ oval_variable_get_id(341a3c7e6ea3818b).(oval_variable); |
| 1344 | struct oval_string_iteratorcxx . . $ oval_string_iterator# *str_itr; |
| 1345 | |
| 1346 | str_itr = oval_variable_binding_get_valuescxx . . $ oval_variable_binding_get_values(e441ed7704185d05).(binding); |
| 1347 | while (oval_string_iterator_has_morecxx . . $ oval_string_iterator_has_more(41a15bd829ecb6dd).(str_itr)) { |
| 1348 | char *value; |
| 1349 | xmlNodecxx . . $ xmlNode# *binding_node; |
| 1350 | |
| 1351 | value = oval_string_iterator_nextcxx . . $ oval_string_iterator_next(fc393b19611653f6).(str_itr); |
| 1352 | binding_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ns_results, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "tested_variable", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! value); |
| 1353 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(binding_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "variable_id", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! variable_id); |
| 1354 | } |
| 1355 | oval_string_iterator_freecxx . . $ oval_string_iterator_free(eccafcd0705f3c29).(str_itr); |
| 1356 | } |
| 1357 | |
| 1358 | xmlNodecxx . . $ xmlNode# *oval_result_test_to_domcxx . . $ oval_result_test_to_dom(280c362fc164a84f).(struct oval_result_testcxx . . $ oval_result_test# *rslt_test, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# * parent) { |
| 1359 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rslt_test); |
| 1360 | |
| 1361 | xmlNscxx . . $ xmlNs# *ns_results = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, parent, OVAL_RESULTS_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:57:9`!); |
| 1362 | xmlNodecxx . . $ xmlNode# *test_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ns_results, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "test", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1363 | |
| 1364 | struct oval_testcxx . . $ oval_test# *oval_test = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(rslt_test); |
| 1365 | char *test_id = oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(oval_test); |
| 1366 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(test_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "test_id", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! test_id); |
| 1367 | |
| 1368 | char version[10]; |
| 1369 | *version = '\0'; |
| 1370 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(version, sizeof(version), "%d", oval_test_get_versioncxx . . $ oval_test_get_version(9ebe9a7516516147).(oval_test)); |
| 1371 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(test_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "version", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! version); |
| 1372 | |
| 1373 | oval_existence_tcxx . . $ oval_existence_t# existence = oval_test_get_existencecxx . . $ oval_test_get_existence(7e0630d105fa339e).(oval_test); |
| 1374 | if (existence != OVAL_AT_LEAST_ONE_EXISTScxx . . $ OVAL_AT_LEAST_ONE_EXISTS.) { |
| 1375 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(test_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "check_existence", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oval_existence_get_textcxx . . $ oval_existence_get_text(b55025df715e2668).(existence)); |
| 1376 | } |
| 1377 | |
| 1378 | oval_check_tcxx . . $ oval_check_t# check = oval_test_get_checkcxx . . $ oval_test_get_check(52b877f2832a591f).(oval_test); |
| 1379 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(test_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "check", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oval_check_get_textcxx . . $ oval_check_get_text(738477922eea9c02).(check)); |
| 1380 | |
| 1381 | int instance_val = oval_result_test_get_instancecxx . . $ oval_result_test_get_instance(a648399b15cec842).(rslt_test); |
| 1382 | if (instance_val > 1) { |
| 1383 | char instance[11]; |
| 1384 | *instance = '\0'; |
| 1385 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(instance, sizeof(instance), "%d", instance_val); |
| 1386 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(test_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "variable_instance", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! instance); |
| 1387 | } |
| 1388 | |
| 1389 | oval_result_tcxx . . $ oval_result_t# result = oval_result_test_get_resultcxx . . $ oval_result_test_get_result(2fe1748e889465b4).(rslt_test); |
| 1390 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(test_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "result", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oval_result_get_textcxx . . $ oval_result_get_text(889be41b1f382b15).(result)); |
| 1391 | |
| 1392 | /* does not make sense to report these when test(definition) is not evaluated */ |
| 1393 | if( result != OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.) { |
| 1394 | struct oval_result_item_iteratorcxx . . $ oval_result_item_iterator# *items = oval_result_test_get_itemscxx . . $ oval_result_test_get_items(39eccb4e00b508db).(rslt_test); |
| 1395 | while (oval_result_item_iterator_has_morecxx . . $ oval_result_item_iterator_has_more(a237e157d1921aa4).(items)) { |
| 1396 | struct oval_result_itemcxx . . $ oval_result_item# *item = oval_result_item_iterator_nextcxx . . $ oval_result_item_iterator_next(82225cab81b266fe).(items); |
| 1397 | oval_result_item_to_domcxx . . $ oval_result_item_to_dom(97178d8df42fc6df).(item, doc, test_node); |
| 1398 | } |
| 1399 | oval_result_item_iterator_freecxx . . $ oval_result_item_iterator_free(cc5d1a6fd9e0d5a0).(items); |
| 1400 | |
| 1401 | struct oval_variable_binding_iteratorcxx . . $ oval_variable_binding_iterator# *bindings = oval_result_test_get_bindingscxx . . $ oval_result_test_get_bindings(f33289e3d5e96a2a).(rslt_test); |
| 1402 | while (oval_variable_binding_iterator_has_morecxx . . $ oval_variable_binding_iterator_has_more(422cba9ccf408239).(bindings)) { |
| 1403 | struct oval_variable_bindingcxx . . $ oval_variable_binding# *binding = oval_variable_binding_iterator_nextcxx . . $ oval_variable_binding_iterator_next(4e13e803cf09d396).(bindings); |
| 1404 | _oval_result_binding_to_domcxx . . $ _oval_result_binding_to_dom(13f322b972ccea06).(binding, doc, test_node); |
| 1405 | } |
| 1406 | oval_variable_binding_iterator_freecxx . . $ oval_variable_binding_iterator_free(70e37e87cc950ccc).(bindings); |
| 1407 | } |
| 1408 | |
| 1409 | return test_node; |
| 1410 | } |
| 1411 | |
| 1412 | const char *oval_result_test_get_idcxx . . $ oval_result_test_get_id(a65fe3b568e8bf5).(const struct oval_result_testcxx . . $ oval_result_test# *rslt_test) |
| 1413 | { |
| 1414 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(rslt_test); |
| 1415 | struct oval_testcxx . . $ oval_test# *test = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).((struct oval_result_testcxx . . $ oval_result_test# *) rslt_test); |
| 1416 | return (test == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) ? NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! : oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(test); |
| 1417 | } |