| 1 | /* |
| 2 | * Copyright 2009 Red Hat Inc., Durham, North Carolina. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | * Authors: |
| 20 | * Lukas Kuklinek <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 24 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 25 | #endif |
| 26 | |
| 27 | #include <string.h> |
| 28 | |
| 29 | #include "oscap_text.h"cxx . . $ `<file>/src/common/public/oscap_text.h`/ |
| 30 | #include "item.h"cxx . . $ `<file>/src/XCCDF/item.h`/ |
| 31 | #include "helpers.h"cxx . . $ `<file>/src/XCCDF/helpers.h`/ |
| 32 | #include "xccdf_impl.h"cxx . . $ `<file>/src/XCCDF/xccdf_impl.h`/ |
| 33 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 34 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 35 | #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/ |
| 36 | #include "source/public/oscap_source.h"cxx . . $ `<file>/src/source/public/oscap_source.h`/ |
| 37 | #include "source/oscap_source_priv.h"cxx . . $ `<file>/src/source/oscap_source_priv.h`/ |
| 38 | |
| 39 | #include "CPE/cpedict_priv.h"cxx . . $ `<file>/src/CPE/cpedict_priv.h`/ |
| 40 | #include "CPE/cpelang_priv.h"cxx . . $ `<file>/src/CPE/cpelang_priv.h`/ |
| 41 | #include "CPE/cpe_ctx_priv.h"cxx . . $ `<file>/src/CPE/cpe_ctx_priv.h`/ |
| 42 | |
| 43 | #define XCCDF_SUPPORTEDcxx . . $ `src/XCCDF/benchmark.c:43:9`! "1.2" |
| 44 | |
| 45 | static struct oscap_htablecxx . . $ oscap_htable# *xccdf_benchmark_find_target_htablecxx . . $ xccdf_benchmark_find_target_htable(5a75bbbd027a1cce).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *, xccdf_type_tcxx . . $ xccdf_type_t#); |
| 46 | static xmlNodecxx . . $ xmlNode# *xccdf_plain_text_to_domcxx . . $ xccdf_plain_text_to_dom(743049a66c9e463).(const struct xccdf_plain_textcxx . . $ xccdf_plain_text# *ptext, xmlDoccxx . . $ xmlDoc# *doc, xmlNodecxx . . $ xmlNode# *parent, const struct xccdf_version_infocxx . . $ xccdf_version_info#* version_info); |
| 47 | |
| 48 | struct xccdf_backrefcxx . . $ xccdf_backref# { |
| 49 | struct xccdf_itemcxx . . $ xccdf_item# **ptrcxx . . $ xccdf_backref#ptr.; // pointer to a pointer that is supposed to be pointing to an item with id 'id' |
| 50 | xccdf_type_tcxx . . $ xccdf_type_t# typecxx . . $ xccdf_backref#type.; // expected item type |
| 51 | char *idcxx . . $ xccdf_backref#id.; // id |
| 52 | }; |
| 53 | |
| 54 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *xccdf_benchmark_import_sourcecxx . . $ xccdf_benchmark_import_source(ea77069d65e32f82).(struct oscap_sourcecxx . . $ oscap_source# *source) |
| 55 | { |
| 56 | xmlTextReadercxx . . $ xmlTextReader# *reader = oscap_source_get_xmlTextReadercxx . . $ oscap_source_get_xmlTextReader(9a7ef22a0934f79d).(source); |
| 57 | |
| 58 | while (xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader) == 1 && xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.) ; |
| 59 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark = xccdf_benchmark_newcxx . . $ xccdf_benchmark_new(76a24929b4ae242a).(); |
| 60 | const boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! parse_result = xccdf_benchmark_parsecxx . . $ xccdf_benchmark_parse(bf0f85c13dd5e40b).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark), reader); |
| 61 | xmlFreeTextReadercxx . . $ xmlFreeTextReader(724dbfdba9ec3ce8).(reader); |
| 62 | |
| 63 | if (!parse_result) { // parsing fatal error |
| 64 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`!, "Failed to import XCCDF content from '%s'.", oscap_source_readable_origin(source)); |
| 65 | xccdf_benchmark_freecxx . . $ xccdf_benchmark_free(55d89e1b9b447538).(benchmark); |
| 66 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 67 | } |
| 68 | |
| 69 | // This is sadly the only place where we can pass origin file information |
| 70 | // to the CPE1 embedded dictionary (if any). It is necessary to figure out |
| 71 | // proper paths to OVAL files referenced from CPE1 dictionaries. |
| 72 | |
| 73 | // FIXME: Refactor and move this somewhere else |
| 74 | struct cpe_dict_modelcxx . . $ cpe_dict_model#* embedded_dict = xccdf_benchmark_get_cpe_listcxx . . $ xccdf_benchmark_get_cpe_list(4ac24f742972c093).(benchmark); |
| 75 | if (embedded_dict != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 76 | cpe_dict_model_set_origin_filecxx . . $ cpe_dict_model_set_origin_file(7b7239c1e1f068e0).(embedded_dict, oscap_source_readable_origincxx . . $ oscap_source_readable_origin(1485dc36ee4b63be).(source)); |
| 77 | } |
| 78 | |
| 79 | // same situation with embedded CPE2 lang model |
| 80 | // FIXME: Refactor and move this somewhere else |
| 81 | struct cpe_lang_modelcxx . . $ cpe_lang_model#* embedded_lang_model = xccdf_benchmark_get_cpe_lang_modelcxx . . $ xccdf_benchmark_get_cpe_lang_model(abf6c9caef5e0812).(benchmark); |
| 82 | if (embedded_lang_model != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 83 | cpe_lang_model_set_origin_filecxx . . $ cpe_lang_model_set_origin_file(fd8b5c7adb9a0def).(embedded_lang_model, oscap_source_readable_origincxx . . $ oscap_source_readable_origin(1485dc36ee4b63be).(source)); |
| 84 | } |
| 85 | return benchmark; |
| 86 | } |
| 87 | |
| 88 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *xccdf_benchmark_newcxx . . $ xccdf_benchmark_new(76a24929b4ae242a).(void) |
| 89 | { |
| 90 | struct xccdf_itemcxx . . $ xccdf_item# *bench = xccdf_item_newcxx . . $ xccdf_item_new(8094a7806c065071).(XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 91 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..schema_versioncxx . . $ xccdf_benchmark_item#schema_version. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 92 | // lists |
| 93 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..rear_mattercxx . . $ xccdf_benchmark_item#rear_matter. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 94 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..front_mattercxx . . $ xccdf_benchmark_item#front_matter. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 95 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..noticescxx . . $ xccdf_benchmark_item#notices. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 96 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..modelscxx . . $ xccdf_benchmark_item#models. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 97 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..contentcxx . . $ xccdf_benchmark_item#content. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 98 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..valuescxx . . $ xccdf_benchmark_item#values. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 99 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..plain_textscxx . . $ xccdf_benchmark_item#plain_texts. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 100 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_listcxx . . $ xccdf_benchmark_item#cpe_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 101 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_lang_modelcxx . . $ xccdf_benchmark_item#cpe_lang_model. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 102 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profilescxx . . $ xccdf_benchmark_item#profiles. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 103 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..resultscxx . . $ xccdf_benchmark_item#results. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 104 | // hash tables |
| 105 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..items_dictcxx . . $ xccdf_benchmark_item#items_dict. = oscap_htable_newcxx . . $ oscap_htable_new(3c1cb2b6f390ad38).(); |
| 106 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profiles_dictcxx . . $ xccdf_benchmark_item#profiles_dict. = oscap_htable_newcxx . . $ oscap_htable_new(3c1cb2b6f390ad38).(); |
| 107 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..results_dictcxx . . $ xccdf_benchmark_item#results_dict. = oscap_htable_newcxx . . $ oscap_htable_new(3c1cb2b6f390ad38).(); |
| 108 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..clusters_dictcxx . . $ xccdf_benchmark_item#clusters_dict. = oscap_htable_newcxx . . $ oscap_htable_new(3c1cb2b6f390ad38).(); |
| 109 | |
| 110 | // add the implied default scoring model |
| 111 | struct xccdf_modelcxx . . $ xccdf_model# *default_model = xccdf_model_newcxx . . $ xccdf_model_new(a54884087c48527b).(); |
| 112 | xccdf_model_set_systemcxx . . $ xccdf_model_set_system(a730022acc39526f).(default_model, "urn:xccdf:scoring:default"); |
| 113 | xccdf_benchmark_add_modelcxx . . $ xccdf_benchmark_add_model(cb3071136ad19d66).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(bench), default_model); |
| 114 | |
| 115 | return XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(bench); |
| 116 | } |
| 117 | |
| 118 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *xccdf_benchmark_clonecxx . . $ xccdf_benchmark_clone(b43dcbd8118bc005).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *old_benchmark) |
| 119 | { |
| 120 | struct xccdf_itemcxx . . $ xccdf_item# *new_benchmark = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_itemcxx . . $ xccdf_item#) + sizeof(struct xccdf_benchmark_itemcxx . . $ xccdf_benchmark_item#)); |
| 121 | struct xccdf_itemcxx . . $ xccdf_item# *old = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(old_benchmark); |
| 122 | xccdf_item_base_clonecxx . . $ xccdf_item_base_clone(f0db45ff8e952d03).(&new_benchmark->itemcxx . . $ xccdf_item#item., &old->itemcxx . . $ xccdf_item#item.); |
| 123 | new_benchmark->typecxx . . $ xccdf_item#type. = old->typecxx . . $ xccdf_item#type.; |
| 124 | //second argument is a pointer to the benchmark being created which will be the parent of all of its sub elements. |
| 125 | xccdf_benchmark_item_clonecxx . . $ xccdf_benchmark_item_clone(42075129cb946a53).(new_benchmark, old_benchmark); |
| 126 | return XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(new_benchmark); |
| 127 | } |
| 128 | |
| 129 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_parsecxx . . $ xccdf_benchmark_parse(bf0f85c13dd5e40b).(struct xccdf_itemcxx . . $ xccdf_item# * benchmark, xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 130 | { |
| 131 | XCCDF_ASSERT_ELEMENTcxx . . $ `src/XCCDF/elements.h:141:9`!(reader, XCCDFE_BENCHMARK); |
| 132 | assertcxx . . $ `/usr/include/assert.h:50:10`!(benchmark != NULL); |
| 133 | if (benchmark->typecxx . . $ xccdf_item#type. != XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK.) |
| 134 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 135 | |
| 136 | xccdf_benchmark_set_schema_versioncxx . . $ xccdf_benchmark_set_schema_version(9f87ddce8e86b4b).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(benchmark), xccdf_detect_version_parsercxx . . $ xccdf_detect_version_parser(7d21fc833ae00d0a).(reader)); |
| 137 | |
| 138 | if (!xccdf_item_process_attributescxx . . $ xccdf_item_process_attributes(bf0f85c13dd5e40b).(benchmark, reader)) { |
| 139 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 140 | } |
| 141 | benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..stylecxx . . $ xccdf_benchmark_item#style. = xccdf_attribute_copycxx . . $ xccdf_attribute_copy(861b5c6f59611beb).(reader, XCCDFA_STYLEcxx . . $ XCCDFA_STYLE.); |
| 142 | benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..style_hrefcxx . . $ xccdf_benchmark_item#style_href. = xccdf_attribute_copycxx . . $ xccdf_attribute_copy(861b5c6f59611beb).(reader, XCCDFA_STYLE_HREFcxx . . $ XCCDFA_STYLE_HREF.); |
| 143 | benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..langcxx . . $ xccdf_benchmark_item#lang. = (char *) xmlTextReaderXmlLangcxx . . $ xmlTextReaderXmlLang(3322afb275581432).(reader); |
| 144 | if (xccdf_attribute_hascxx . . $ xccdf_attribute_has(5c4b5ba7d6a00a2).(reader, XCCDFA_RESOLVEDcxx . . $ XCCDFA_RESOLVED.)) |
| 145 | benchmark->itemcxx . . $ xccdf_item#item..flagscxx . . $ xccdf_item_base#flags..resolvedcxx . . $ xccdf_flags#resolved. = xccdf_attribute_get_boolcxx . . $ xccdf_attribute_get_bool(5c4b5ba7d6a00a2).(reader, XCCDFA_RESOLVEDcxx . . $ XCCDFA_RESOLVED.); |
| 146 | |
| 147 | int depth = oscap_element_depthcxx . . $ oscap_element_depth(82a242a19623f75).(reader) + 1; |
| 148 | |
| 149 | while (oscap_to_start_elementcxx . . $ oscap_to_start_element(c0c45fd800596ca5).(reader, depth)) { |
| 150 | struct xccdf_modelcxx . . $ xccdf_model# *parsed_model; |
| 151 | |
| 152 | switch (xccdf_element_getcxx . . $ xccdf_element_get(a5dd71d24d1f6f1).(reader)) { |
| 153 | case XCCDFE_NOTICEcxx . . $ XCCDFE_NOTICE.: |
| 154 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..noticescxx . . $ xccdf_benchmark_item#notices., xccdf_notice_new_parsecxx . . $ xccdf_notice_new_parse(5b12e5bf2a7216d2).(reader)); |
| 155 | break; |
| 156 | case XCCDFE_FRONT_MATTERcxx . . $ XCCDFE_FRONT_MATTER.: |
| 157 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..front_mattercxx . . $ xccdf_benchmark_item#front_matter., oscap_text_new_parsecxx . . $ oscap_text_new_parse(fc91cb6a8c9d272a).(XCCDF_TEXT_HTMLSUBcxx . . $ XCCDF_TEXT_HTMLSUB., reader)); |
| 158 | break; |
| 159 | case XCCDFE_REAR_MATTERcxx . . $ XCCDFE_REAR_MATTER.: |
| 160 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..rear_mattercxx . . $ xccdf_benchmark_item#rear_matter., oscap_text_new_parsecxx . . $ oscap_text_new_parse(fc91cb6a8c9d272a).(XCCDF_TEXT_HTMLSUBcxx . . $ XCCDF_TEXT_HTMLSUB., reader)); |
| 161 | break; |
| 162 | case XCCDFE_PLATFORMcxx . . $ XCCDFE_PLATFORM.: |
| 163 | xccdf_item_add_applicable_platformcxx . . $ xccdf_item_add_applicable_platform(55c7e5eccc41495d).(benchmark, reader); |
| 164 | break; |
| 165 | case XCCDFE_MODELcxx . . $ XCCDFE_MODEL.: |
| 166 | parsed_model = xccdf_model_new_xmlcxx . . $ xccdf_model_new_xml(8399a56ac382db76).(reader); |
| 167 | |
| 168 | // we won't add the implied default scoring model, it is already in the benchmark |
| 169 | if (oscap_strcmpcxx . . $ oscap_strcmp(5ae29d726ae57f88).(xccdf_model_get_systemcxx . . $ xccdf_model_get_system(2767d91305b32d1).(parsed_model), "urn:xccdf:scoring:default") != 0) |
| 170 | xccdf_benchmark_add_modelcxx . . $ xccdf_benchmark_add_model(cb3071136ad19d66).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(benchmark), parsed_model); |
| 171 | else |
| 172 | xccdf_model_freecxx . . $ xccdf_model_free(2490bc1030b8351b).(parsed_model); |
| 173 | |
| 174 | break; |
| 175 | case XCCDFE_PLAIN_TEXTcxx . . $ XCCDFE_PLAIN_TEXT.:{ |
| 176 | const char *id = xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, XCCDFA_IDcxx . . $ XCCDFA_ID.); |
| 177 | char *data = (char *)xmlTextReaderReadInnerXmlcxx . . $ xmlTextReaderReadInnerXml(3322afb275581432).(reader); |
| 178 | if (id) |
| 179 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..plain_textscxx . . $ xccdf_benchmark_item#plain_texts., |
| 180 | xccdf_plain_text_new_fillcxx . . $ xccdf_plain_text_new_fill(d2622b8a92823c1f).(id, |
| 181 | data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? "" : data)); |
| 182 | xmlFreecxx . . $ xmlFree.(data); |
| 183 | break; |
| 184 | } |
| 185 | case XCCDFE_CPE_LISTcxx . . $ XCCDFE_CPE_LIST.:{ |
| 186 | struct cpe_parser_ctxcxx . . $ cpe_parser_ctx# *ctx = cpe_parser_ctx_from_readercxx . . $ cpe_parser_ctx_from_reader(e3d9c9b7d3b0da8).(reader); |
| 187 | xccdf_benchmark_set_cpe_listcxx . . $ xccdf_benchmark_set_cpe_list(2cf98286b03b0bbc).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(benchmark), cpe_dict_model_parsecxx . . $ cpe_dict_model_parse(d014d982a14f83fe).(ctx)); |
| 188 | cpe_parser_ctx_freecxx . . $ cpe_parser_ctx_free(270d62ec502b7607).(ctx); |
| 189 | break; |
| 190 | } |
| 191 | case XCCDFE_CPE2_PLATFORMSPECcxx . . $ XCCDFE_CPE2_PLATFORMSPEC.: |
| 192 | xccdf_benchmark_set_cpe_lang_modelcxx . . $ xccdf_benchmark_set_cpe_lang_model(9f229e5814b5f3f8).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(benchmark), cpe_lang_model_parsecxx . . $ cpe_lang_model_parse(8447744a0d5bc150).(reader)); |
| 193 | break; |
| 194 | case XCCDFE_PROFILEcxx . . $ XCCDFE_PROFILE.: |
| 195 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profilescxx . . $ xccdf_benchmark_item#profiles., xccdf_profile_parsecxx . . $ xccdf_profile_parse(8cf60c58117f1f7b).(reader, benchmark)); |
| 196 | break; |
| 197 | case XCCDFE_GROUPcxx . . $ XCCDFE_GROUP.: |
| 198 | case XCCDFE_RULEcxx . . $ XCCDFE_RULE.: |
| 199 | xccdf_content_parsecxx . . $ xccdf_content_parse(1afc04bf1b8fc835).(reader, benchmark); |
| 200 | break; |
| 201 | case XCCDFE_VALUEcxx . . $ XCCDFE_VALUE.: |
| 202 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(benchmark->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..valuescxx . . $ xccdf_benchmark_item#values., xccdf_value_parsecxx . . $ xccdf_value_parse(8cf60c58117f1f7b).(reader, benchmark)); |
| 203 | break; |
| 204 | case XCCDFE_TESTRESULTcxx . . $ XCCDFE_TESTRESULT.: |
| 205 | xccdf_benchmark_add_resultcxx . . $ xccdf_benchmark_add_result(95f49eec48118fee).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(benchmark), xccdf_result_new_parsecxx . . $ xccdf_result_new_parse(d53eff5a40c1825f).(reader)); |
| 206 | break; |
| 207 | default: |
| 208 | if (!xccdf_item_process_elementcxx . . $ xccdf_item_process_element(bf0f85c13dd5e40b).(benchmark, reader)) |
| 209 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Encountered an unknown element '%s' while parsing XCCDF benchmark.", |
| 210 | xmlTextReaderConstLocalName(reader)); |
| 211 | } |
| 212 | xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); |
| 213 | } |
| 214 | |
| 215 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 216 | } |
| 217 | |
| 218 | struct oscap_sourcecxx . . $ oscap_source# *xccdf_benchmark_export_sourcecxx . . $ xccdf_benchmark_export_source(1f907351faeb5208).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *filename) |
| 219 | { |
| 220 | xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlNewDoccxx . . $ xmlNewDoc(6ad5ddcc52642397).(BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "1.0"); |
| 221 | if (doc == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 222 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 223 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 224 | } |
| 225 | |
| 226 | xccdf_benchmark_to_domcxx . . $ xccdf_benchmark_to_dom(64b01a118b7aa38e).(benchmark, doc, 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`!); |
| 227 | return oscap_source_new_from_xmlDoccxx . . $ oscap_source_new_from_xmlDoc(20d5db8f38e74517).(doc, filename); |
| 228 | } |
| 229 | |
| 230 | int xccdf_benchmark_exportcxx . . $ xccdf_benchmark_export(163bb5a28ad7f4ea).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *file) |
| 231 | { |
| 232 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(file); |
| 233 | |
| 234 | LIBXML_TEST_VERSIONcxx . . $ `<external>/12558958530574576205/xmlversion.h:40:9`!; |
| 235 | |
| 236 | struct oscap_sourcecxx . . $ oscap_source# *source = xccdf_benchmark_export_sourcecxx . . $ xccdf_benchmark_export_source(1f907351faeb5208).(benchmark, file); |
| 237 | if (source == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 238 | return -1; |
| 239 | } |
| 240 | int ret = oscap_source_save_ascxx . . $ oscap_source_save_as(b44a10f6a0e05d3e).(source, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 241 | oscap_source_freecxx . . $ oscap_source_free(1a322e80279420f6).(source);; |
| 242 | return ret; |
| 243 | } |
| 244 | |
| 245 | #define OSCAP_XML_XSIcxx . . $ `src/XCCDF/benchmark.c:245:9`! BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "http://www.w3.org/XML/1998/namespace" |
| 246 | xmlNodecxx . . $ xmlNode# *xccdf_benchmark_to_domcxx . . $ xccdf_benchmark_to_dom(64b01a118b7aa38e).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, xmlDocPtrcxx . . $ xmlDocPtr# doc, |
| 247 | xmlNodecxx . . $ xmlNode# *parent, void *user_args) |
| 248 | { |
| 249 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *version_info = xccdf_benchmark_get_schema_versioncxx . . $ xccdf_benchmark_get_schema_version(d71c39bb737b7106).(benchmark); |
| 250 | |
| 251 | xmlNodePtrcxx . . $ xmlNodePtr# root_node = xccdf_item_to_domcxx . . $ xccdf_item_to_dom(974faac3a53a529f).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark), doc, parent, version_info); |
| 252 | if (parent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 253 | xmlDocSetRootElementcxx . . $ xmlDocSetRootElement(ad0e42d5f79fdac5).(doc, root_node); |
| 254 | } |
| 255 | |
| 256 | // FIXME! |
| 257 | //xmlNewProp(root_node, BAD_CAST "xsi:schemaLocation", BAD_CAST XCCDF_SCHEMA_LOCATION); |
| 258 | |
| 259 | lookup_xsi_nscxx . . $ lookup_xsi_ns(3e517de3a327c4f9).(doc); |
| 260 | |
| 261 | /* Handle attributes */ |
| 262 | if (xccdf_benchmark_get_resolvedcxx . . $ xccdf_benchmark_get_resolved(8f09e366eefbe28).(benchmark)) |
| 263 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(root_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "resolved", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "1"); |
| 264 | else |
| 265 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(root_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "resolved", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "0"); |
| 266 | |
| 267 | const char *xmllang = xccdf_benchmark_get_langcxx . . $ xccdf_benchmark_get_lang(6371e83a9c397dc3).(benchmark); |
| 268 | if (xmllang) { |
| 269 | xmlNscxx . . $ xmlNs# *ns_xml = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, root_node, OSCAP_XML_XSIcxx . . $ `src/XCCDF/benchmark.c:245:9`!); |
| 270 | if (ns_xml == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 271 | ns_xml = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OSCAP_XML_XSIcxx . . $ `src/XCCDF/benchmark.c:245:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "xml"); |
| 272 | } |
| 273 | xmlNewNsPropcxx . . $ xmlNewNsProp(9b3cf13d34b7936f).(root_node, ns_xml, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "lang", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! xmllang); |
| 274 | } |
| 275 | |
| 276 | const char *style = xccdf_benchmark_get_stylecxx . . $ xccdf_benchmark_get_style(6371e83a9c397dc3).(benchmark); |
| 277 | if (style) |
| 278 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(root_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "style", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! style); |
| 279 | |
| 280 | const char *style_href = xccdf_benchmark_get_style_hrefcxx . . $ xccdf_benchmark_get_style_href(6371e83a9c397dc3).(benchmark); |
| 281 | if (style_href) |
| 282 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(root_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "style-href", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! style_href); |
| 283 | |
| 284 | // Export plain-text elements |
| 285 | struct xccdf_plain_text_iteratorcxx . . $ xccdf_plain_text_iterator# *plain_text_it = xccdf_benchmark_get_plain_textscxx . . $ xccdf_benchmark_get_plain_texts(6f3ec7b9bdd62bf0).(benchmark); |
| 286 | while (xccdf_plain_text_iterator_has_morecxx . . $ xccdf_plain_text_iterator_has_more(3c593b24e474c434).(plain_text_it)) { |
| 287 | struct xccdf_plain_textcxx . . $ xccdf_plain_text# *plain_text = xccdf_plain_text_iterator_nextcxx . . $ xccdf_plain_text_iterator_next(37542c17208b4f93).(plain_text_it); |
| 288 | xccdf_plain_text_to_domcxx . . $ xccdf_plain_text_to_dom(743049a66c9e463).(plain_text, doc, root_node, version_info); |
| 289 | } |
| 290 | xccdf_plain_text_iterator_freecxx . . $ xccdf_plain_text_iterator_free(1b9ed9b566dd8186).(plain_text_it); |
| 291 | |
| 292 | /* Handle children */ |
| 293 | if (xccdf_benchmark_get_cpe_listcxx . . $ xccdf_benchmark_get_cpe_list(4ac24f742972c093).(benchmark)) { |
| 294 | // CPE API can only export via xmlTextWriter, we export via DOM |
| 295 | // this is used to bridge both methods |
| 296 | xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer = xmlNewTextWriterTreecxx . . $ xmlNewTextWriterTree(a1a9c6c6ad55dc95).(doc, root_node, 0); |
| 297 | cpe_dict_exportcxx . . $ cpe_dict_export(4b5b08d0da02f342).(xccdf_benchmark_get_cpe_listcxx . . $ xccdf_benchmark_get_cpe_list(4ac24f742972c093).(benchmark), writer); |
| 298 | xmlFreeTextWritercxx . . $ xmlFreeTextWriter(30c71198a738ce89).(writer); |
| 299 | } |
| 300 | if (xccdf_benchmark_get_cpe_lang_modelcxx . . $ xccdf_benchmark_get_cpe_lang_model(abf6c9caef5e0812).(benchmark)) { |
| 301 | // CPE API can only export via xmlTextWriter, we export via DOM |
| 302 | // this is used to bridge both methods |
| 303 | xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer = xmlNewTextWriterTreecxx . . $ xmlNewTextWriterTree(a1a9c6c6ad55dc95).(doc, root_node, 0); |
| 304 | cpe_lang_exportcxx . . $ cpe_lang_export(9a8ebb3e231da47).(xccdf_benchmark_get_cpe_lang_modelcxx . . $ xccdf_benchmark_get_cpe_lang_model(abf6c9caef5e0812).(benchmark), writer); |
| 305 | xmlFreeTextWritercxx . . $ xmlFreeTextWriter(30c71198a738ce89).(writer); |
| 306 | } |
| 307 | |
| 308 | xmlNscxx . . $ xmlNs# *ns_xccdf = lookup_xccdf_nscxx . . $ lookup_xccdf_ns(145fb009c13e3a1).(doc, root_node, version_info); |
| 309 | |
| 310 | struct oscap_string_iteratorcxx . . $ oscap_string_iterator# *platforms = xccdf_benchmark_get_platformscxx . . $ xccdf_benchmark_get_platforms(84ee444fbe876eda).(benchmark); |
| 311 | while (oscap_string_iterator_has_morecxx . . $ oscap_string_iterator_has_more(3724f2faf2515a82).(platforms)) { |
| 312 | xmlNodecxx . . $ xmlNode# *platform_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "platform", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 313 | |
| 314 | const char *idref = oscap_string_iterator_nextcxx . . $ oscap_string_iterator_next(1f2a9ae2534eef34).(platforms); |
| 315 | if (idref) |
| 316 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(platform_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "idref", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! idref); |
| 317 | } |
| 318 | oscap_string_iterator_freecxx . . $ oscap_string_iterator_free(41a77e9ce361f406).(platforms); |
| 319 | |
| 320 | const char *version = xccdf_benchmark_get_versioncxx . . $ xccdf_benchmark_get_version(6371e83a9c397dc3).(benchmark); |
| 321 | if (version) { |
| 322 | xmlNodePtrcxx . . $ xmlNodePtr# version_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "version", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! version); |
| 323 | |
| 324 | const char *version_time = xccdf_benchmark_get_version_timecxx . . $ xccdf_benchmark_get_version_time(6371e83a9c397dc3).(benchmark); |
| 325 | if (version_time) |
| 326 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(version_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "time", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! version_time); |
| 327 | |
| 328 | const char *version_update = xccdf_benchmark_get_version_updatecxx . . $ xccdf_benchmark_get_version_update(6371e83a9c397dc3).(benchmark); |
| 329 | if (version_update) |
| 330 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(version_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "update", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! version_update); |
| 331 | } |
| 332 | |
| 333 | struct oscap_string_iteratorcxx . . $ oscap_string_iterator#* metadata = xccdf_item_get_metadatacxx . . $ xccdf_item_get_metadata(aa681965e3ad4ccf).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)); |
| 334 | while (oscap_string_iterator_has_morecxx . . $ oscap_string_iterator_has_more(3724f2faf2515a82).(metadata)) |
| 335 | { |
| 336 | const char* meta = oscap_string_iterator_nextcxx . . $ oscap_string_iterator_next(1f2a9ae2534eef34).(metadata); |
| 337 | xmlNodecxx . . $ xmlNode# *m = oscap_xmlstr_to_domcxx . . $ oscap_xmlstr_to_dom(5514c3fae3f75267).(root_node, "metadata", meta); |
| 338 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(m, ns_xccdf); |
| 339 | } |
| 340 | oscap_string_iterator_freecxx . . $ oscap_string_iterator_free(41a77e9ce361f406).(metadata); |
| 341 | |
| 342 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_model, model, xccdf_benchmark_get_models(benchmark)) { |
| 343 | xmlNodecxx . . $ xmlNode# *model_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "model", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 344 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(model_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "system", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! xccdf_model_get_systemcxx . . $ xccdf_model_get_system(2767d91305b32d1).(model)); |
| 345 | } |
| 346 | |
| 347 | struct xccdf_profile_iteratorcxx . . $ xccdf_profile_iterator# *profiles = xccdf_benchmark_get_profilescxx . . $ xccdf_benchmark_get_profiles(c49c4abda143290c).(benchmark); |
| 348 | while (xccdf_profile_iterator_has_morecxx . . $ xccdf_profile_iterator_has_more(adef36931cdf4bdd).(profiles)) { |
| 349 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = xccdf_profile_iterator_nextcxx . . $ xccdf_profile_iterator_next(4851320650739603).(profiles); |
| 350 | xccdf_item_to_domcxx . . $ xccdf_item_to_dom(974faac3a53a529f).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(profile), doc, root_node, version_info); |
| 351 | } |
| 352 | xccdf_profile_iterator_freecxx . . $ xccdf_profile_iterator_free(e346a4b111941870).(profiles); |
| 353 | |
| 354 | struct xccdf_value_iteratorcxx . . $ xccdf_value_iterator# *values = xccdf_benchmark_get_valuescxx . . $ xccdf_benchmark_get_values(2a6ced3aecb31917).(benchmark); |
| 355 | while (xccdf_value_iterator_has_morecxx . . $ xccdf_value_iterator_has_more(bc25df683f527b01).(values)) { |
| 356 | struct xccdf_valuecxx . . $ xccdf_value# *value = xccdf_value_iterator_nextcxx . . $ xccdf_value_iterator_next(7466feec91220de5).(values); |
| 357 | xccdf_item_to_domcxx . . $ xccdf_item_to_dom(974faac3a53a529f).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value), doc, root_node, version_info); |
| 358 | } |
| 359 | xccdf_value_iterator_freecxx . . $ xccdf_value_iterator_free(ba449c68b21eaa11).(values); |
| 360 | |
| 361 | struct xccdf_item_iteratorcxx . . $ xccdf_item_iterator# *items = xccdf_benchmark_get_contentcxx . . $ xccdf_benchmark_get_content(630a032521212bb1).(benchmark); |
| 362 | while (xccdf_item_iterator_has_morecxx . . $ xccdf_item_iterator_has_more(c8a83ac60f16d388).(items)) { |
| 363 | struct xccdf_itemcxx . . $ xccdf_item# *item = xccdf_item_iterator_nextcxx . . $ xccdf_item_iterator_next(73e3c3f4fb48321d).(items); |
| 364 | if (XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(xccdf_item_get_parent(item)) == benchmark) |
| 365 | xccdf_item_to_domcxx . . $ xccdf_item_to_dom(974faac3a53a529f).(item, doc, root_node, version_info); |
| 366 | } |
| 367 | xccdf_item_iterator_freecxx . . $ xccdf_item_iterator_free(5a27e088a1e93c63).(items); |
| 368 | |
| 369 | struct xccdf_result_iteratorcxx . . $ xccdf_result_iterator# *results = xccdf_benchmark_get_resultscxx . . $ xccdf_benchmark_get_results(fbea4b8d76fa1d6a).(benchmark); |
| 370 | while (xccdf_result_iterator_has_morecxx . . $ xccdf_result_iterator_has_more(43a2a759dd12fb20).(results)) { |
| 371 | struct xccdf_resultcxx . . $ xccdf_result# *result = xccdf_result_iterator_nextcxx . . $ xccdf_result_iterator_next(70fb5f80ce5b82b1).(results); |
| 372 | xccdf_item_to_domcxx . . $ xccdf_item_to_dom(974faac3a53a529f).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(result), doc, root_node, version_info); |
| 373 | } |
| 374 | xccdf_result_iterator_freecxx . . $ xccdf_result_iterator_free(fd5dfb6e0ed10cd3).(results); |
| 375 | |
| 376 | return root_node; |
| 377 | } |
| 378 | |
| 379 | void xccdf_benchmark_dumpcxx . . $ xccdf_benchmark_dump(55d89e1b9b447538).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 380 | { |
| 381 | struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark); |
| 382 | printfcxx . . $ printf(581fddd72a8db8fc).("Benchmark : %s\n", (bench ? bench->itemcxx . . $ xccdf_item#item..idcxx . . $ xccdf_item_base#id. : "(NULL)")); |
| 383 | if (bench) { |
| 384 | xccdf_item_printcxx . . $ xccdf_item_print(399eb5318584c7ce).(bench, 1); |
| 385 | printfcxx . . $ printf(581fddd72a8db8fc).(" front m."); |
| 386 | xccdf_print_textlistcxx . . $ xccdf_print_textlist(87adaa5870f6d825).(xccdf_benchmark_get_front_mattercxx . . $ xccdf_benchmark_get_front_matter(c1dea103a1e67322).(benchmark), 2, 80, "..."); |
| 387 | printfcxx . . $ printf(581fddd72a8db8fc).(" rear m."); |
| 388 | xccdf_print_textlistcxx . . $ xccdf_print_textlist(87adaa5870f6d825).(xccdf_benchmark_get_rear_mattercxx . . $ xccdf_benchmark_get_rear_matter(c1dea103a1e67322).(benchmark), 2, 80, "..."); |
| 389 | printfcxx . . $ printf(581fddd72a8db8fc).(" profiles"); |
| 390 | oscap_list_dumpcxx . . $ oscap_list_dump(df0831e7fcc09688).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profilescxx . . $ xccdf_benchmark_item#profiles., xccdf_profile_dumpcxx . . $ xccdf_profile_dump(399eb5318584c7ce)., 2); |
| 391 | printfcxx . . $ printf(581fddd72a8db8fc).(" values"); |
| 392 | oscap_list_dumpcxx . . $ oscap_list_dump(df0831e7fcc09688).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..valuescxx . . $ xccdf_benchmark_item#values., xccdf_value_dumpcxx . . $ xccdf_value_dump(399eb5318584c7ce)., 2); |
| 393 | printfcxx . . $ printf(581fddd72a8db8fc).(" content"); |
| 394 | oscap_list_dumpcxx . . $ oscap_list_dump(df0831e7fcc09688).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..contentcxx . . $ xccdf_benchmark_item#content., xccdf_item_dumpcxx . . $ xccdf_item_dump(399eb5318584c7ce)., 2); |
| 395 | printfcxx . . $ printf(581fddd72a8db8fc).(" results"); |
| 396 | oscap_list_dumpcxx . . $ oscap_list_dump(df0831e7fcc09688).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..resultscxx . . $ xccdf_benchmark_item#results., (oscap_dump_funccxx . . $ oscap_dump_func#) xccdf_result_dumpcxx . . $ xccdf_result_dump(e76502234baee0b2)., 2); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | void xccdf_benchmark_freecxx . . $ xccdf_benchmark_free(55d89e1b9b447538).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 401 | { |
| 402 | if (benchmark) { |
| 403 | struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark); |
| 404 | freecxx . . $ free(5d22bdacc48458e8).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..stylecxx . . $ xccdf_benchmark_item#style.); |
| 405 | freecxx . . $ free(5d22bdacc48458e8).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..style_hrefcxx . . $ xccdf_benchmark_item#style_href.); |
| 406 | freecxx . . $ free(5d22bdacc48458e8).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..langcxx . . $ xccdf_benchmark_item#lang.); |
| 407 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..front_mattercxx . . $ xccdf_benchmark_item#front_matter., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oscap_text_freecxx . . $ oscap_text_free(c2630df24779e845).); |
| 408 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..rear_mattercxx . . $ xccdf_benchmark_item#rear_matter., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oscap_text_freecxx . . $ oscap_text_free(c2630df24779e845).); |
| 409 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..noticescxx . . $ xccdf_benchmark_item#notices., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_notice_freecxx . . $ xccdf_notice_free(6150e2ece2a942c0).); |
| 410 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..modelscxx . . $ xccdf_benchmark_item#models., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_model_freecxx . . $ xccdf_model_free(2490bc1030b8351b).); |
| 411 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..contentcxx . . $ xccdf_benchmark_item#content., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_item_freecxx . . $ xccdf_item_free(9e1ae929b010245a).); |
| 412 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..valuescxx . . $ xccdf_benchmark_item#values., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_value_freecxx . . $ xccdf_value_free(9e1ae929b010245a).); |
| 413 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..resultscxx . . $ xccdf_benchmark_item#results., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_result_freecxx . . $ xccdf_result_free(731f9fbfcaef207c).); |
| 414 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..plain_textscxx . . $ xccdf_benchmark_item#plain_texts., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_plain_text_freecxx . . $ xccdf_plain_text_free(a932b02c5bb85391).); |
| 415 | cpe_dict_model_freecxx . . $ cpe_dict_model_free(99656294ab2c75d7).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_listcxx . . $ xccdf_benchmark_item#cpe_list.); |
| 416 | cpe_lang_model_freecxx . . $ cpe_lang_model_free(c742481f50ae5bc0).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_lang_modelcxx . . $ xccdf_benchmark_item#cpe_lang_model.); |
| 417 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profilescxx . . $ xccdf_benchmark_item#profiles., (oscap_destruct_funccxx . . $ oscap_destruct_func#) xccdf_profile_freecxx . . $ xccdf_profile_free(9e1ae929b010245a).); |
| 418 | oscap_htable_free0cxx . . $ oscap_htable_free0(dbd8f9d05ba37fd5).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..items_dictcxx . . $ xccdf_benchmark_item#items_dict.); |
| 419 | oscap_htable_free0cxx . . $ oscap_htable_free0(dbd8f9d05ba37fd5).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profiles_dictcxx . . $ xccdf_benchmark_item#profiles_dict.); |
| 420 | oscap_htable_free0cxx . . $ oscap_htable_free0(dbd8f9d05ba37fd5).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..results_dictcxx . . $ xccdf_benchmark_item#results_dict.); |
| 421 | oscap_htable_freecxx . . $ oscap_htable_free(efa5da5da5d523d).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..clusters_dictcxx . . $ xccdf_benchmark_item#clusters_dict., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oscap_htable_free0cxx . . $ oscap_htable_free0(dbd8f9d05ba37fd5).); |
| 422 | xccdf_item_releasecxx . . $ xccdf_item_release(9e1ae929b010245a).(bench); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | XCCDF_ACCESSOR_SIMPLEcxx . . $ `src/XCCDF/helpers.h:115:9`!(benchmark, const struct xccdf_version_info*, schema_version); |
| 427 | XCCDF_ACCESSOR_STRINGcxx . . $ `src/XCCDF/helpers.h:113:9`!(benchmark, style) |
| 428 | XCCDF_ACCESSOR_STRINGcxx . . $ `src/XCCDF/helpers.h:113:9`!(benchmark, style_href) |
| 429 | XCCDF_ACCESSOR_STRINGcxx . . $ `src/XCCDF/helpers.h:113:9`!(benchmark, lang) |
| 430 | XCCDF_LISTMANIP_TEXTcxx . . $ `src/XCCDF/helpers.h:128:9`!(benchmark, front_matter, front_matter) |
| 431 | XCCDF_LISTMANIP_TEXTcxx . . $ `src/XCCDF/helpers.h:128:9`!(benchmark, rear_matter, rear_matter) |
| 432 | XCCDF_LISTMANIPcxx . . $ `src/XCCDF/helpers.h:122:9`!(benchmark, notice, notices) |
| 433 | XCCDF_LISTMANIPcxx . . $ `src/XCCDF/helpers.h:122:9`!(benchmark, model, models) |
| 434 | XCCDF_BENCHMARK_IGETTERcxx . . $ `src/XCCDF/helpers.h:73:9`!(item, content) |
| 435 | XCCDF_BENCHMARK_IGETTERcxx . . $ `src/XCCDF/helpers.h:73:9`!(result, results) |
| 436 | XCCDF_BENCHMARK_IGETTERcxx . . $ `src/XCCDF/helpers.h:73:9`!(value, values) |
| 437 | XCCDF_BENCHMARK_IGETTERcxx . . $ `src/XCCDF/helpers.h:73:9`!(profile, profiles) |
| 438 | XCCDF_ITERATOR_GEN_Scxx . . $ `src/XCCDF/helpers.h:218:9`!(notice) |
| 439 | XCCDF_ITERATOR_GEN_Scxx . . $ `src/XCCDF/helpers.h:218:9`!(model) |
| 440 | XCCDF_ITERATOR_GEN_Scxx . . $ `src/XCCDF/helpers.h:218:9`!(profile) |
| 441 | XCCDF_LISTMANIPcxx . . $ `src/XCCDF/helpers.h:122:9`!(benchmark, plain_text, plain_texts) |
| 442 | XCCDF_HTABLE_GETTERcxx . . $ `src/XCCDF/helpers.h:62:9`!(struct xccdf_item *, benchmark, item, sub.benchmark.items_dict) |
| 443 | XCCDF_STATUS_CURRENTcxx . . $ `src/XCCDF/helpers.h:39:9`!(benchmark) |
| 444 | OSCAP_ITERATOR_GENcxx . . $ `src/common/util.h:123:9`!(xccdf_plain_text) |
| 445 | OSCAP_ITERATOR_REMOVE_Fcxx . . $ `src/common/util.h:128:9`!(xccdf_plain_text) |
| 446 | |
| 447 | XCCDF_ITEM_ADDER_REGcxx . . $ `src/XCCDF/helpers.h:206:9`!(benchmark, rule, content) |
| 448 | XCCDF_ITEM_ADDER_REGcxx . . $ `src/XCCDF/helpers.h:206:9`!(benchmark, group, content) |
| 449 | XCCDF_ITEM_ADDER_REGcxx . . $ `src/XCCDF/helpers.h:206:9`!(benchmark, value, values) |
| 450 | XCCDF_ITEM_ADDER_REGcxx . . $ `src/XCCDF/helpers.h:206:9`!(benchmark, profile, profiles) |
| 451 | |
| 452 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_add_resultcxx . . $ xccdf_benchmark_add_result(95f49eec48118fee).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, struct xccdf_resultcxx . . $ xccdf_result# *item) |
| 453 | { |
| 454 | const char *id = xccdf_result_get_idcxx . . $ xccdf_result_get_id(9b243840ec21a788).(item); |
| 455 | if (id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 456 | // Resolve possible conflicts of the IDs in the list of TestResults. |
| 457 | struct xccdf_itemcxx . . $ xccdf_item# *found = xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(benchmark, XCCDF_RESULTcxx . . $ XCCDF_RESULT., id); |
| 458 | if (found != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 459 | if (found == XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(item)) |
| 460 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 461 | // Here is conflict. Generate a new id. |
| 462 | char *new_id = xccdf_benchmark_gen_idcxx . . $ xccdf_benchmark_gen_id(796fffdff15b0400).(benchmark, XCCDF_RESULTcxx . . $ XCCDF_RESULT., id); |
| 463 | xccdf_result_set_idcxx . . $ xccdf_result_set_id(2deabb2a41c12da7).(item, new_id); |
| 464 | freecxx . . $ free(5d22bdacc48458e8).(new_id); |
| 465 | } |
| 466 | } |
| 467 | return xccdf_add_itemcxx . . $ xccdf_add_item(662a42d3b9b63a92).( |
| 468 | ((struct xccdf_itemcxx . . $ xccdf_item#*)benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..resultscxx . . $ xccdf_benchmark_item#results., |
| 469 | ((struct xccdf_itemcxx . . $ xccdf_item#*)benchmark), |
| 470 | ((struct xccdf_itemcxx . . $ xccdf_item#*)item), |
| 471 | "result" "-"); |
| 472 | } |
| 473 | |
| 474 | struct xccdf_profilecxx . . $ xccdf_profile# * |
| 475 | xccdf_benchmark_get_profile_by_idcxx . . $ xccdf_benchmark_get_profile_by_id(34bf61e7e9f7ecd5).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *profile_id) |
| 476 | { |
| 477 | struct xccdf_profile_iteratorcxx . . $ xccdf_profile_iterator# *profit = xccdf_benchmark_get_profilescxx . . $ xccdf_benchmark_get_profiles(c49c4abda143290c).(benchmark); |
| 478 | while (xccdf_profile_iterator_has_morecxx . . $ xccdf_profile_iterator_has_more(adef36931cdf4bdd).(profit)) { |
| 479 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = xccdf_profile_iterator_nextcxx . . $ xccdf_profile_iterator_next(4851320650739603).(profit); |
| 480 | if (profile == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 481 | assertcxx . . $ `/usr/include/assert.h:50:10`!(profile != NULL); |
| 482 | continue; |
| 483 | } |
| 484 | if (oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(xccdf_profile_get_idcxx . . $ xccdf_profile_get_id(d143a4aa05fc37ce).(profile), profile_id)) { |
| 485 | xccdf_profile_iterator_freecxx . . $ xccdf_profile_iterator_free(e346a4b111941870).(profit); |
| 486 | return profile; |
| 487 | } |
| 488 | } |
| 489 | xccdf_profile_iterator_freecxx . . $ xccdf_profile_iterator_free(e346a4b111941870).(profit); |
| 490 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 491 | } |
| 492 | |
| 493 | struct xccdf_resultcxx . . $ xccdf_result# *xccdf_benchmark_get_result_by_idcxx . . $ xccdf_benchmark_get_result_by_id(b753539274b1de3b).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *testresult_id) |
| 494 | { |
| 495 | struct xccdf_resultcxx . . $ xccdf_result# *result = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 496 | if (testresult_id == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 497 | /* Take the latest TestResult by default. It may turn out to be |
| 498 | * a good idea to not change that, since the SCAP-Workbench project |
| 499 | * is assuming thissemantics. */ |
| 500 | struct xccdf_result_iteratorcxx . . $ xccdf_result_iterator# * results_it = xccdf_benchmark_get_resultscxx . . $ xccdf_benchmark_get_results(fbea4b8d76fa1d6a).(benchmark); |
| 501 | while (xccdf_result_iterator_has_morecxx . . $ xccdf_result_iterator_has_more(43a2a759dd12fb20).(results_it)) |
| 502 | result = xccdf_result_iterator_nextcxx . . $ xccdf_result_iterator_next(70fb5f80ce5b82b1).(results_it); |
| 503 | xccdf_result_iterator_freecxx . . $ xccdf_result_iterator_free(fd5dfb6e0ed10cd3).(results_it); |
| 504 | } else { |
| 505 | result = XRESULTcxx . . $ `src/XCCDF/helpers.h:37:9`!(xccdf_benchmark_get_member(benchmark, XCCDF_RESULT, testresult_id)); |
| 506 | } |
| 507 | return result; |
| 508 | } |
| 509 | |
| 510 | struct xccdf_resultcxx . . $ xccdf_result# *xccdf_benchmark_get_result_by_id_suffixcxx . . $ xccdf_benchmark_get_result_by_id_suffix(b753539274b1de3b).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *testresult_suffix) |
| 511 | { |
| 512 | struct xccdf_resultcxx . . $ xccdf_result# *result = xccdf_benchmark_get_result_by_idcxx . . $ xccdf_benchmark_get_result_by_id(b753539274b1de3b).(benchmark, testresult_suffix); |
| 513 | if (result != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 514 | return result; |
| 515 | |
| 516 | struct xccdf_result_iteratorcxx . . $ xccdf_result_iterator# *result_iterator = xccdf_benchmark_get_resultscxx . . $ xccdf_benchmark_get_results(fbea4b8d76fa1d6a).(benchmark); |
| 517 | |
| 518 | while (xccdf_result_iterator_has_morecxx . . $ xccdf_result_iterator_has_more(43a2a759dd12fb20).(result_iterator)) { |
| 519 | struct xccdf_resultcxx . . $ xccdf_result# *temp_result = xccdf_result_iterator_nextcxx . . $ xccdf_result_iterator_next(70fb5f80ce5b82b1).(result_iterator); |
| 520 | const char *result_full_id = xccdf_result_get_idcxx . . $ xccdf_result_get_id(9b243840ec21a788).(temp_result); |
| 521 | |
| 522 | if (oscap_str_endswithcxx . . $ oscap_str_endswith(b7a7aa4a824b7595).(result_full_id, testresult_suffix)) { |
| 523 | if (result != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 524 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`!, "Multiple matches found:\n%s\n%s\n", |
| 525 | xccdf_result_get_id(result), result_full_id); |
| 526 | break; |
| 527 | } else { |
| 528 | result = temp_result; |
| 529 | } |
| 530 | } |
| 531 | } |
| 532 | xccdf_result_iterator_freecxx . . $ xccdf_result_iterator_free(fd5dfb6e0ed10cd3).(result_iterator); |
| 533 | return result; |
| 534 | } |
| 535 | |
| 536 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_add_contentcxx . . $ xccdf_benchmark_add_content(8f115eecda56b35c).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *bench, struct xccdf_itemcxx . . $ xccdf_item# *item) |
| 537 | { |
| 538 | if (item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 539 | switch (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)) { |
| 540 | case XCCDF_RULEcxx . . $ XCCDF_RULE.: return xccdf_benchmark_add_rulecxx . . $ xccdf_benchmark_add_rule(5579188b4784412d).(bench, XRULEcxx . . $ `src/XCCDF/helpers.h:34:9`!(item)); |
| 541 | case XCCDF_GROUPcxx . . $ XCCDF_GROUP.: return xccdf_benchmark_add_groupcxx . . $ xccdf_benchmark_add_group(a27292dfc4d851fa).(bench, XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(item)); |
| 542 | case XCCDF_VALUEcxx . . $ XCCDF_VALUE.: return xccdf_benchmark_add_valuecxx . . $ xccdf_benchmark_add_value(4cd9ae2ce48932a1).(bench, XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(item)); |
| 543 | default: return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | |
| 548 | const char *xccdf_benchmark_get_plain_textcxx . . $ xccdf_benchmark_get_plain_text(77f05a18470c256b).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *bench, const char *id) |
| 549 | { |
| 550 | assertcxx . . $ `/usr/include/assert.h:50:10`!(bench != NULL); |
| 551 | |
| 552 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_plain_text, cur, xccdf_benchmark_get_plain_texts(bench)) { |
| 553 | if (oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(cur->idcxx . . $ xccdf_plain_text#id., id)) { |
| 554 | xccdf_plain_text_iterator_freecxx . . $ xccdf_plain_text_iterator_free(1b9ed9b566dd8186).(cur_iter); |
| 555 | return cur->textcxx . . $ xccdf_plain_text#text.; |
| 556 | } |
| 557 | } |
| 558 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 559 | } |
| 560 | |
| 561 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_set_cpe_listcxx . . $ xccdf_benchmark_set_cpe_list(2cf98286b03b0bbc).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, struct cpe_dict_modelcxx . . $ cpe_dict_model#* cpe_list) |
| 562 | { |
| 563 | struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark); |
| 564 | |
| 565 | assertcxx . . $ `/usr/include/assert.h:50:10`!(bench != NULL); |
| 566 | |
| 567 | if (bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_listcxx . . $ xccdf_benchmark_item#cpe_list.) |
| 568 | cpe_dict_model_freecxx . . $ cpe_dict_model_free(99656294ab2c75d7).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_listcxx . . $ xccdf_benchmark_item#cpe_list.); |
| 569 | |
| 570 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_listcxx . . $ xccdf_benchmark_item#cpe_list. = cpe_list; |
| 571 | |
| 572 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 573 | } |
| 574 | |
| 575 | struct cpe_dict_modelcxx . . $ cpe_dict_model# *xccdf_benchmark_get_cpe_listcxx . . $ xccdf_benchmark_get_cpe_list(4ac24f742972c093).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 576 | { |
| 577 | const struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark); |
| 578 | |
| 579 | assertcxx . . $ `/usr/include/assert.h:50:10`!(bench != NULL); |
| 580 | |
| 581 | return bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_listcxx . . $ xccdf_benchmark_item#cpe_list.; |
| 582 | } |
| 583 | |
| 584 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_set_cpe_lang_modelcxx . . $ xccdf_benchmark_set_cpe_lang_model(9f229e5814b5f3f8).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, struct cpe_lang_modelcxx . . $ cpe_lang_model#* cpe_lang_model) |
| 585 | { |
| 586 | struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark); |
| 587 | |
| 588 | assertcxx . . $ `/usr/include/assert.h:50:10`!(bench != NULL); |
| 589 | |
| 590 | if (bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_lang_modelcxx . . $ xccdf_benchmark_item#cpe_lang_model.) |
| 591 | cpe_lang_model_freecxx . . $ cpe_lang_model_free(c742481f50ae5bc0).(bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_lang_modelcxx . . $ xccdf_benchmark_item#cpe_lang_model.); |
| 592 | |
| 593 | bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_lang_modelcxx . . $ xccdf_benchmark_item#cpe_lang_model. = cpe_lang_model; |
| 594 | |
| 595 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 596 | } |
| 597 | |
| 598 | struct cpe_lang_modelcxx . . $ cpe_lang_model# *xccdf_benchmark_get_cpe_lang_modelcxx . . $ xccdf_benchmark_get_cpe_lang_model(abf6c9caef5e0812).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 599 | { |
| 600 | const struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark); |
| 601 | |
| 602 | assertcxx . . $ `/usr/include/assert.h:50:10`!(bench != NULL); |
| 603 | |
| 604 | return bench->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..cpe_lang_modelcxx . . $ xccdf_benchmark_item#cpe_lang_model.; |
| 605 | } |
| 606 | |
| 607 | struct xccdf_noticecxx . . $ xccdf_notice# *xccdf_notice_newcxx . . $ xccdf_notice_new(62cb1962cbabfc1e).(void) |
| 608 | { |
| 609 | struct xccdf_noticecxx . . $ xccdf_notice# *notice = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_noticecxx . . $ xccdf_notice#)); |
| 610 | notice->textcxx . . $ xccdf_notice#text. = oscap_text_new_fullcxx . . $ oscap_text_new_full(c8482059268dd5a5).(XCCDF_TEXT_NOTICEcxx . . $ XCCDF_TEXT_NOTICE., 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`!); |
| 611 | return notice; |
| 612 | } |
| 613 | |
| 614 | struct xccdf_noticecxx . . $ xccdf_notice# *xccdf_notice_clonecxx . . $ xccdf_notice_clone(f7bc39f9a394f508).(const struct xccdf_noticecxx . . $ xccdf_notice# * notice) |
| 615 | { |
| 616 | struct xccdf_noticecxx . . $ xccdf_notice# *new_notice = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_noticecxx . . $ xccdf_notice#)); |
| 617 | new_notice->idcxx . . $ xccdf_notice#id. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(notice->idcxx . . $ xccdf_notice#id.); |
| 618 | new_notice->textcxx . . $ xccdf_notice#text. = oscap_text_clonecxx . . $ oscap_text_clone(ca1982dd7fd7b6b0).(notice->textcxx . . $ xccdf_notice#text.); |
| 619 | return new_notice; |
| 620 | } |
| 621 | |
| 622 | struct xccdf_noticecxx . . $ xccdf_notice# *xccdf_notice_new_parsecxx . . $ xccdf_notice_new_parse(5b12e5bf2a7216d2).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader) |
| 623 | { |
| 624 | struct xccdf_noticecxx . . $ xccdf_notice# *notice = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_noticecxx . . $ xccdf_notice#)); |
| 625 | notice->idcxx . . $ xccdf_notice#id. = xccdf_attribute_copycxx . . $ xccdf_attribute_copy(861b5c6f59611beb).(reader, XCCDFA_IDcxx . . $ XCCDFA_ID.); |
| 626 | notice->textcxx . . $ xccdf_notice#text. = oscap_text_new_parsecxx . . $ oscap_text_new_parse(fc91cb6a8c9d272a).(XCCDF_TEXT_NOTICEcxx . . $ XCCDF_TEXT_NOTICE., reader); |
| 627 | return notice; |
| 628 | } |
| 629 | |
| 630 | void xccdf_notice_dumpcxx . . $ xccdf_notice_dump(cca2353004680fef).(struct xccdf_noticecxx . . $ xccdf_notice# *notice, int depth) |
| 631 | { |
| 632 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 633 | printfcxx . . $ printf(581fddd72a8db8fc).("%.20s: ", xccdf_notice_get_idcxx . . $ xccdf_notice_get_id(4f17f8dd9367ffaa).(notice)); |
| 634 | xccdf_print_max_textcxx . . $ xccdf_print_max_text(fd26ed0363f94f2c).(xccdf_notice_get_textcxx . . $ xccdf_notice_get_text(d8aa9a90039ba49f).(notice), 50, "..."); |
| 635 | printfcxx . . $ printf(581fddd72a8db8fc).("\n"); |
| 636 | } |
| 637 | |
| 638 | void xccdf_notice_freecxx . . $ xccdf_notice_free(6150e2ece2a942c0).(struct xccdf_noticecxx . . $ xccdf_notice# *notice) |
| 639 | { |
| 640 | if (notice) { |
| 641 | freecxx . . $ free(5d22bdacc48458e8).(notice->idcxx . . $ xccdf_notice#id.); |
| 642 | oscap_text_freecxx . . $ oscap_text_free(c2630df24779e845).(notice->textcxx . . $ xccdf_notice#text.); |
| 643 | freecxx . . $ free(5d22bdacc48458e8).(notice); |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | OSCAP_ACCESSOR_STRINGcxx . . $ `src/common/util.h:245:9`!(xccdf_notice, id) |
| 648 | OSCAP_ACCESSOR_TEXTcxx . . $ `src/common/util.h:251:9`!(xccdf_notice, text) |
| 649 | |
| 650 | const char * xccdf_benchmark_supportedcxx . . $ xccdf_benchmark_supported(33a1f659e94feb42).(void) |
| 651 | { |
| 652 | return XCCDF_SUPPORTEDcxx . . $ `src/XCCDF/benchmark.c:43:9`!; |
| 653 | } |
| 654 | |
| 655 | const struct xccdf_version_infocxx . . $ xccdf_version_info# *xccdf_benchmark_supported_schema_versioncxx . . $ xccdf_benchmark_supported_schema_version(3a0923ddb1c19f66).(void) |
| 656 | { |
| 657 | return xccdf_version_info_findcxx . . $ xccdf_version_info_find(f9f562031eb5b14d).(xccdf_benchmark_supportedcxx . . $ xccdf_benchmark_supported(33a1f659e94feb42).()); |
| 658 | } |
| 659 | |
| 660 | struct xccdf_groupcxx . . $ xccdf_group# *xccdf_benchmark_append_new_groupcxx . . $ xccdf_benchmark_append_new_group(7dcb696197ed29db).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *id) |
| 661 | { |
| 662 | if (benchmark == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 663 | struct xccdf_groupcxx . . $ xccdf_group# *group = xccdf_group_newcxx . . $ xccdf_group_new(43c6f8984aa61365).(); |
| 664 | xccdf_group_set_idcxx . . $ xccdf_group_set_id(af27815a81a2e945).(group, id); |
| 665 | xccdf_benchmark_add_groupcxx . . $ xccdf_benchmark_add_group(a27292dfc4d851fa).(benchmark, group); |
| 666 | return group; |
| 667 | } |
| 668 | struct xccdf_valuecxx . . $ xccdf_value# *xccdf_benchmark_append_new_valuecxx . . $ xccdf_benchmark_append_new_value(e75c8c5461abcaa9).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *id, xccdf_value_type_tcxx . . $ xccdf_value_type_t# type) |
| 669 | { |
| 670 | if (benchmark == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 671 | struct xccdf_valuecxx . . $ xccdf_value# *value = xccdf_value_newcxx . . $ xccdf_value_new(b89dbfb1acc93369).(type); |
| 672 | xccdf_value_set_idcxx . . $ xccdf_value_set_id(7d4bf7cddbeb6460).(value, id); |
| 673 | xccdf_benchmark_add_valuecxx . . $ xccdf_benchmark_add_value(4cd9ae2ce48932a1).(benchmark, value); |
| 674 | return value; |
| 675 | } |
| 676 | struct xccdf_rulecxx . . $ xccdf_rule# *xccdf_benchmark_append_new_rulecxx . . $ xccdf_benchmark_append_new_rule(c26f1e5e6b0568fd).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *id) |
| 677 | { |
| 678 | if (benchmark == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 679 | struct xccdf_rulecxx . . $ xccdf_rule# *rule = xccdf_rule_newcxx . . $ xccdf_rule_new(4a927809b3c89669).(); |
| 680 | xccdf_rule_set_idcxx . . $ xccdf_rule_set_id(ab4918a9b8c7811e).(rule, id); |
| 681 | xccdf_benchmark_add_rulecxx . . $ xccdf_benchmark_add_rule(5579188b4784412d).(benchmark, rule); |
| 682 | return rule; |
| 683 | } |
| 684 | |
| 685 | char *xccdf_benchmark_gen_idcxx . . $ xccdf_benchmark_gen_id(796fffdff15b0400).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, xccdf_type_tcxx . . $ xccdf_type_t# type, const char *prefix) |
| 686 | { |
| 687 | assertcxx . . $ `/usr/include/assert.h:50:10`!(prefix != NULL); |
| 688 | |
| 689 | const char *fmt = "%s%03d"; |
| 690 | int length = snprintfcxx . . $ snprintf(ea502d73e74c754c).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0, fmt, prefix, 0); |
| 691 | if (length < 0) |
| 692 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 693 | length++; |
| 694 | char *buff = (char *) calloccxx . . $ calloc(63a7bf2941bfcd7a).(length, sizeof(char)); |
| 695 | int ret; |
| 696 | int i = 0; |
| 697 | |
| 698 | do { |
| 699 | ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buff, length, fmt, prefix, ++i); |
| 700 | if (ret < 0 || ret > length) { |
| 701 | freecxx . . $ free(5d22bdacc48458e8).(buff); |
| 702 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 703 | } |
| 704 | } while (xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(benchmark, type, buff) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 705 | |
| 706 | return buff; |
| 707 | } |
| 708 | |
| 709 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_add_itemcxx . . $ xccdf_add_item(662a42d3b9b63a92).(struct oscap_listcxx . . $ oscap_list# *list, struct xccdf_itemcxx . . $ xccdf_item# *parent, struct xccdf_itemcxx . . $ xccdf_item# *item, const char *prefix) |
| 710 | { |
| 711 | assertcxx . . $ `/usr/include/assert.h:50:10`!(list != NULL); |
| 712 | assertcxx . . $ `/usr/include/assert.h:50:10`!(item != NULL); |
| 713 | |
| 714 | if (parent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 715 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 716 | |
| 717 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *bench = xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(parent); |
| 718 | |
| 719 | if (bench != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 720 | if (xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 721 | item->itemcxx . . $ xccdf_item#item..idcxx . . $ xccdf_item_base#id. = xccdf_benchmark_gen_idcxx . . $ xccdf_benchmark_gen_id(796fffdff15b0400).(bench, xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item), prefix); |
| 722 | |
| 723 | if (xccdf_benchmark_register_itemcxx . . $ xccdf_benchmark_register_item(8f115eecda56b35c).(bench, item)) { |
| 724 | item->itemcxx . . $ xccdf_item#item..parentcxx . . $ xccdf_item_base#parent. = parent; |
| 725 | return oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(list, item); |
| 726 | } |
| 727 | else |
| 728 | assertcxx . . $ `/usr/include/assert.h:50:10`!(false); |
| 729 | } |
| 730 | else return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 731 | |
| 732 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 733 | } |
| 734 | |
| 735 | struct xccdf_itemcxx . . $ xccdf_item# * |
| 736 | xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, xccdf_type_tcxx . . $ xccdf_type_t# type, const char *key) |
| 737 | { |
| 738 | return (struct xccdf_itemcxx . . $ xccdf_item# *)oscap_htable_getcxx . . $ oscap_htable_get(f5c7e8ff6c970cd3).(xccdf_benchmark_find_target_htablecxx . . $ xccdf_benchmark_find_target_htable(5a75bbbd027a1cce).(benchmark, type), key); |
| 739 | } |
| 740 | |
| 741 | static inline boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 742 | _register_item_to_clustercxx . . $ _register_item_to_cluster(8f115eecda56b35c).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, struct xccdf_itemcxx . . $ xccdf_item# *item) |
| 743 | { |
| 744 | if (!oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(xccdf_item_get_cluster_idcxx . . $ xccdf_item_get_cluster_id(b87246382a73d514).(item), "")) { |
| 745 | struct oscap_htablecxx . . $ oscap_htable# *cluster = oscap_htable_getcxx . . $ oscap_htable_get(f5c7e8ff6c970cd3).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..clusters_dictcxx . . $ xccdf_benchmark_item#clusters_dict., xccdf_item_get_cluster_idcxx . . $ xccdf_item_get_cluster_id(b87246382a73d514).(item)); |
| 746 | if (cluster == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 747 | cluster = oscap_htable_newcxx . . $ oscap_htable_new(3c1cb2b6f390ad38).(); |
| 748 | if (cluster == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || !oscap_htable_addcxx . . $ oscap_htable_add(d9abe78f59fa00eb).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..clusters_dictcxx . . $ xccdf_benchmark_item#clusters_dict., xccdf_item_get_cluster_idcxx . . $ xccdf_item_get_cluster_id(b87246382a73d514).(item), cluster)) { |
| 749 | oscap_htable_free0cxx . . $ oscap_htable_free0(dbd8f9d05ba37fd5).(cluster); |
| 750 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 751 | } |
| 752 | } |
| 753 | return oscap_htable_addcxx . . $ oscap_htable_add(d9abe78f59fa00eb).(cluster, xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item), item); |
| 754 | } |
| 755 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 756 | } |
| 757 | |
| 758 | static inline boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 759 | _unregister_item_from_clustercxx . . $ _unregister_item_from_cluster(8f115eecda56b35c).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, struct xccdf_itemcxx . . $ xccdf_item# *item) |
| 760 | { |
| 761 | if (!oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(xccdf_item_get_cluster_idcxx . . $ xccdf_item_get_cluster_id(b87246382a73d514).(item), "")) { |
| 762 | struct oscap_htablecxx . . $ oscap_htable# *cluster = oscap_htable_getcxx . . $ oscap_htable_get(f5c7e8ff6c970cd3).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..clusters_dictcxx . . $ xccdf_benchmark_item#clusters_dict., xccdf_item_get_cluster_idcxx . . $ xccdf_item_get_cluster_id(b87246382a73d514).(item)); |
| 763 | return cluster != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && oscap_htable_detachcxx . . $ oscap_htable_detach(f5c7e8ff6c970cd3).(cluster, xccdf_item_get_cluster_idcxx . . $ xccdf_item_get_cluster_id(b87246382a73d514).(item)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 764 | } |
| 765 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 766 | } |
| 767 | |
| 768 | struct oscap_htable_iteratorcxx . . $ oscap_htable_iterator# * |
| 769 | xccdf_benchmark_get_cluster_itemscxx . . $ xccdf_benchmark_get_cluster_items(8fab0d5eef3ad923).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, const char *cluster_id) |
| 770 | { |
| 771 | /* Get iterator through all items with given cluster-id */ |
| 772 | struct oscap_htablecxx . . $ oscap_htable# *cluster = oscap_htable_getcxx . . $ oscap_htable_get(f5c7e8ff6c970cd3).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..clusters_dictcxx . . $ xccdf_benchmark_item#clusters_dict., cluster_id); |
| 773 | return (cluster == 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`! : oscap_htable_iterator_newcxx . . $ oscap_htable_iterator_new(81743c99830972e7).(cluster); |
| 774 | } |
| 775 | |
| 776 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_register_itemcxx . . $ xccdf_benchmark_register_item(8f115eecda56b35c).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, struct xccdf_itemcxx . . $ xccdf_item# *item) |
| 777 | { |
| 778 | if (benchmark == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 779 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 780 | |
| 781 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) == XCCDF_PROFILEcxx . . $ XCCDF_PROFILE.) { |
| 782 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(item); |
| 783 | |
| 784 | // If the profile is a tailoring profile (== comes from Tailoring element), |
| 785 | // we cannot register it to the Benchmark! |
| 786 | if (xccdf_profile_get_tailoringcxx . . $ xccdf_profile_get_tailoring(5c59b8a90ca1d1a1).(profile)) |
| 787 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 788 | } |
| 789 | |
| 790 | const char *id = xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item); |
| 791 | struct xccdf_itemcxx . . $ xccdf_item# *found = xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(benchmark, xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item), id); |
| 792 | if (found != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return found == item; // already registered |
| 793 | |
| 794 | if (item->typecxx . . $ xccdf_item#type. == XCCDF_GROUPcxx . . $ XCCDF_GROUP.) { |
| 795 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_item, cnt, xccdf_group_get_content(XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(item))) |
| 796 | xccdf_benchmark_register_itemcxx . . $ xccdf_benchmark_register_item(8f115eecda56b35c).(benchmark, cnt); |
| 797 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_value, val, xccdf_group_get_values(XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(item))) |
| 798 | xccdf_benchmark_register_itemcxx . . $ xccdf_benchmark_register_item(8f115eecda56b35c).(benchmark, XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(val)); |
| 799 | } |
| 800 | |
| 801 | return oscap_htable_addcxx . . $ oscap_htable_add(d9abe78f59fa00eb).(xccdf_benchmark_find_target_htablecxx . . $ xccdf_benchmark_find_target_htable(5a75bbbd027a1cce).(benchmark, xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)), xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item), item) && |
| 802 | _register_item_to_clustercxx . . $ _register_item_to_cluster(8f115eecda56b35c).(benchmark, item); |
| 803 | } |
| 804 | |
| 805 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_unregister_itemcxx . . $ xccdf_benchmark_unregister_item(2e673d6708f2d132).(struct xccdf_itemcxx . . $ xccdf_item# *item) |
| 806 | { |
| 807 | if (item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 808 | |
| 809 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *bench = xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(item); |
| 810 | if (bench == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 811 | |
| 812 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) == XCCDF_PROFILEcxx . . $ XCCDF_PROFILE.) { |
| 813 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(item); |
| 814 | |
| 815 | // If the profile is a tailoring profile (== comes from Tailoring element), |
| 816 | // we cannot unregister it from the Benchmark as it was never there! |
| 817 | if (xccdf_profile_get_tailoringcxx . . $ xccdf_profile_get_tailoring(5c59b8a90ca1d1a1).(profile)) |
| 818 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 819 | } |
| 820 | |
| 821 | assertcxx . . $ `/usr/include/assert.h:50:10`!(xccdf_benchmark_get_member(bench, xccdf_item_get_type(item), xccdf_item_get_id(item)) == item); |
| 822 | |
| 823 | return oscap_htable_detachcxx . . $ oscap_htable_detach(f5c7e8ff6c970cd3).(xccdf_benchmark_find_target_htablecxx . . $ xccdf_benchmark_find_target_htable(5a75bbbd027a1cce).(bench, xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)), xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && |
| 824 | _unregister_item_from_clustercxx . . $ _unregister_item_from_cluster(8f115eecda56b35c).(bench, item); |
| 825 | } |
| 826 | |
| 827 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_rename_itemcxx . . $ xccdf_benchmark_rename_item(f2a91ef87fc649ce).(struct xccdf_itemcxx . . $ xccdf_item# *item, const char *newid) |
| 828 | { |
| 829 | if (item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 830 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 831 | |
| 832 | struct xccdf_itemcxx . . $ xccdf_item# *bench = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(xccdf_item_get_benchmark(item)); |
| 833 | |
| 834 | if (bench != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 835 | if (newid != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(XBENCHMARKcxx . . $ `src/XCCDF/helpers.h:31:9`!(bench), xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item), newid) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 836 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; // ID already assigned |
| 837 | |
| 838 | if (xccdf_item_get_idcxx . . $ xccdf_item_get_id(b87246382a73d514).(item) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 839 | xccdf_benchmark_unregister_itemcxx . . $ xccdf_benchmark_unregister_item(2e673d6708f2d132).(item); |
| 840 | |
| 841 | if (newid != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 842 | oscap_htable_addcxx . . $ oscap_htable_add(d9abe78f59fa00eb).(xccdf_benchmark_find_target_htablecxx . . $ xccdf_benchmark_find_target_htable(5a75bbbd027a1cce).(xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(item), xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)), newid, item); |
| 843 | _register_item_to_clustercxx . . $ _register_item_to_cluster(8f115eecda56b35c).(xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(item), item); |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | freecxx . . $ free(5d22bdacc48458e8).(item->itemcxx . . $ xccdf_item#item..idcxx . . $ xccdf_item_base#id.); |
| 848 | item->itemcxx . . $ xccdf_item#item..idcxx . . $ xccdf_item_base#id. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(newid); |
| 849 | |
| 850 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 851 | } |
| 852 | |
| 853 | /** |
| 854 | * Find appropriate hashtable based on the type (xccdf type) of the item. |
| 855 | * Note that IDs of xccdf:Profile and xccdf:Item are not guaranteed to not |
| 856 | * overlap -> thus the need for separate hashtables. |
| 857 | */ |
| 858 | struct oscap_htablecxx . . $ oscap_htable# * |
| 859 | xccdf_benchmark_find_target_htablecxx . . $ xccdf_benchmark_find_target_htable(5a75bbbd027a1cce).(const struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark, xccdf_type_tcxx . . $ xccdf_type_t# type) |
| 860 | { |
| 861 | assertcxx . . $ `/usr/include/assert.h:50:10`!(type & XCCDF_OBJECT); |
| 862 | if (type == XCCDF_PROFILEcxx . . $ XCCDF_PROFILE.) |
| 863 | return XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profiles_dictcxx . . $ xccdf_benchmark_item#profiles_dict.; |
| 864 | if (type == XCCDF_RESULTcxx . . $ XCCDF_RESULT.) |
| 865 | return XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..results_dictcxx . . $ xccdf_benchmark_item#results_dict.; |
| 866 | return XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..items_dictcxx . . $ xccdf_benchmark_item#items_dict.; |
| 867 | } |
| 868 | |
| 869 | int xccdf_benchmark_include_tailored_profilescxx . . $ xccdf_benchmark_include_tailored_profiles(d7a6825148f95977).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 870 | { |
| 871 | struct oscap_listcxx . . $ oscap_list# *profiles = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profilescxx . . $ xccdf_benchmark_item#profiles.; |
| 872 | struct oscap_htable_iteratorcxx . . $ oscap_htable_iterator# *it = oscap_htable_iterator_newcxx . . $ oscap_htable_iterator_new(81743c99830972e7).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)->subcxx . . $ xccdf_item#sub..benchmarkcxx . . $ xccdf_item#$anonymous_type_1#benchmark..profiles_dictcxx . . $ xccdf_benchmark_item#profiles_dict.); |
| 873 | while(oscap_htable_iterator_has_morecxx . . $ oscap_htable_iterator_has_more(eba4198ab3388c55).(it)) { |
| 874 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = oscap_htable_iterator_next_valuecxx . . $ oscap_htable_iterator_next_value(4e1156670e4376db).(it); |
| 875 | if (xccdf_profile_get_tailoringcxx . . $ xccdf_profile_get_tailoring(5c59b8a90ca1d1a1).(profile)) { |
| 876 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(profiles, xccdf_profile_clonecxx . . $ xccdf_profile_clone(34cd8ce00acc5b5e).(profile)); |
| 877 | } |
| 878 | } |
| 879 | oscap_htable_iterator_freecxx . . $ oscap_htable_iterator_free(e07ea5562ff119bd).(it); |
| 880 | return 0; |
| 881 | } |
| 882 | |
| 883 | struct xccdf_plain_textcxx . . $ xccdf_plain_text# *xccdf_plain_text_newcxx . . $ xccdf_plain_text_new(e9a3865a09bc9876).(void) |
| 884 | { |
| 885 | return calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_plain_textcxx . . $ xccdf_plain_text#)); |
| 886 | } |
| 887 | |
| 888 | struct xccdf_plain_textcxx . . $ xccdf_plain_text# *xccdf_plain_text_new_fillcxx . . $ xccdf_plain_text_new_fill(d2622b8a92823c1f).(const char *id, const char *text) |
| 889 | { |
| 890 | struct xccdf_plain_textcxx . . $ xccdf_plain_text# *plain = xccdf_plain_text_newcxx . . $ xccdf_plain_text_new(e9a3865a09bc9876).(); |
| 891 | plain->idcxx . . $ xccdf_plain_text#id. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(id); |
| 892 | plain->textcxx . . $ xccdf_plain_text#text. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(text); |
| 893 | return plain; |
| 894 | } |
| 895 | |
| 896 | static xmlNodecxx . . $ xmlNode# *xccdf_plain_text_to_domcxx . . $ xccdf_plain_text_to_dom(743049a66c9e463).(const struct xccdf_plain_textcxx . . $ xccdf_plain_text# *ptext, xmlDoccxx . . $ xmlDoc# *doc, xmlNodecxx . . $ xmlNode# *parent, const struct xccdf_version_infocxx . . $ xccdf_version_info#* version_info) |
| 897 | { |
| 898 | xmlNscxx . . $ xmlNs# *ns_xccdf = lookup_xccdf_nscxx . . $ lookup_xccdf_ns(145fb009c13e3a1).(doc, parent, version_info); |
| 899 | xmlNodecxx . . $ xmlNode# *ptext_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "plain-text", |
| 900 | BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! (ptext->textcxx . . $ xccdf_plain_text#text. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? "" : ptext->textcxx . . $ xccdf_plain_text#text.)); |
| 901 | if (ptext->idcxx . . $ xccdf_plain_text#id. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 902 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(ptext_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "id", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ptext->idcxx . . $ xccdf_plain_text#id.); |
| 903 | return ptext_node; |
| 904 | } |
| 905 | |
| 906 | struct xccdf_plain_textcxx . . $ xccdf_plain_text# * xccdf_plain_text_clonecxx . . $ xccdf_plain_text_clone(ef56fa70f1a711e8).(const struct xccdf_plain_textcxx . . $ xccdf_plain_text# * pt) |
| 907 | { |
| 908 | struct xccdf_plain_textcxx . . $ xccdf_plain_text# *plain = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_plain_textcxx . . $ xccdf_plain_text#)); |
| 909 | plain->idcxx . . $ xccdf_plain_text#id. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(pt->idcxx . . $ xccdf_plain_text#id.); |
| 910 | plain->textcxx . . $ xccdf_plain_text#text. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(pt->textcxx . . $ xccdf_plain_text#text.); |
| 911 | return plain; |
| 912 | } |
| 913 | |
| 914 | void xccdf_plain_text_freecxx . . $ xccdf_plain_text_free(a932b02c5bb85391).(struct xccdf_plain_textcxx . . $ xccdf_plain_text# *plain) |
| 915 | { |
| 916 | if (plain != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 917 | freecxx . . $ free(5d22bdacc48458e8).(plain->idcxx . . $ xccdf_plain_text#id.); |
| 918 | freecxx . . $ free(5d22bdacc48458e8).(plain->textcxx . . $ xccdf_plain_text#text.); |
| 919 | freecxx . . $ free(5d22bdacc48458e8).(plain); |
| 920 | } |
| 921 | } |
| 922 | |
| 923 | OSCAP_ACCESSOR_STRINGcxx . . $ `src/common/util.h:245:9`!(xccdf_plain_text, id) |
| 924 | OSCAP_ACCESSOR_STRINGcxx . . $ `src/common/util.h:245:9`!(xccdf_plain_text, text) |