| 1 | /* |
| 2 | * Copyright 2010 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 <math.h> |
| 28 | |
| 29 | #include "item.h"cxx . . $ `<file>/src/XCCDF/item.h`/ |
| 30 | #include "helpers.h"cxx . . $ `<file>/src/XCCDF/helpers.h`/ |
| 31 | #include "common/tsort.h"cxx . . $ `<file>/src/common/tsort.h`/ |
| 32 | #include "oscap_helpers.h"cxx . . $ `<file>/src/common/public/oscap_helpers.h`/ |
| 33 | |
| 34 | typedef void (*xccdf_textresolve_funccxx . . $ xccdf_textresolve_func#)(void *child, void *parent); |
| 35 | |
| 36 | static void xccdf_resolve_itemcxx . . $ xccdf_resolve_item(f4a7963ef7a47230).(struct xccdf_itemcxx . . $ xccdf_item# *item, struct xccdf_tailoringcxx . . $ xccdf_tailoring# *tailoring); |
| 37 | static void xccdf_resolve_cleanupcxx . . $ xccdf_resolve_cleanup(9e1ae929b010245a).(struct xccdf_itemcxx . . $ xccdf_item# *item); |
| 38 | |
| 39 | static struct oscap_listcxx . . $ oscap_list# *xccdf_benchmark_resolve_dependenciescxx . . $ xccdf_benchmark_resolve_dependencies(4b21f6a00f4a0fac).(void *itemptr, void *userdata) |
| 40 | { |
| 41 | struct xccdf_itemcxx . . $ xccdf_item# *item = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(itemptr); |
| 42 | struct oscap_listcxx . . $ oscap_list# *ret = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 43 | struct xccdf_value_iteratorcxx . . $ xccdf_value_iterator# *val_it = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 44 | |
| 45 | const char *extends = xccdf_item_get_extendscxx . . $ xccdf_item_get_extends(b87246382a73d514).(item); |
| 46 | if (extends) oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(ret, xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(item), xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item), extends)); |
| 47 | |
| 48 | switch (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)) { |
| 49 | case XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK.: { |
| 50 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_profile, profile, xccdf_benchmark_get_profiles(xccdf_item_to_benchmark(item))) |
| 51 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(ret, profile); |
| 52 | val_it = xccdf_benchmark_get_valuescxx . . $ xccdf_benchmark_get_values(2a6ced3aecb31917).(xccdf_item_to_benchmarkcxx . . $ xccdf_item_to_benchmark(670be6b45aa1b2de).(item)); |
| 53 | break; |
| 54 | } |
| 55 | case XCCDF_GROUPcxx . . $ XCCDF_GROUP.: |
| 56 | val_it = xccdf_group_get_valuescxx . . $ xccdf_group_get_values(e98be977e40fa4cf).(xccdf_item_to_groupcxx . . $ xccdf_item_to_group(7b8647c4cae09ecc).(item)); |
| 57 | default: break; /* no-op */ |
| 58 | } |
| 59 | |
| 60 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_item, child, xccdf_item_get_content(item)) |
| 61 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(ret, child); |
| 62 | |
| 63 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_value, val, val_it) |
| 64 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(ret, val); |
| 65 | |
| 66 | |
| 67 | return ret; |
| 68 | } |
| 69 | |
| 70 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_benchmark_resolvecxx . . $ xccdf_benchmark_resolve(9e5458caf3f9d147).(struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 71 | { |
| 72 | struct oscap_listcxx . . $ oscap_list# *resolve_order = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, *root_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 73 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(root_nodes, benchmark); |
| 74 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! ret = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 75 | |
| 76 | if (oscap_tsortcxx . . $ oscap_tsort(88213e84dd161bc4).(root_nodes, &resolve_order, xccdf_benchmark_resolve_dependenciescxx . . $ xccdf_benchmark_resolve_dependencies(4b21f6a00f4a0fac)., 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`!)) { |
| 77 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_item, item, oscap_iterator_new(resolve_order)) |
| 78 | xccdf_resolve_itemcxx . . $ xccdf_resolve_item(f4a7963ef7a47230).(item, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 79 | ret = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 80 | } |
| 81 | |
| 82 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(root_nodes, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 83 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(resolve_order, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 84 | |
| 85 | xccdf_resolve_cleanupcxx . . $ xccdf_resolve_cleanup(9e1ae929b010245a).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(benchmark)); |
| 86 | |
| 87 | return ret; |
| 88 | } |
| 89 | |
| 90 | // prototypes |
| 91 | static void xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(struct oscap_listcxx . . $ oscap_list# *child_list, struct oscap_listcxx . . $ oscap_list# *parent_list, xccdf_textresolve_funccxx . . $ xccdf_textresolve_func# more); |
| 92 | static void xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(struct oscap_listcxx . . $ oscap_list# **child_list, struct oscap_listcxx . . $ oscap_list# *parent_list, oscap_cmp_funccxx . . $ oscap_cmp_func# item_compare, oscap_clone_funccxx . . $ oscap_clone_func# cloner, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! prepend); |
| 93 | static void xccdf_resolve_value_instancecxx . . $ xccdf_resolve_value_instance(b580f10ef0cef11e).(struct xccdf_value_instancecxx . . $ xccdf_value_instance# *child, struct xccdf_value_instancecxx . . $ xccdf_value_instance# *parent); |
| 94 | static void xccdf_resolve_profilecxx . . $ xccdf_resolve_profile(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent); |
| 95 | static void xccdf_resolve_groupcxx . . $ xccdf_resolve_group(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent); |
| 96 | static void xccdf_resolve_rulecxx . . $ xccdf_resolve_rule(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent); |
| 97 | static void xccdf_resolve_valuecxx . . $ xccdf_resolve_value(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent); |
| 98 | |
| 99 | static void xccdf_resolve_warningcxx . . $ xccdf_resolve_warning(6c58c5e2437d25a2).(void *w1, void *w2) { |
| 100 | if (xccdf_warning_get_categorycxx . . $ xccdf_warning_get_category(182d2446532a6655).(w1) == 0) |
| 101 | xccdf_warning_set_categorycxx . . $ xccdf_warning_set_category(973d6a5e71fe0c49).(w1, xccdf_warning_get_categorycxx . . $ xccdf_warning_get_category(182d2446532a6655).(w2)); |
| 102 | } |
| 103 | |
| 104 | static struct xccdf_profilecxx . . $ xccdf_profile# *_xccdf_tailoring_profile_get_real_parentcxx . . $ _xccdf_tailoring_profile_get_real_parent(b326691ac374e68).(struct xccdf_tailoringcxx . . $ xccdf_tailoring# *tailoring, struct xccdf_profilecxx . . $ xccdf_profile# *profile) |
| 105 | { |
| 106 | const char *extends = xccdf_profile_get_extendscxx . . $ xccdf_profile_get_extends(d143a4aa05fc37ce).(profile); |
| 107 | struct xccdf_profilecxx . . $ xccdf_profile# *parent_from_tailoring = xccdf_tailoring_get_profile_by_idcxx . . $ xccdf_tailoring_get_profile_by_id(a3cce76bafe7a7e1).(tailoring, extends); |
| 108 | if (parent_from_tailoring != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && parent_from_tailoring != profile) { |
| 109 | return parent_from_tailoring; |
| 110 | } |
| 111 | else { |
| 112 | return XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(xccdf_benchmark_get_member(xccdf_profile_get_benchmark(profile), XCCDF_PROFILE, extends)); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | /* |
| 117 | This macro will look for flags that both undefined in the item AND defined |
| 118 | in the ancestor/base item. If such a case occurs we define the flag in our |
| 119 | item to the same value as in the ancestor. |
| 120 | |
| 121 | NOTE: Profile is an Item in current openscap implementation. That is not |
| 122 | how the specification describes it and there are several problems with that. |
| 123 | |
| 124 | Some flags that can be defined for a Profile via the internals can't be |
| 125 | exported without the result being invalid! (e.g. Profile/@hidden) |
| 126 | */ |
| 127 | #define XCCDF_RESOLVE_FLAGcxx . . $ `src/XCCDF/resolve.c:127:9`!(ITEM,PARENT,FLAGNAME) do { \ |
| 128 | if (!ITEM->item.defined_flags.FLAGNAME) { \ |
| 129 | if (PARENT->item.defined_flags.FLAGNAME) { \ |
| 130 | ITEM->item.flags.FLAGNAME = PARENT->item.flags.FLAGNAME; \ |
| 131 | ITEM->item.defined_flags.FLAGNAME = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; \ |
| 132 | } \ |
| 133 | } \ |
| 134 | } while (falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!) |
| 135 | |
| 136 | static void xccdf_resolve_itemcxx . . $ xccdf_resolve_item(f4a7963ef7a47230).(struct xccdf_itemcxx . . $ xccdf_item# *item, struct xccdf_tailoringcxx . . $ xccdf_tailoring# *tailoring) |
| 137 | { |
| 138 | assertcxx . . $ `/usr/include/assert.h:50:10`!(item != NULL); |
| 139 | |
| 140 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) == XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK.) { |
| 141 | xccdf_benchmark_set_resolvedcxx . . $ xccdf_benchmark_set_resolved(9d7adcbca7f23e0e).(xccdf_item_to_benchmarkcxx . . $ xccdf_item_to_benchmark(670be6b45aa1b2de).(item), truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!); |
| 142 | return; // benchmark has no extends |
| 143 | } |
| 144 | |
| 145 | assertcxx . . $ `/usr/include/assert.h:50:10`!(!xccdf_item_get_extends(item) || xccdf_item_get_type(item) & (XCCDF_PROFILE | XCCDF_ITEM)); |
| 146 | struct xccdf_itemcxx . . $ xccdf_item# *parent = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 147 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) == XCCDF_PROFILEcxx . . $ XCCDF_PROFILE. && tailoring != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 148 | parent = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(_xccdf_tailoring_profile_get_real_parent(tailoring, XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(item))); |
| 149 | } |
| 150 | else { |
| 151 | parent = xccdf_benchmark_get_membercxx . . $ xccdf_benchmark_get_member(51139a28f6959fd9).(xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(item), xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item), xccdf_item_get_extendscxx . . $ xccdf_item_get_extends(b87246382a73d514).(item)); |
| 152 | } |
| 153 | if (parent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return; |
| 154 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) != xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(parent)) return; |
| 155 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) == XCCDF_GROUPcxx . . $ XCCDF_GROUP. && xccdf_version_cmpcxx . . $ xccdf_version_cmp(90211f1159e0810f).(xccdf_item_get_schema_versioncxx . . $ xccdf_item_get_schema_version(a15732c9a5bba7d0).(item), "1.2") >= 0) |
| 156 | return; // Group/@extends= has been obsoleted in XCCDF 1.2 |
| 157 | |
| 158 | // resolve flags |
| 159 | XCCDF_RESOLVE_FLAGcxx . . $ `src/XCCDF/resolve.c:127:9`!(item, parent, selected); |
| 160 | XCCDF_RESOLVE_FLAGcxx . . $ `src/XCCDF/resolve.c:127:9`!(item, parent, hidden); |
| 161 | XCCDF_RESOLVE_FLAGcxx . . $ `src/XCCDF/resolve.c:127:9`!(item, parent, prohibit_changes); |
| 162 | XCCDF_RESOLVE_FLAGcxx . . $ `src/XCCDF/resolve.c:127:9`!(item, parent, interactive); |
| 163 | XCCDF_RESOLVE_FLAGcxx . . $ `src/XCCDF/resolve.c:127:9`!(item, parent, multiple); |
| 164 | |
| 165 | // resolve weight & version |
| 166 | if (!item->itemcxx . . $ xccdf_item#item..defined_flagscxx . . $ xccdf_item_base#defined_flags..weightcxx . . $ xccdf_defflags#weight.) |
| 167 | xccdf_item_set_weightcxx . . $ xccdf_item_set_weight(e230b7a66e23fc3a).(item, xccdf_item_get_weightcxx . . $ xccdf_item_get_weight(b4608ad4327a77d1).(parent)); |
| 168 | |
| 169 | if (xccdf_item_get_versioncxx . . $ xccdf_item_get_version(b87246382a73d514).(item) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 170 | xccdf_item_set_versioncxx . . $ xccdf_item_set_version(f2a91ef87fc649ce).(item, xccdf_item_get_versioncxx . . $ xccdf_item_get_version(b87246382a73d514).(parent)); |
| 171 | xccdf_item_set_version_updatecxx . . $ xccdf_item_set_version_update(f2a91ef87fc649ce).(item, xccdf_item_get_version_updatecxx . . $ xccdf_item_get_version_update(b87246382a73d514).(parent)); |
| 172 | xccdf_item_set_version_timecxx . . $ xccdf_item_set_version_time(f2a91ef87fc649ce).(item, xccdf_item_get_version_timecxx . . $ xccdf_item_get_version_time(b87246382a73d514).(parent)); |
| 173 | } |
| 174 | |
| 175 | // resolve textual elements |
| 176 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(item->itemcxx . . $ xccdf_item#item..titlecxx . . $ xccdf_item_base#title., parent->itemcxx . . $ xccdf_item#item..titlecxx . . $ xccdf_item_base#title., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 177 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(item->itemcxx . . $ xccdf_item#item..descriptioncxx . . $ xccdf_item_base#description., parent->itemcxx . . $ xccdf_item#item..descriptioncxx . . $ xccdf_item_base#description., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 178 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(item->itemcxx . . $ xccdf_item#item..questioncxx . . $ xccdf_item_base#question., parent->itemcxx . . $ xccdf_item#item..questioncxx . . $ xccdf_item_base#question., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 179 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(item->itemcxx . . $ xccdf_item#item..rationalecxx . . $ xccdf_item_base#rationale., parent->itemcxx . . $ xccdf_item#item..rationalecxx . . $ xccdf_item_base#rationale., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 180 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(item->itemcxx . . $ xccdf_item#item..warningscxx . . $ xccdf_item_base#warnings., parent->itemcxx . . $ xccdf_item#item..warningscxx . . $ xccdf_item_base#warnings., xccdf_resolve_warningcxx . . $ xccdf_resolve_warning(6c58c5e2437d25a2).); |
| 181 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(item->itemcxx . . $ xccdf_item#item..referencescxx . . $ xccdf_item_base#references., parent->itemcxx . . $ xccdf_item#item..referencescxx . . $ xccdf_item_base#references., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 182 | |
| 183 | // resolve platforms |
| 184 | OSCAP_FOR_STRcxx . . $ `src/common/list.h:163:9`!(platform, xccdf_item_get_platforms(parent)) |
| 185 | xccdf_item_add_platformcxx . . $ xccdf_item_add_platform(f2a91ef87fc649ce).(item, platform); |
| 186 | |
| 187 | // resolve properties specific to particular item type |
| 188 | switch (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)) { |
| 189 | case XCCDF_PROFILEcxx . . $ XCCDF_PROFILE.: xccdf_resolve_profilecxx . . $ xccdf_resolve_profile(7ca6904b033c071a).(item, parent); break; |
| 190 | case XCCDF_GROUPcxx . . $ XCCDF_GROUP.: xccdf_resolve_groupcxx . . $ xccdf_resolve_group(7ca6904b033c071a).(item, parent); break; |
| 191 | case XCCDF_RULEcxx . . $ XCCDF_RULE.: xccdf_resolve_rulecxx . . $ xccdf_resolve_rule(7ca6904b033c071a).(item, parent); break; |
| 192 | case XCCDF_VALUEcxx . . $ XCCDF_VALUE.: xccdf_resolve_valuecxx . . $ xccdf_resolve_value(7ca6904b033c071a).(item, parent); break; |
| 193 | default: assertcxx . . $ `/usr/include/assert.h:50:10`!(false); |
| 194 | } |
| 195 | |
| 196 | // item resolved -> it no longer has a parent |
| 197 | xccdf_item_set_extendscxx . . $ xccdf_item_set_extends(f2a91ef87fc649ce).(item, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 198 | } |
| 199 | |
| 200 | // resolve textlists |
| 201 | static void xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(struct oscap_listcxx . . $ oscap_list# *child_list, struct oscap_listcxx . . $ oscap_list# *parent_list, xccdf_textresolve_funccxx . . $ xccdf_textresolve_func# more) |
| 202 | { |
| 203 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(oscap_text, child, oscap_iterator_new(child_list)) { |
| 204 | if (oscap_text_get_overridescxx . . $ oscap_text_get_overrides(b63bfab56583660c).(child)) continue; |
| 205 | |
| 206 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(oscap_text, parent, oscap_iterator_new(parent_list)) { |
| 207 | if (oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(oscap_text_get_langcxx . . $ oscap_text_get_lang(ba0993cb6b641422).(child), oscap_text_get_langcxx . . $ oscap_text_get_lang(ba0993cb6b641422).(parent))) { |
| 208 | char *text = oscap_sprintfcxx . . $ oscap_sprintf(a849077ff1b8d812).("%s%s", oscap_text_get_textcxx . . $ oscap_text_get_text(ba0993cb6b641422).(parent), oscap_text_get_textcxx . . $ oscap_text_get_text(ba0993cb6b641422).(child)); |
| 209 | oscap_text_set_textcxx . . $ oscap_text_set_text(8aa69a4864e2c57).(child, text); |
| 210 | freecxx . . $ free(5d22bdacc48458e8).(text); |
| 211 | if (more) more(child, parent); |
| 212 | break; |
| 213 | } |
| 214 | } |
| 215 | oscap_text_iterator_freecxx . . $ oscap_text_iterator_free(f60c6cfdbf1f29d7).(parent_iter); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | static void xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(struct oscap_listcxx . . $ oscap_list# **child_list, struct oscap_listcxx . . $ oscap_list# *parent_list, |
| 220 | oscap_cmp_funccxx . . $ oscap_cmp_func# item_compare, oscap_clone_funccxx . . $ oscap_clone_func# cloner, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! prepend) |
| 221 | { |
| 222 | struct oscap_iteratorcxx . . $ oscap_iterator# *parent_iter = oscap_iterator_newcxx . . $ oscap_iterator_new(f89fb456dfd589d7).(parent_list); |
| 223 | struct oscap_listcxx . . $ oscap_list# *to_add = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 224 | while (oscap_iterator_has_morecxx . . $ oscap_iterator_has_more(63b1de9a5adb9205).(parent_iter)) { |
| 225 | void *parent = oscap_iterator_nextcxx . . $ oscap_iterator_next(4c75051c806960eb).(parent_iter); |
| 226 | struct oscap_iteratorcxx . . $ oscap_iterator# *child_iter = oscap_iterator_newcxx . . $ oscap_iterator_new(f89fb456dfd589d7).(*child_list); |
| 227 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! found = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 228 | while (oscap_iterator_has_morecxx . . $ oscap_iterator_has_more(63b1de9a5adb9205).(child_iter)) |
| 229 | if (item_compare(parent, oscap_iterator_nextcxx . . $ oscap_iterator_next(4c75051c806960eb).(child_iter))) |
| 230 | found = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 231 | if (!found) oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(to_add, cloner(parent)); |
| 232 | oscap_iterator_freecxx . . $ oscap_iterator_free(3cba44c1b7872358).(child_iter); |
| 233 | } |
| 234 | oscap_iterator_freecxx . . $ oscap_iterator_free(3cba44c1b7872358).(parent_iter); |
| 235 | *child_list = (prepend ? oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(*child_list, to_add) : oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(to_add, *child_list)); |
| 236 | } |
| 237 | |
| 238 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_select_idcmpcxx . . $ xccdf_select_idcmp(838b4d1787e4a177).(void *s1, void *s2) { |
| 239 | return oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(((struct xccdf_selectcxx . . $ xccdf_select#*)s1)->itemcxx . . $ xccdf_select#item., ((struct xccdf_selectcxx . . $ xccdf_select#*)s2)->itemcxx . . $ xccdf_select#item.); |
| 240 | } |
| 241 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_setvalue_idcmpcxx . . $ xccdf_setvalue_idcmp(838b4d1787e4a177).(void *s1, void *s2) { |
| 242 | return oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(((struct xccdf_setvaluecxx . . $ xccdf_setvalue#*)s1)->itemcxx . . $ xccdf_setvalue#item., ((struct xccdf_setvaluecxx . . $ xccdf_setvalue#*)s2)->itemcxx . . $ xccdf_setvalue#item.); |
| 243 | } |
| 244 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_refine_rule_idcmpcxx . . $ xccdf_refine_rule_idcmp(838b4d1787e4a177).(void *s1, void *s2) { |
| 245 | return oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(((struct xccdf_refine_rulecxx . . $ xccdf_refine_rule#*)s1)->itemcxx . . $ xccdf_refine_rule#item., ((struct xccdf_refine_rulecxx . . $ xccdf_refine_rule#*)s2)->itemcxx . . $ xccdf_refine_rule#item.); |
| 246 | } |
| 247 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_refine_value_idcmpcxx . . $ xccdf_refine_value_idcmp(838b4d1787e4a177).(void *s1, void *s2) { |
| 248 | return oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(((struct xccdf_refine_valuecxx . . $ xccdf_refine_value#*)s1)->itemcxx . . $ xccdf_refine_value#item., ((struct xccdf_refine_valuecxx . . $ xccdf_refine_value#*)s2)->itemcxx . . $ xccdf_refine_value#item.); |
| 249 | } |
| 250 | |
| 251 | static void xccdf_resolve_profilecxx . . $ xccdf_resolve_profile(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent) |
| 252 | { |
| 253 | if (child->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..note_tagcxx . . $ xccdf_profile_item#note_tag. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 254 | char *note_tag = oscap_sprintfcxx . . $ oscap_sprintf(a849077ff1b8d812).("%s %s", xccdf_profile_get_note_tagcxx . . $ xccdf_profile_get_note_tag(d143a4aa05fc37ce).(XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(child)), xccdf_profile_get_note_tagcxx . . $ xccdf_profile_get_note_tag(d143a4aa05fc37ce).(XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(parent))); |
| 255 | xccdf_profile_set_note_tagcxx . . $ xccdf_profile_set_note_tag(512554f4e1cc87f7).(XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(child), note_tag); |
| 256 | freecxx . . $ free(5d22bdacc48458e8).(note_tag); |
| 257 | } |
| 258 | |
| 259 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..selectscxx . . $ xccdf_profile_item#selects., parent->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..selectscxx . . $ xccdf_profile_item#selects., xccdf_select_idcmpcxx . . $ xccdf_select_idcmp(838b4d1787e4a177)., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_select_clonecxx . . $ xccdf_select_clone(e7d392ef5505c82c)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 260 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..setvaluescxx . . $ xccdf_profile_item#setvalues., parent->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..setvaluescxx . . $ xccdf_profile_item#setvalues., xccdf_setvalue_idcmpcxx . . $ xccdf_setvalue_idcmp(838b4d1787e4a177)., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_setvalue_clonecxx . . $ xccdf_setvalue_clone(8d0906a43e4543d0)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 261 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..refine_rulescxx . . $ xccdf_profile_item#refine_rules., parent->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..refine_rulescxx . . $ xccdf_profile_item#refine_rules., xccdf_refine_rule_idcmpcxx . . $ xccdf_refine_rule_idcmp(838b4d1787e4a177)., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_refine_rule_clonecxx . . $ xccdf_refine_rule_clone(415ade498b3affa6)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 262 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..refine_valuescxx . . $ xccdf_profile_item#refine_values., parent->subcxx . . $ xccdf_item#sub..profilecxx . . $ xccdf_item#$anonymous_type_1#profile..refine_valuescxx . . $ xccdf_profile_item#refine_values., xccdf_refine_value_idcmpcxx . . $ xccdf_refine_value_idcmp(838b4d1787e4a177)., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_refine_value_clonecxx . . $ xccdf_refine_value_clone(450454803739c0c6)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 263 | } |
| 264 | |
| 265 | static struct xccdf_itemcxx . . $ xccdf_item# *xccdf_resolve_copy_itemcxx . . $ xccdf_resolve_copy_item(6721b4840dba2b39).(struct xccdf_itemcxx . . $ xccdf_item# *src) |
| 266 | { |
| 267 | struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *bench = xccdf_item_get_benchmarkcxx . . $ xccdf_item_get_benchmark(d82532322055a9c9).(src); |
| 268 | const char *prefix = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 269 | switch (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(src)) { |
| 270 | case XCCDF_RULEcxx . . $ XCCDF_RULE.: prefix = "inherited-rule-"; break; |
| 271 | case XCCDF_GROUPcxx . . $ XCCDF_GROUP.: prefix = "inherited-group-"; break; |
| 272 | case XCCDF_VALUEcxx . . $ XCCDF_VALUE.: prefix = "inherited-value-"; break; |
| 273 | default: assertcxx . . $ `/usr/include/assert.h:50:10`!(false); |
| 274 | } |
| 275 | char *newid = xccdf_benchmark_gen_idcxx . . $ xccdf_benchmark_gen_id(796fffdff15b0400).(bench, xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(src), prefix); |
| 276 | struct xccdf_itemcxx . . $ xccdf_item# *clone = xccdf_item_clonecxx . . $ xccdf_item_clone(b4a609d518f04b24).(src); |
| 277 | xccdf_item_set_idcxx . . $ xccdf_item_set_id(f2a91ef87fc649ce).(clone, newid); |
| 278 | freecxx . . $ free(5d22bdacc48458e8).(newid); |
| 279 | return clone; |
| 280 | } |
| 281 | |
| 282 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_incomparablecxx . . $ xccdf_incomparable(838b4d1787e4a177).(void *i1, void *i2) { return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; } |
| 283 | //static void *xccdf_strlist_clone(void *l) { return oscap_list_clone(l, (oscap_clone_func)oscap_strdup); } |
| 284 | |
| 285 | static void xccdf_resolve_groupcxx . . $ xccdf_resolve_group(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent) |
| 286 | { |
| 287 | // TODO: resolve requires properly (how?) |
| 288 | //xccdf_resolve_appendlist(&child->sub.group.requires, parent->sub.group.requires, xccdf_incomparable, xccdf_strlist_clone, false); |
| 289 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..groupcxx . . $ xccdf_item#$anonymous_type_1#group..conflictscxx . . $ xccdf_group_item#conflicts., parent->subcxx . . $ xccdf_item#sub..groupcxx . . $ xccdf_item#$anonymous_type_1#group..conflictscxx . . $ xccdf_group_item#conflicts., (oscap_cmp_funccxx . . $ oscap_cmp_func#)oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595)., (oscap_clone_funccxx . . $ oscap_clone_func#)oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 290 | |
| 291 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_item, item, xccdf_group_get_content(XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(parent))) |
| 292 | xccdf_group_add_contentcxx . . $ xccdf_group_add_content(59a95485d1c1eb4f).(XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(child), xccdf_resolve_copy_itemcxx . . $ xccdf_resolve_copy_item(6721b4840dba2b39).(item)); |
| 293 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_value, val, xccdf_group_get_values(XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(parent))) |
| 294 | xccdf_group_add_valuecxx . . $ xccdf_group_add_value(46e21f86ed7650af).(XGROUPcxx . . $ `src/XCCDF/helpers.h:33:9`!(child), xccdf_item_to_valuecxx . . $ xccdf_item_to_value(6f58a7debac95921).(xccdf_resolve_copy_itemcxx . . $ xccdf_resolve_copy_item(6721b4840dba2b39).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(val)))); |
| 295 | } |
| 296 | |
| 297 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_ident_idcmpcxx . . $ xccdf_ident_idcmp(838b4d1787e4a177).(void *s1, void *s2) { |
| 298 | return oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(((struct xccdf_identcxx . . $ xccdf_ident#*)s1)->idcxx . . $ xccdf_ident#id., ((struct xccdf_identcxx . . $ xccdf_ident#*)s2)->idcxx . . $ xccdf_ident#id.); |
| 299 | } |
| 300 | static void xccdf_resolve_profile_notecxx . . $ xccdf_resolve_profile_note(6c58c5e2437d25a2).(void *p1, void *p2) { |
| 301 | if (xccdf_profile_note_get_reftagcxx . . $ xccdf_profile_note_get_reftag(2fd3d151c036bd3b).(p1) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 302 | xccdf_profile_note_set_reftagcxx . . $ xccdf_profile_note_set_reftag(4a83e84a5936c32c).(p1, xccdf_profile_note_get_reftagcxx . . $ xccdf_profile_note_get_reftag(2fd3d151c036bd3b).(p2)); |
| 303 | } |
| 304 | static void xccdf_resolve_fixtextcxx . . $ xccdf_resolve_fixtext(441c009054340bc5).(struct xccdf_fixtextcxx . . $ xccdf_fixtext# *t1, struct xccdf_fixtextcxx . . $ xccdf_fixtext# *t2) { |
| 305 | if (xccdf_fixtext_get_fixrefcxx . . $ xccdf_fixtext_get_fixref(d33f656e6ec2d499).(t1) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 306 | xccdf_fixtext_set_fixrefcxx . . $ xccdf_fixtext_set_fixref(d92ee3b7adbd501d).(t1, xccdf_fixtext_get_fixrefcxx . . $ xccdf_fixtext_get_fixref(d33f656e6ec2d499).(t2)); |
| 307 | if (xccdf_fixtext_get_disruptioncxx . . $ xccdf_fixtext_get_disruption(c3e8ecf1fcc2b5c6).(t1) == 0) |
| 308 | xccdf_fixtext_set_disruptioncxx . . $ xccdf_fixtext_set_disruption(6bf8919906484303).(t1, xccdf_fixtext_get_disruptioncxx . . $ xccdf_fixtext_get_disruption(c3e8ecf1fcc2b5c6).(t2)); |
| 309 | if (xccdf_fixtext_get_complexitycxx . . $ xccdf_fixtext_get_complexity(c3e8ecf1fcc2b5c6).(t1) == 0) |
| 310 | xccdf_fixtext_set_complexitycxx . . $ xccdf_fixtext_set_complexity(6bf8919906484303).(t1, xccdf_fixtext_get_complexitycxx . . $ xccdf_fixtext_get_complexity(c3e8ecf1fcc2b5c6).(t2)); |
| 311 | } |
| 312 | |
| 313 | static void xccdf_resolve_rulecxx . . $ xccdf_resolve_rule(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent) |
| 314 | { |
| 315 | // TODO: resolve requires properly (how?) |
| 316 | //xccdf_resolve_appendlist(&child->sub.rule.requires, parent->sub.rule.requires, xccdf_incomparable, xccdf_strlist_clone); |
| 317 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..conflictscxx . . $ xccdf_rule_item#conflicts., parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..conflictscxx . . $ xccdf_rule_item#conflicts., (oscap_cmp_funccxx . . $ oscap_cmp_func#)oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595)., (oscap_clone_funccxx . . $ oscap_clone_func#)oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 318 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..identscxx . . $ xccdf_rule_item#idents., parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..identscxx . . $ xccdf_rule_item#idents., (oscap_cmp_funccxx . . $ oscap_cmp_func#)xccdf_ident_idcmpcxx . . $ xccdf_ident_idcmp(838b4d1787e4a177)., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_ident_clonecxx . . $ xccdf_ident_clone(c4fcf9b271bbac33)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 319 | xccdf_resolve_appendlistcxx . . $ xccdf_resolve_appendlist(de3119c4b9f62cba).(&child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..fixescxx . . $ xccdf_rule_item#fixes., parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..fixescxx . . $ xccdf_rule_item#fixes., (oscap_cmp_funccxx . . $ oscap_cmp_func#)xccdf_incomparablecxx . . $ xccdf_incomparable(838b4d1787e4a177)., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_fix_clonecxx . . $ xccdf_fix_clone(9a7f33ce0fad32e3)., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 320 | |
| 321 | if (oscap_list_get_itemcountcxx . . $ oscap_list_get_itemcount(5b766af325364e37).(child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..checkscxx . . $ xccdf_rule_item#checks.) == 0 && oscap_list_get_itemcountcxx . . $ oscap_list_get_itemcount(5b766af325364e37).(parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..checkscxx . . $ xccdf_rule_item#checks.) > 0) { |
| 322 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..checkscxx . . $ xccdf_rule_item#checks., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 323 | child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..checkscxx . . $ xccdf_rule_item#checks. = oscap_list_clonecxx . . $ oscap_list_clone(7e3970b01307df8e).(parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..checkscxx . . $ xccdf_rule_item#checks., (oscap_clone_funccxx . . $ oscap_clone_func#)xccdf_check_clonecxx . . $ xccdf_check_clone(9079e062377838d0).); |
| 324 | } |
| 325 | |
| 326 | if (!child->itemcxx . . $ xccdf_item#item..defined_flagscxx . . $ xccdf_item_base#defined_flags..rolecxx . . $ xccdf_defflags#role.) child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..rolecxx . . $ xccdf_rule_item#role. = parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..rolecxx . . $ xccdf_rule_item#role.; |
| 327 | if (!child->itemcxx . . $ xccdf_item#item..defined_flagscxx . . $ xccdf_item_base#defined_flags..severitycxx . . $ xccdf_defflags#severity.) child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..severitycxx . . $ xccdf_rule_item#severity. = parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..severitycxx . . $ xccdf_rule_item#severity.; |
| 328 | |
| 329 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..profile_notescxx . . $ xccdf_rule_item#profile_notes., parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..profile_notescxx . . $ xccdf_rule_item#profile_notes., xccdf_resolve_profile_notecxx . . $ xccdf_resolve_profile_note(6c58c5e2437d25a2).); |
| 330 | xccdf_resolve_textlistcxx . . $ xccdf_resolve_textlist(18d9f81cfe4af8ff).(child->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..fixtextscxx . . $ xccdf_rule_item#fixtexts., parent->subcxx . . $ xccdf_item#sub..rulecxx . . $ xccdf_item#$anonymous_type_1#rule..fixtextscxx . . $ xccdf_rule_item#fixtexts., (xccdf_textresolve_funccxx . . $ xccdf_textresolve_func#)xccdf_resolve_fixtextcxx . . $ xccdf_resolve_fixtext(441c009054340bc5).); |
| 331 | } |
| 332 | |
| 333 | |
| 334 | static void xccdf_resolve_valuecxx . . $ xccdf_resolve_value(7ca6904b033c071a).(struct xccdf_itemcxx . . $ xccdf_item# *child, struct xccdf_itemcxx . . $ xccdf_item# *parent) |
| 335 | { |
| 336 | if (xccdf_value_get_interface_hintcxx . . $ xccdf_value_get_interface_hint(6d7af891b11e2c1).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(child)) == 0) |
| 337 | child->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..interface_hintcxx . . $ xccdf_value_item#interface_hint. = xccdf_value_get_interface_hintcxx . . $ xccdf_value_get_interface_hint(6d7af891b11e2c1).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(parent)); |
| 338 | if (xccdf_value_get_opercxx . . $ xccdf_value_get_oper(1af997407da308aa).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(child)) == 0) |
| 339 | xccdf_value_set_opercxx . . $ xccdf_value_set_oper(18e639079e2e2b71).(xccdf_item_to_valuecxx . . $ xccdf_item_to_value(6f58a7debac95921).(child), xccdf_value_get_opercxx . . $ xccdf_value_get_oper(1af997407da308aa).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(parent))); |
| 340 | |
| 341 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *inst_child; |
| 342 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_value_instance, inst_parent, xccdf_value_get_instances(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(parent))) { |
| 343 | inst_child = xccdf_value_get_instance_by_selectorcxx . . $ xccdf_value_get_instance_by_selector(1c9d6811ccaf1af0).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(child), xccdf_value_instance_get_selectorcxx . . $ xccdf_value_instance_get_selector(fa38e5a18b4e4656).(inst_parent)); |
| 344 | if (inst_child == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) xccdf_value_add_instancecxx . . $ xccdf_value_add_instance(825a32ff3f04a49d).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(child), xccdf_value_instance_clonecxx . . $ xccdf_value_instance_clone(60fe04fa9b1b865b).(inst_parent)); |
| 345 | else xccdf_resolve_value_instancecxx . . $ xccdf_resolve_value_instance(b580f10ef0cef11e).(inst_child, inst_parent); |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | static void xccdf_resolve_value_instancecxx . . $ xccdf_resolve_value_instance(b580f10ef0cef11e).(struct xccdf_value_instancecxx . . $ xccdf_value_instance# *child, struct xccdf_value_instancecxx . . $ xccdf_value_instance# *parent) |
| 350 | { |
| 351 | assertcxx . . $ `/usr/include/assert.h:50:10`!(child != NULL); |
| 352 | assertcxx . . $ `/usr/include/assert.h:50:10`!(parent != NULL); |
| 353 | assertcxx . . $ `/usr/include/assert.h:50:10`!(oscap_streq(child->selector, parent->selector)); |
| 354 | |
| 355 | if (!child->flagscxx . . $ xccdf_value_instance#flags..value_givencxx . . $ xccdf_value_instance#$anonymous_type_0#value_given.) |
| 356 | child->valuecxx . . $ xccdf_value_instance#value. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(parent->valuecxx . . $ xccdf_value_instance#value.); |
| 357 | if (!child->flagscxx . . $ xccdf_value_instance#flags..defval_givencxx . . $ xccdf_value_instance#$anonymous_type_0#defval_given.) |
| 358 | child->defvalcxx . . $ xccdf_value_instance#defval. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(parent->defvalcxx . . $ xccdf_value_instance#defval.); |
| 359 | if (child->typecxx . . $ xccdf_value_instance#type. == XCCDF_TYPE_STRINGcxx . . $ XCCDF_TYPE_STRING. && child->matchcxx . . $ xccdf_value_instance#match. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 360 | xccdf_value_instance_set_matchcxx . . $ xccdf_value_instance_set_match(24caaf4611b47a18).(child, xccdf_value_instance_get_matchcxx . . $ xccdf_value_instance_get_match(fa38e5a18b4e4656).(parent)); |
| 361 | if (child->typecxx . . $ xccdf_value_instance#type. == XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER.) { |
| 362 | if (isnancxx . . $ `<external>/11263917310783833665/math.h:980:11`!(child->lower_bound)) |
| 363 | child->lower_boundcxx . . $ xccdf_value_instance#lower_bound. = parent->lower_boundcxx . . $ xccdf_value_instance#lower_bound.; |
| 364 | if (isnancxx . . $ `<external>/11263917310783833665/math.h:980:11`!(child->upper_bound)) |
| 365 | child->upper_boundcxx . . $ xccdf_value_instance#upper_bound. = parent->upper_boundcxx . . $ xccdf_value_instance#upper_bound.; |
| 366 | } |
| 367 | |
| 368 | struct oscap_iteratorcxx . . $ oscap_iterator# *it = oscap_iterator_newcxx . . $ oscap_iterator_new(f89fb456dfd589d7).(parent->choicescxx . . $ xccdf_value_instance#choices.); |
| 369 | while (oscap_iterator_has_morecxx . . $ oscap_iterator_has_more(63b1de9a5adb9205).(it)) { |
| 370 | const char *unit = oscap_iterator_nextcxx . . $ oscap_iterator_next(4c75051c806960eb).(it); |
| 371 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(child->choicescxx . . $ xccdf_value_instance#choices., oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(unit)); |
| 372 | } |
| 373 | oscap_iterator_freecxx . . $ oscap_iterator_free(3cba44c1b7872358).(it); |
| 374 | } |
| 375 | |
| 376 | static void xccdf_resolve_cleanupcxx . . $ xccdf_resolve_cleanup(9e1ae929b010245a).(struct xccdf_itemcxx . . $ xccdf_item# *item) |
| 377 | { |
| 378 | if (item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return; |
| 379 | |
| 380 | switch (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)) { |
| 381 | case XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK.: case XCCDF_GROUPcxx . . $ XCCDF_GROUP.: break; |
| 382 | default: return; |
| 383 | } |
| 384 | |
| 385 | if (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item) == XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK.) { |
| 386 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_profile, p, xccdf_benchmark_get_profiles(xccdf_item_to_benchmark(item))) |
| 387 | if (xccdf_profile_get_abstractcxx . . $ xccdf_profile_get_abstract(5c59b8a90ca1d1a1).(p)) |
| 388 | xccdf_profile_iterator_removecxx . . $ xccdf_profile_iterator_remove(e346a4b111941870).(p_iter); |
| 389 | } |
| 390 | |
| 391 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_item, sub, xccdf_item_get_content(item)) { |
| 392 | xccdf_resolve_cleanupcxx . . $ xccdf_resolve_cleanup(9e1ae929b010245a).(sub); |
| 393 | if (xccdf_item_get_abstractcxx . . $ xccdf_item_get_abstract(5f71c692d176a119).(sub)) |
| 394 | xccdf_item_iterator_removecxx . . $ xccdf_item_iterator_remove(5a27e088a1e93c63).(sub_iter); |
| 395 | } |
| 396 | |
| 397 | struct xccdf_value_iteratorcxx . . $ xccdf_value_iterator# *value_it = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 398 | |
| 399 | switch (xccdf_item_get_typecxx . . $ xccdf_item_get_type(3d8d48c673cd637b).(item)) { |
| 400 | case XCCDF_BENCHMARKcxx . . $ XCCDF_BENCHMARK.: value_it = xccdf_benchmark_get_valuescxx . . $ xccdf_benchmark_get_values(2a6ced3aecb31917).(xccdf_item_to_benchmarkcxx . . $ xccdf_item_to_benchmark(670be6b45aa1b2de).(item)); break; |
| 401 | case XCCDF_GROUPcxx . . $ XCCDF_GROUP.: value_it = xccdf_group_get_valuescxx . . $ xccdf_group_get_values(e98be977e40fa4cf).(xccdf_item_to_groupcxx . . $ xccdf_item_to_group(7b8647c4cae09ecc).(item)); break; |
| 402 | default: break; |
| 403 | } |
| 404 | |
| 405 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_value, val, value_it) |
| 406 | if (xccdf_value_get_abstractcxx . . $ xccdf_value_get_abstract(83817b94fe60bc79).(val)) |
| 407 | xccdf_value_iterator_removecxx . . $ xccdf_value_iterator_remove(ba449c68b21eaa11).(val_iter); |
| 408 | } |
| 409 | |
| 410 | static struct oscap_listcxx . . $ oscap_list# *xccdf_tailoring_resolve_dependenciescxx . . $ xccdf_tailoring_resolve_dependencies(4b21f6a00f4a0fac).(void *itemptr, void *userdata) |
| 411 | { |
| 412 | struct xccdf_tailoringcxx . . $ xccdf_tailoring# *tailoring = (struct xccdf_tailoringcxx . . $ xccdf_tailoring#*)userdata; |
| 413 | assertcxx . . $ `/usr/include/assert.h:50:10`!(xccdf_item_get_type(XITEM(itemptr)) == XCCDF_PROFILE); |
| 414 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = XPROFILEcxx . . $ `src/XCCDF/helpers.h:32:9`!(itemptr); |
| 415 | |
| 416 | struct oscap_listcxx . . $ oscap_list# *ret = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 417 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(ret, _xccdf_tailoring_profile_get_real_parentcxx . . $ _xccdf_tailoring_profile_get_real_parent(b326691ac374e68).(tailoring, profile)); |
| 418 | return ret; |
| 419 | } |
| 420 | |
| 421 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_tailoring_resolvecxx . . $ xccdf_tailoring_resolve(371749af73702ffe).(struct xccdf_tailoringcxx . . $ xccdf_tailoring# *tailoring, struct xccdf_benchmarkcxx . . $ xccdf_benchmark# *benchmark) |
| 422 | { |
| 423 | struct oscap_listcxx . . $ oscap_list# *resolve_order = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 424 | struct oscap_listcxx . . $ oscap_list# *profiles = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 425 | |
| 426 | struct xccdf_profile_iteratorcxx . . $ xccdf_profile_iterator# *it = xccdf_tailoring_get_profilescxx . . $ xccdf_tailoring_get_profiles(41ce0c0fc277fbfc).(tailoring); |
| 427 | while (xccdf_profile_iterator_has_morecxx . . $ xccdf_profile_iterator_has_more(adef36931cdf4bdd).(it)) { |
| 428 | struct xccdf_profilecxx . . $ xccdf_profile# *profile = xccdf_profile_iterator_nextcxx . . $ xccdf_profile_iterator_next(4851320650739603).(it); |
| 429 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(profiles, profile); |
| 430 | } |
| 431 | xccdf_profile_iterator_freecxx . . $ xccdf_profile_iterator_free(e346a4b111941870).(it); |
| 432 | |
| 433 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! ret = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 434 | |
| 435 | if (oscap_tsortcxx . . $ oscap_tsort(88213e84dd161bc4).(profiles, &resolve_order, xccdf_tailoring_resolve_dependenciescxx . . $ xccdf_tailoring_resolve_dependencies(4b21f6a00f4a0fac)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, tailoring)) { |
| 436 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_profile, profile, oscap_iterator_new(resolve_order)) |
| 437 | xccdf_resolve_itemcxx . . $ xccdf_resolve_item(f4a7963ef7a47230).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(profile), tailoring); |
| 438 | ret = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 439 | } |
| 440 | |
| 441 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(profiles, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 442 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(resolve_order, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 443 | |
| 444 | return ret; |
| 445 | } |