| 1 | /** |
| 2 | * @file oval_sysEnt.c |
| 3 | * \brief Open Vulnerability and Assessment Language |
| 4 | * |
| 5 | * See more details at http://oval.mitre.org/ |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2009--2013 Red Hat Inc., Durham, North Carolina. |
| 10 | * All Rights Reserved. |
| 11 | * |
| 12 | * This library is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU Lesser General Public |
| 14 | * License as published by the Free Software Foundation; either |
| 15 | * version 2.1 of the License, or (at your option) any later version. |
| 16 | * |
| 17 | * This library is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 20 | * Lesser General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU Lesser General Public |
| 23 | * License along with this library; if not, write to the Free Software |
| 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 | * |
| 26 | * Authors: |
| 27 | * "David Niemoller" <[email protected]> |
| 28 | */ |
| 29 | |
| 30 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 31 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 32 | #endif |
| 33 | |
| 34 | #include <stdlib.h> |
| 35 | #include <stdio.h> |
| 36 | #include <string.h> |
| 37 | |
| 38 | #include "oval_agent_api_impl.h"cxx . . $ `<file>/src/OVAL/oval_agent_api_impl.h`/ |
| 39 | #include "oval_system_characteristics_impl.h"cxx . . $ `<file>/src/OVAL/oval_system_characteristics_impl.h`/ |
| 40 | #include "adt/oval_collection_impl.h"cxx . . $ `<file>/src/OVAL/adt/oval_collection_impl.h`/ |
| 41 | #include "oval_parser_impl.h"cxx . . $ `<file>/src/OVAL/oval_parser_impl.h`/ |
| 42 | #include "oval_definitions_impl.h"cxx . . $ `<file>/src/OVAL/oval_definitions_impl.h`/ |
| 43 | |
| 44 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 45 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 46 | #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/ |
| 47 | |
| 48 | typedef struct oval_sysentcxx . . $ oval_sysent# { |
| 49 | struct oval_syschar_modelcxx . . $ oval_syschar_model# *modelcxx . . $ oval_sysent#model.; |
| 50 | char *namecxx . . $ oval_sysent#name.; |
| 51 | char *valuecxx . . $ oval_sysent#value.; |
| 52 | struct oval_collectioncxx . . $ oval_collection# *record_fieldscxx . . $ oval_sysent#record_fields.; |
| 53 | int maskcxx . . $ oval_sysent#mask.; |
| 54 | oval_datatype_tcxx . . $ oval_datatype_t# datatypecxx . . $ oval_sysent#datatype.; |
| 55 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# statuscxx . . $ oval_sysent#status.; |
| 56 | } oval_sysent_tcxx . . $ oval_sysent_t#; |
| 57 | |
| 58 | struct oval_sysentcxx . . $ oval_sysent# *oval_sysent_newcxx . . $ oval_sysent_new(c036fb16edf539c5).(struct oval_syschar_modelcxx . . $ oval_syschar_model# *model) |
| 59 | { |
| 60 | oval_sysent_tcxx . . $ oval_sysent_t# *sysent = (oval_sysent_tcxx . . $ oval_sysent_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_sysent_tcxx . . $ oval_sysent_t#)); |
| 61 | if (sysent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 62 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 63 | |
| 64 | sysent->namecxx . . $ oval_sysent#name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 65 | sysent->valuecxx . . $ oval_sysent#value. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 66 | sysent->record_fieldscxx . . $ oval_sysent#record_fields. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 67 | sysent->statuscxx . . $ oval_sysent#status. = SYSCHAR_STATUS_UNKNOWNcxx . . $ SYSCHAR_STATUS_UNKNOWN.; |
| 68 | sysent->datatypecxx . . $ oval_sysent#datatype. = OVAL_DATATYPE_UNKNOWNcxx . . $ OVAL_DATATYPE_UNKNOWN.; |
| 69 | sysent->maskcxx . . $ oval_sysent#mask. = 0; |
| 70 | sysent->modelcxx . . $ oval_sysent#model. = model; |
| 71 | return sysent; |
| 72 | } |
| 73 | |
| 74 | struct oval_sysentcxx . . $ oval_sysent# *oval_sysent_clonecxx . . $ oval_sysent_clone(8e59f7875e00dda0).(struct oval_syschar_modelcxx . . $ oval_syschar_model# *new_model, struct oval_sysentcxx . . $ oval_sysent# *old_item) |
| 75 | { |
| 76 | struct oval_sysentcxx . . $ oval_sysent# *new_item = oval_sysent_newcxx . . $ oval_sysent_new(c036fb16edf539c5).(new_model); |
| 77 | |
| 78 | char *old_value = oval_sysent_get_valuecxx . . $ oval_sysent_get_value(cdd7c218673d284b).(old_item); |
| 79 | if (old_value) { |
| 80 | oval_sysent_set_valuecxx . . $ oval_sysent_set_value(7add05201731f099).(new_item, old_value); |
| 81 | } |
| 82 | |
| 83 | char *old_name = oval_sysent_get_namecxx . . $ oval_sysent_get_name(cdd7c218673d284b).(old_item); |
| 84 | if (old_name) { |
| 85 | oval_sysent_set_namecxx . . $ oval_sysent_set_name(7add05201731f099).(new_item, oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(old_name)); |
| 86 | } |
| 87 | |
| 88 | oval_sysent_set_datatypecxx . . $ oval_sysent_set_datatype(2d27dbe318d56fa2).(new_item, oval_sysent_get_datatypecxx . . $ oval_sysent_get_datatype(41d54f612a581adb).(old_item)); |
| 89 | oval_sysent_set_maskcxx . . $ oval_sysent_set_mask(e216175c9e7b8544).(new_item, oval_sysent_get_maskcxx . . $ oval_sysent_get_mask(a4c48af0b03a61f7).(old_item)); |
| 90 | oval_sysent_set_statuscxx . . $ oval_sysent_set_status(c15b317010204511).(new_item, oval_sysent_get_statuscxx . . $ oval_sysent_get_status(bbe986facd39a980).(old_item)); |
| 91 | |
| 92 | return new_item; |
| 93 | } |
| 94 | |
| 95 | void oval_sysent_freecxx . . $ oval_sysent_free(54b5ed53f8eac516).(struct oval_sysentcxx . . $ oval_sysent# *sysent) |
| 96 | { |
| 97 | if (sysent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 98 | return; |
| 99 | |
| 100 | if (sysent->namecxx . . $ oval_sysent#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 101 | freecxx . . $ free(5d22bdacc48458e8).(sysent->namecxx . . $ oval_sysent#name.); |
| 102 | if (sysent->valuecxx . . $ oval_sysent#value. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 103 | freecxx . . $ free(5d22bdacc48458e8).(sysent->valuecxx . . $ oval_sysent#value.); |
| 104 | if (sysent->record_fieldscxx . . $ oval_sysent#record_fields.) |
| 105 | oval_collection_free_itemscxx . . $ oval_collection_free_items(637ec69504f927f1).(sysent->record_fieldscxx . . $ oval_sysent#record_fields., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_record_field_freecxx . . $ oval_record_field_free(4e70384b3dd0de8a).); |
| 106 | |
| 107 | sysent->namecxx . . $ oval_sysent#name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 108 | sysent->valuecxx . . $ oval_sysent#value. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 109 | |
| 110 | freecxx . . $ free(5d22bdacc48458e8).(sysent); |
| 111 | } |
| 112 | |
| 113 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! oval_sysent_iterator_has_morecxx . . $ oval_sysent_iterator_has_more(59acec8e8c3c2bb8).(struct oval_sysent_iteratorcxx . . $ oval_sysent_iterator# *oc_sysent) |
| 114 | { |
| 115 | return oval_collection_iterator_has_morecxx . . $ oval_collection_iterator_has_more(de0650ab9b639739).((struct oval_iteratorcxx . . $ oval_iterator# *) |
| 116 | oc_sysent); |
| 117 | } |
| 118 | |
| 119 | struct oval_sysentcxx . . $ oval_sysent# *oval_sysent_iterator_nextcxx . . $ oval_sysent_iterator_next(4140414cfcc52c9e).(struct oval_sysent_iteratorcxx . . $ oval_sysent_iterator# *oc_sysent) |
| 120 | { |
| 121 | return (struct oval_sysentcxx . . $ oval_sysent# *) |
| 122 | oval_collection_iterator_nextcxx . . $ oval_collection_iterator_next(344074693c9690a9).((struct oval_iteratorcxx . . $ oval_iterator# *)oc_sysent); |
| 123 | } |
| 124 | |
| 125 | void oval_sysent_iterator_freecxx . . $ oval_sysent_iterator_free(f5d8b29a351f840a).(struct oval_sysent_iteratorcxx . . $ oval_sysent_iterator# *oc_sysent) |
| 126 | { |
| 127 | oval_collection_iterator_freecxx . . $ oval_collection_iterator_free(ee496816570b41f7).((struct oval_iteratorcxx . . $ oval_iterator# *)oc_sysent); |
| 128 | } |
| 129 | |
| 130 | char *oval_sysent_get_namecxx . . $ oval_sysent_get_name(cdd7c218673d284b).(struct oval_sysentcxx . . $ oval_sysent# *sysent) |
| 131 | { |
| 132 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 133 | |
| 134 | return sysent->namecxx . . $ oval_sysent#name.; |
| 135 | } |
| 136 | |
| 137 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# oval_sysent_get_statuscxx . . $ oval_sysent_get_status(bbe986facd39a980).(struct oval_sysentcxx . . $ oval_sysent# * sysent) |
| 138 | { |
| 139 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 140 | |
| 141 | return sysent->statuscxx . . $ oval_sysent#status.; |
| 142 | } |
| 143 | |
| 144 | char *oval_sysent_get_valuecxx . . $ oval_sysent_get_value(cdd7c218673d284b).(struct oval_sysentcxx . . $ oval_sysent# *sysent) |
| 145 | { |
| 146 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 147 | |
| 148 | return sysent->valuecxx . . $ oval_sysent#value.; |
| 149 | } |
| 150 | |
| 151 | struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *oval_sysent_get_record_fieldscxx . . $ oval_sysent_get_record_fields(f7c5d78b86516de6).(struct oval_sysentcxx . . $ oval_sysent# *sysent) |
| 152 | { |
| 153 | if (!sysent->record_fieldscxx . . $ oval_sysent#record_fields.) |
| 154 | return (struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *) |
| 155 | oval_collection_iterator_newcxx . . $ oval_collection_iterator_new(b73131c625ff44d1).(); |
| 156 | return (struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *) |
| 157 | oval_collection_iteratorcxx . . $ oval_collection_iterator(8bdeb6a25e21af3e).(sysent->record_fieldscxx . . $ oval_sysent#record_fields.); |
| 158 | } |
| 159 | |
| 160 | oval_datatype_tcxx . . $ oval_datatype_t# oval_sysent_get_datatypecxx . . $ oval_sysent_get_datatype(41d54f612a581adb).(struct oval_sysentcxx . . $ oval_sysent# * sysent) |
| 161 | { |
| 162 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 163 | |
| 164 | return sysent->datatypecxx . . $ oval_sysent#datatype.; |
| 165 | } |
| 166 | |
| 167 | int oval_sysent_get_maskcxx . . $ oval_sysent_get_mask(a4c48af0b03a61f7).(struct oval_sysentcxx . . $ oval_sysent# *sysent) |
| 168 | { |
| 169 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 170 | |
| 171 | return sysent->maskcxx . . $ oval_sysent#mask.; |
| 172 | } |
| 173 | |
| 174 | void oval_sysent_set_namecxx . . $ oval_sysent_set_name(7add05201731f099).(struct oval_sysentcxx . . $ oval_sysent# *sysent, char *name) |
| 175 | { |
| 176 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 177 | if (sysent->namecxx . . $ oval_sysent#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 178 | freecxx . . $ free(5d22bdacc48458e8).(sysent->namecxx . . $ oval_sysent#name.); |
| 179 | sysent->namecxx . . $ oval_sysent#name. = name; |
| 180 | } |
| 181 | |
| 182 | void oval_sysent_set_statuscxx . . $ oval_sysent_set_status(c15b317010204511).(struct oval_sysentcxx . . $ oval_sysent# *sysent, oval_syschar_status_tcxx . . $ oval_syschar_status_t# status) |
| 183 | { |
| 184 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 185 | sysent->statuscxx . . $ oval_sysent#status. = status; |
| 186 | } |
| 187 | |
| 188 | void oval_sysent_set_datatypecxx . . $ oval_sysent_set_datatype(2d27dbe318d56fa2).(struct oval_sysentcxx . . $ oval_sysent# *sysent, oval_datatype_tcxx . . $ oval_datatype_t# datatype) |
| 189 | { |
| 190 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 191 | sysent->datatypecxx . . $ oval_sysent#datatype. = datatype; |
| 192 | } |
| 193 | |
| 194 | void oval_sysent_set_maskcxx . . $ oval_sysent_set_mask(e216175c9e7b8544).(struct oval_sysentcxx . . $ oval_sysent# *sysent, int mask) |
| 195 | { |
| 196 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 197 | sysent->maskcxx . . $ oval_sysent#mask. = mask; |
| 198 | } |
| 199 | |
| 200 | void oval_sysent_set_valuecxx . . $ oval_sysent_set_value(7add05201731f099).(struct oval_sysentcxx . . $ oval_sysent# *sysent, char *value) |
| 201 | { |
| 202 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(sysent); |
| 203 | if (sysent->valuecxx . . $ oval_sysent#value. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 204 | freecxx . . $ free(5d22bdacc48458e8).(sysent->valuecxx . . $ oval_sysent#value.); |
| 205 | sysent->valuecxx . . $ oval_sysent#value. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(value); |
| 206 | } |
| 207 | |
| 208 | void oval_sysent_add_record_fieldcxx . . $ oval_sysent_add_record_field(fec84c93b8a93f0b).(struct oval_sysentcxx . . $ oval_sysent# *sysent, struct oval_record_fieldcxx . . $ oval_record_field# *rf) |
| 209 | { |
| 210 | if (sysent->record_fieldscxx . . $ oval_sysent#record_fields. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 211 | sysent->record_fieldscxx . . $ oval_sysent#record_fields. = oval_collection_newcxx . . $ oval_collection_new(18476da3f812812d).(); |
| 212 | oval_collection_addcxx . . $ oval_collection_add(3c6bf54730c0284).(sysent->record_fieldscxx . . $ oval_sysent#record_fields., rf); |
| 213 | } |
| 214 | |
| 215 | static void oval_sysent_value_consumer_cxx . . $ oval_sysent_value_consumer_(75961c4613ebf8f5).(char *value, void *sysent) |
| 216 | { |
| 217 | oval_sysent_set_valuecxx . . $ oval_sysent_set_value(7add05201731f099).(sysent, value); |
| 218 | } |
| 219 | |
| 220 | static void _oval_sysent_record_field_consumercxx . . $ _oval_sysent_record_field_consumer(ea372371966cfec8).(struct oval_record_fieldcxx . . $ oval_record_field# *rf, |
| 221 | struct oval_sysentcxx . . $ oval_sysent# *sysent) |
| 222 | { |
| 223 | oval_sysent_add_record_fieldcxx . . $ oval_sysent_add_record_field(fec84c93b8a93f0b).(sysent, rf); |
| 224 | } |
| 225 | |
| 226 | static int _oval_sysent_parse_record_fieldcxx . . $ _oval_sysent_parse_record_field(cf369959597901d1).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, |
| 227 | struct oval_parser_contextcxx . . $ oval_parser_context# *context, |
| 228 | void *user) |
| 229 | { |
| 230 | return oval_record_field_parse_tagcxx . . $ oval_record_field_parse_tag(83f56dced9df2cd3).(reader, context, (oscap_consumer_funccxx . . $ oscap_consumer_func#) |
| 231 | &_oval_sysent_record_field_consumercxx . . $ _oval_sysent_record_field_consumer(ea372371966cfec8)., |
| 232 | user, OVAL_RECORD_FIELD_ITEMcxx . . $ OVAL_RECORD_FIELD_ITEM.); |
| 233 | } |
| 234 | |
| 235 | int oval_sysent_parse_tagcxx . . $ oval_sysent_parse_tag(15be0102e7f804c1).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct oval_parser_contextcxx . . $ oval_parser_context# *context, |
| 236 | oval_sysent_consumercxx . . $ oval_sysent_consumer# consumer, void *user) |
| 237 | { |
| 238 | int ret, mask; |
| 239 | char *tagname; |
| 240 | struct oval_sysentcxx . . $ oval_sysent# *sysent; |
| 241 | oval_datatype_tcxx . . $ oval_datatype_t# datatype; |
| 242 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# status; |
| 243 | |
| 244 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(context); |
| 245 | |
| 246 | tagname = (char *) xmlTextReaderLocalNamecxx . . $ xmlTextReaderLocalName(3322afb275581432).(reader); |
| 247 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).("#text", tagname)) { |
| 248 | xmlFreecxx . . $ xmlFree.(tagname); |
| 249 | return 0; |
| 250 | } |
| 251 | |
| 252 | sysent = oval_sysent_newcxx . . $ oval_sysent_new(c036fb16edf539c5).(context->syschar_modelcxx . . $ oval_parser_context#syschar_model.); |
| 253 | oval_sysent_set_namecxx . . $ oval_sysent_set_name(7add05201731f099).(sysent, tagname); |
| 254 | |
| 255 | mask = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "mask", 0); |
| 256 | oval_sysent_set_maskcxx . . $ oval_sysent_set_mask(e216175c9e7b8544).(sysent, mask); |
| 257 | |
| 258 | datatype = oval_datatype_parsecxx . . $ oval_datatype_parse(439a79c16bdf367b).(reader, "datatype", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING.); |
| 259 | oval_sysent_set_datatypecxx . . $ oval_sysent_set_datatype(2d27dbe318d56fa2).(sysent, datatype); |
| 260 | |
| 261 | status = oval_syschar_status_parsecxx . . $ oval_syschar_status_parse(4720313583a348e8).(reader, "status", SYSCHAR_STATUS_EXISTScxx . . $ SYSCHAR_STATUS_EXISTS.); |
| 262 | oval_sysent_set_statuscxx . . $ oval_sysent_set_status(c15b317010204511).(sysent, status); |
| 263 | |
| 264 | if (datatype == OVAL_DATATYPE_RECORDcxx . . $ OVAL_DATATYPE_RECORD.) |
| 265 | ret = oval_parser_parse_tagcxx . . $ oval_parser_parse_tag(4eaaf867ce26f59b).(reader, context, &_oval_sysent_parse_record_fieldcxx . . $ _oval_sysent_parse_record_field(cf369959597901d1)., sysent); |
| 266 | else |
| 267 | ret = oscap_parser_text_valuecxx . . $ oscap_parser_text_value(23cd2d9646b6359b).(reader, &oval_sysent_value_consumer_cxx . . $ oval_sysent_value_consumer_(75961c4613ebf8f5)., sysent); |
| 268 | |
| 269 | if (ret == 0) |
| 270 | (*consumer) (sysent, user); |
| 271 | |
| 272 | return ret; |
| 273 | } |
| 274 | |
| 275 | |
| 276 | void oval_sysent_to_domcxx . . $ oval_sysent_to_dom(b67d3396fad9047f).(struct oval_sysentcxx . . $ oval_sysent# *sysent, xmlDoccxx . . $ xmlDoc# * doc, xmlNodecxx . . $ xmlNode# * parent) |
| 277 | { |
| 278 | struct oval_record_field_iteratorcxx . . $ oval_record_field_iterator# *rf_itr; |
| 279 | xmlNsPtrcxx . . $ xmlNsPtr# ent_ns = parent->nscxx . . $ _xmlNode#ns.; |
| 280 | xmlNodePtrcxx . . $ xmlNodePtr# root_node = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc); |
| 281 | xmlNodecxx . . $ xmlNode# *sysent_tag = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 282 | |
| 283 | char *tagname = oval_sysent_get_namecxx . . $ oval_sysent_get_name(cdd7c218673d284b).(sysent); |
| 284 | char *content = oval_sysent_get_valuecxx . . $ oval_sysent_get_value(cdd7c218673d284b).(sysent); |
| 285 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! mask = oval_sysent_get_maskcxx . . $ oval_sysent_get_mask(a4c48af0b03a61f7).(sysent); |
| 286 | |
| 287 | /* omit the value in oval_results if mask=true */ |
| 288 | if (mask && !xmlStrcmpcxx . . $ xmlStrcmp(e46526da1a64e2fc).(root_node->namecxx . . $ _xmlNode#name., BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! OVAL_ROOT_ELM_RESULTScxx . . $ `src/OVAL/oval_parser_impl.h:40:9`!)) { |
| 289 | sysent_tag = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ent_ns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! tagname, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ""); |
| 290 | } else { |
| 291 | xmlCharcxx . . $ xmlChar# *encoded_content = xmlEncodeEntitiesReentrantcxx . . $ xmlEncodeEntitiesReentrant(c515f14df44ff37e).(doc, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! content); |
| 292 | sysent_tag = xmlNewChildcxx . . $ xmlNewChild(4c74f4d7754e7bc8).(parent, ent_ns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! tagname, encoded_content); |
| 293 | xmlFreecxx . . $ xmlFree.(encoded_content); |
| 294 | } |
| 295 | |
| 296 | if (mask) { |
| 297 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(sysent_tag, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "mask", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "true"); |
| 298 | } |
| 299 | |
| 300 | oval_datatype_tcxx . . $ oval_datatype_t# datatype_index = oval_sysent_get_datatypecxx . . $ oval_sysent_get_datatype(41d54f612a581adb).(sysent); |
| 301 | if (datatype_index != OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING.) { |
| 302 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(sysent_tag, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "datatype", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oval_datatype_get_textcxx . . $ oval_datatype_get_text(a950b89baeb79474).(datatype_index)); |
| 303 | } |
| 304 | |
| 305 | oval_syschar_status_tcxx . . $ oval_syschar_status_t# status_index = oval_sysent_get_statuscxx . . $ oval_sysent_get_status(bbe986facd39a980).(sysent); |
| 306 | if (status_index != SYSCHAR_STATUS_EXISTScxx . . $ SYSCHAR_STATUS_EXISTS.) { |
| 307 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(sysent_tag, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "status", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oval_syschar_status_get_textcxx . . $ oval_syschar_status_get_text(f50b4a8fd3bcb7d8).(status_index)); |
| 308 | } |
| 309 | |
| 310 | rf_itr = oval_sysent_get_record_fieldscxx . . $ oval_sysent_get_record_fields(f7c5d78b86516de6).(sysent); |
| 311 | if (oval_record_field_iterator_has_morecxx . . $ oval_record_field_iterator_has_more(f257abe5c2e43c5d).(rf_itr)) { |
| 312 | xmlNsPtrcxx . . $ xmlNsPtr# field_ns = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, sysent_tag, OVAL_SYSCHAR_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:43:9`!); |
| 313 | if (field_ns == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 314 | field_ns = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc), OVAL_SYSCHAR_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:43:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 315 | } |
| 316 | |
| 317 | while (oval_record_field_iterator_has_morecxx . . $ oval_record_field_iterator_has_more(f257abe5c2e43c5d).(rf_itr)) { |
| 318 | struct oval_record_fieldcxx . . $ oval_record_field# *rf; |
| 319 | |
| 320 | rf = oval_record_field_iterator_nextcxx . . $ oval_record_field_iterator_next(7c2c0ee515333432).(rf_itr); |
| 321 | oval_record_field_to_domcxx . . $ oval_record_field_to_dom(8e1fee8fc719207f).(rf, mask, doc, sysent_tag, field_ns); |
| 322 | } |
| 323 | } |
| 324 | oval_record_field_iterator_freecxx . . $ oval_record_field_iterator_free(6968805da7579f07).(rf_itr); |
| 325 | } |