| 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 | * "Daniel Kopecek" <[email protected]> |
| 21 | */ |
| 22 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 23 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 24 | #endif |
| 25 | |
| 26 | #include "_seap.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/_seap.h`/ |
| 27 | #include <stdarg.h> |
| 28 | #include <string.h> |
| 29 | #include <errno.h> |
| 30 | #include <limits.h> |
| 31 | #include <sys/types.h> |
| 32 | #include <sys/stat.h> |
| 33 | #ifdef OS_WINDOWS |
| 34 | #include <io.h> |
| 35 | #else |
| 36 | #include <unistd.h> |
| 37 | #endif |
| 38 | #include <stdlib.h> |
| 39 | |
| 40 | #include "_seap-types.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/_seap-types.h`/ |
| 41 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 42 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 43 | #include "common/bfind.h"cxx . . $ `<file>/src/common/bfind.h`/ |
| 44 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 45 | #include "probes/public/probe-api.h"cxx . . $ `<file>/src/OVAL/probes/public/probe-api.h`/ |
| 46 | #include "oval_probe_ext.h"cxx . . $ `<file>/src/OVAL/oval_probe_ext.h`/ |
| 47 | #include "oval_sexp.h"cxx . . $ `<file>/src/OVAL/oval_sexp.h`/ |
| 48 | #include "probe-table.h"cxx . . $ `<file>/src/OVAL/probes/public/probe-table.h`/ |
| 49 | #include "_oval_probe_handler.h"cxx . . $ `<file>/src/OVAL/_oval_probe_handler.h`/ |
| 50 | |
| 51 | #define __ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`! 128 |
| 52 | |
| 53 | static oval_pdtbl_tcxx . . $ oval_pdtbl_t# *oval_pdtbl_newcxx . . $ oval_pdtbl_new(c75fa850dd422059).(void); |
| 54 | static void oval_pdtbl_freecxx . . $ oval_pdtbl_free(e9eb6f5a6d560534).(oval_pdtbl_tcxx . . $ oval_pdtbl_t# *table); |
| 55 | static int oval_pdtbl_addcxx . . $ oval_pdtbl_add(1c23f644fb3589a5).(oval_pdtbl_tcxx . . $ oval_pdtbl_t# *table, oval_subtype_tcxx . . $ oval_subtype_t# type, int sd, const char *uri); |
| 56 | static oval_pd_tcxx . . $ oval_pd_t# *oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(oval_pdtbl_tcxx . . $ oval_pdtbl_t# *table, oval_subtype_tcxx . . $ oval_subtype_t# type); |
| 57 | |
| 58 | /* |
| 59 | * oval_pext_ |
| 60 | */ |
| 61 | oval_pext_tcxx . . $ oval_pext_t# *oval_pext_newcxx . . $ oval_pext_new(ae5e4f650a9e55e3).(void) |
| 62 | { |
| 63 | oval_pext_tcxx . . $ oval_pext_t# *pext = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_pext_tcxx . . $ oval_pext_t#)); |
| 64 | |
| 65 | pext->do_initcxx . . $ oval_pext#do_init. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 66 | pthread_mutex_initcxx . . $ pthread_mutex_init(db9d29dab44ea1aa).(&pext->lockcxx . . $ oval_pext#lock., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 67 | pext->pdtblcxx . . $ oval_pext#pdtbl. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 68 | |
| 69 | return(pext); |
| 70 | } |
| 71 | |
| 72 | void oval_pext_freecxx . . $ oval_pext_free(902eee71d5ac11e9).(oval_pext_tcxx . . $ oval_pext_t# *pext) |
| 73 | { |
| 74 | if (!pext->do_initcxx . . $ oval_pext#do_init.) { |
| 75 | /* free structs */ |
| 76 | oval_pdtbl_freecxx . . $ oval_pdtbl_free(e9eb6f5a6d560534).(pext->pdtblcxx . . $ oval_pext#pdtbl.); |
| 77 | } |
| 78 | |
| 79 | pthread_mutex_destroycxx . . $ pthread_mutex_destroy(d89ae235521888f9).(&pext->lockcxx . . $ oval_pext#lock.); |
| 80 | freecxx . . $ free(5d22bdacc48458e8).(pext); |
| 81 | } |
| 82 | |
| 83 | /* |
| 84 | * oval_pdtbl_ |
| 85 | */ |
| 86 | static oval_pdtbl_tcxx . . $ oval_pdtbl_t# *oval_pdtbl_newcxx . . $ oval_pdtbl_new(c75fa850dd422059).(void) |
| 87 | { |
| 88 | oval_pdtbl_tcxx . . $ oval_pdtbl_t# *p_tbl = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_pdtbl_tcxx . . $ oval_pdtbl_t#)); |
| 89 | p_tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 90 | p_tbl->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count. = 0; |
| 91 | p_tbl->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx. = SEAP_CTX_newcxx . . $ SEAP_CTX_new(4c59508b5756fef7).(); |
| 92 | |
| 93 | return (p_tbl); |
| 94 | } |
| 95 | |
| 96 | static void oval_pdtbl_freecxx . . $ oval_pdtbl_free(e9eb6f5a6d560534).(oval_pdtbl_tcxx . . $ oval_pdtbl_t# *tbl) |
| 97 | { |
| 98 | register size_t i; |
| 99 | |
| 100 | for (i = 0; i < tbl->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count.; ++i) { |
| 101 | SEAP_closecxx . . $ SEAP_close(1db39790f33892d1).(tbl->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb.[i]->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd.); |
| 102 | freecxx . . $ free(5d22bdacc48458e8).(tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb.[i]->uricxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#uri.); |
| 103 | freecxx . . $ free(5d22bdacc48458e8).(tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb.[i]); |
| 104 | } |
| 105 | |
| 106 | freecxx . . $ free(5d22bdacc48458e8).(tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb.); |
| 107 | SEAP_CTX_freecxx . . $ SEAP_CTX_free(6b73584f16c77d33).(tbl->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx.); |
| 108 | freecxx . . $ free(5d22bdacc48458e8).(tbl); |
| 109 | |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | static int oval_pdtbl_pdcmpcxx . . $ oval_pdtbl_pdcmp(9cc06b2ce5b0d7a9).(const oval_pd_tcxx . . $ oval_pd_t# **a, const oval_pd_tcxx . . $ oval_pd_t# **b) |
| 114 | { |
| 115 | if (*a == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *b == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 116 | return -1; |
| 117 | } |
| 118 | return ((*a)->subtypecxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#subtype. - (*b)->subtypecxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#subtype.); |
| 119 | } |
| 120 | |
| 121 | static int oval_pdtbl_typecmpcxx . . $ oval_pdtbl_typecmp(9fd8fcc2f193e7a0).(oval_subtype_tcxx . . $ oval_subtype_t# *a, oval_pd_tcxx . . $ oval_pd_t# **b) |
| 122 | { |
| 123 | if (a == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *b == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 124 | return -1; |
| 125 | } |
| 126 | return (*a - (*b)->subtypecxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#subtype.); |
| 127 | } |
| 128 | |
| 129 | static int oval_pdtbl_addcxx . . $ oval_pdtbl_add(1c23f644fb3589a5).(oval_pdtbl_tcxx . . $ oval_pdtbl_t# *tbl, oval_subtype_tcxx . . $ oval_subtype_t# type, int sd, const char *uri) |
| 130 | { |
| 131 | if (tbl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || uri == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 132 | return -1; |
| 133 | } |
| 134 | |
| 135 | oval_pd_tcxx . . $ oval_pd_t# *pd = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_pd_tcxx . . $ oval_pd_t#)); |
| 136 | pd->subtypecxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#subtype. = type; |
| 137 | pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. = sd; |
| 138 | pd->uricxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#uri. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(uri); |
| 139 | |
| 140 | void *new_memb = realloccxx . . $ realloc(417ab160f6baadc6).(tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb., sizeof(oval_pd_tcxx . . $ oval_pd_t# *) * (++tbl->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count.)); |
| 141 | if (new_memb == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 142 | freecxx . . $ free(5d22bdacc48458e8).(pd->uricxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#uri.); |
| 143 | freecxx . . $ free(5d22bdacc48458e8).(pd); |
| 144 | return -1; |
| 145 | } |
| 146 | tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb. = new_memb; |
| 147 | |
| 148 | tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb.[tbl->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count. - 1] = pd; |
| 149 | |
| 150 | qsortcxx . . $ qsort(ebb60b13a65e77d7).(tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb., tbl->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count., sizeof(oval_pd_tcxx . . $ oval_pd_t# *), |
| 151 | (int (*)(const void *, const void *))oval_pdtbl_pdcmpcxx . . $ oval_pdtbl_pdcmp(9cc06b2ce5b0d7a9).); |
| 152 | |
| 153 | return (0); |
| 154 | } |
| 155 | |
| 156 | static oval_pd_tcxx . . $ oval_pd_t# *oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(oval_pdtbl_tcxx . . $ oval_pdtbl_t# * tbl, oval_subtype_tcxx . . $ oval_subtype_t# type) |
| 157 | { |
| 158 | oval_pd_tcxx . . $ oval_pd_t# **pdp; |
| 159 | |
| 160 | pdp = oscap_bfindcxx . . $ oscap_bfind(55e9dbee426f048c).(tbl->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb., tbl->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count., sizeof(oval_pd_tcxx . . $ oval_pd_t# *), |
| 161 | &type, (int (*)(void *, void *))oval_pdtbl_typecmpcxx . . $ oval_pdtbl_typecmp(9fd8fcc2f193e7a0).); |
| 162 | |
| 163 | return (pdp == 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`! : *pdp); |
| 164 | } |
| 165 | |
| 166 | /* |
| 167 | * oval_probe_cmd_ |
| 168 | */ |
| 169 | static SEXP_tcxx . . $ SEXP_t# *oval_probe_cmd_obj_evalcxx . . $ oval_probe_cmd_obj_eval(313521213da5ee5).(SEXP_tcxx . . $ SEXP_t# *sexp, void *arg); |
| 170 | static SEXP_tcxx . . $ SEXP_t# *oval_probe_cmd_ste_fetchcxx . . $ oval_probe_cmd_ste_fetch(313521213da5ee5).(SEXP_tcxx . . $ SEXP_t# *sexp, void *arg); |
| 171 | static int oval_probe_cmd_initcxx . . $ oval_probe_cmd_init(e97fff7afe636e52).(oval_pext_tcxx . . $ oval_pext_t# *pext); |
| 172 | |
| 173 | static int oval_probe_cmd_initcxx . . $ oval_probe_cmd_init(e97fff7afe636e52).(oval_pext_tcxx . . $ oval_pext_t# *pext) |
| 174 | { |
| 175 | if (pext == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 176 | return -1; |
| 177 | } |
| 178 | |
| 179 | if (SEAP_cmd_registercxx . . $ SEAP_cmd_register(8e6e8c3c92801ad2).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., PROBECMD_OBJ_EVALcxx . . $ `src/OVAL/probes/public/probe-api.h:441:9`!, SEAP_CMDREG_USEARGcxx . . $ `src/OVAL/probes/SEAP/_seap-command.h:48:9`!, |
| 180 | &oval_probe_cmd_obj_evalcxx . . $ oval_probe_cmd_obj_eval(313521213da5ee5)., (void *)pext) != 0) |
| 181 | { |
| 182 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't register command: %s: errno=%u, %s.", "obj_eval", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 183 | return (-1); |
| 184 | } |
| 185 | |
| 186 | if (SEAP_cmd_registercxx . . $ SEAP_cmd_register(8e6e8c3c92801ad2).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., PROBECMD_STE_FETCHcxx . . $ `src/OVAL/probes/public/probe-api.h:440:9`!, SEAP_CMDREG_USEARGcxx . . $ `src/OVAL/probes/SEAP/_seap-command.h:48:9`!, |
| 187 | &oval_probe_cmd_ste_fetchcxx . . $ oval_probe_cmd_ste_fetch(313521213da5ee5)., (void *)pext) != 0) { |
| 188 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't register command: %s: errno=%u, %s.", "ste_fetch", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 189 | |
| 190 | /* FIXME: unregister the first command */ |
| 191 | |
| 192 | return (-1); |
| 193 | } |
| 194 | |
| 195 | return (0); |
| 196 | } |
| 197 | |
| 198 | static SEXP_tcxx . . $ SEXP_t# *oval_probe_cmd_obj_evalcxx . . $ oval_probe_cmd_obj_eval(313521213da5ee5).(SEXP_tcxx . . $ SEXP_t# *sexp, void *arg) |
| 199 | { |
| 200 | char *id_str; |
| 201 | struct oval_definition_modelcxx . . $ oval_definition_model# *defs; |
| 202 | struct oval_objectcxx . . $ oval_object# *obj; |
| 203 | struct oval_syscharcxx . . $ oval_syschar# *res; |
| 204 | oval_pext_tcxx . . $ oval_pext_t# *pext = (oval_pext_tcxx . . $ oval_pext_t# *) arg; |
| 205 | SEXP_tcxx . . $ SEXP_t# *ret, *ret_code; |
| 206 | int r; |
| 207 | |
| 208 | if (sexp == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || arg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 209 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 210 | } |
| 211 | |
| 212 | if (!SEXP_stringpcxx . . $ SEXP_stringp(85f078d1f48ac431).(sexp)) { |
| 213 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Invalid argument: type=%s.", SEXP_strtype(sexp)); |
| 214 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 215 | } |
| 216 | |
| 217 | id_str = SEXP_string_cstrcxx . . $ SEXP_string_cstr(c831a2fa12818dfe).(sexp); |
| 218 | defs = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(*(pext->modelcxx . . $ oval_pext#model.)); |
| 219 | obj = oval_definition_model_get_objectcxx . . $ oval_definition_model_get_object(2c583c84850ee973).(defs, id_str); |
| 220 | ret = SEXP_list_newcxx . . $ SEXP_list_new(902e4f76566c8810). (sexp, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 221 | |
| 222 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Get_object: %s.", id_str); |
| 223 | |
| 224 | if (obj == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 225 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't find obj: id=%s.", id_str); |
| 226 | freecxx . . $ free(5d22bdacc48458e8).(id_str); |
| 227 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ret); |
| 228 | |
| 229 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 230 | } |
| 231 | |
| 232 | oscap_clearerrcxx . . $ oscap_clearerr(49f6e7a06ebc5aa8).(); |
| 233 | r = oval_probe_query_objectcxx . . $ oval_probe_query_object(c2fefbf93109479a).(pext->sess_ptrcxx . . $ oval_pext#sess_ptr., obj, OVAL_PDFLAG_NOREPLYcxx . . $ `src/OVAL/public/oval_probe.h:45:9`!|OVAL_PDFLAG_SLAVEcxx . . $ `src/OVAL/public/oval_probe.h:49:9`!, &res); |
| 234 | if (r < 0) |
| 235 | ret_code = SEXP_number_newucxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:133:9`!((unsigned int) SYSCHAR_FLAG_COMPLETEcxx . . $ SYSCHAR_FLAG_COMPLETE.); |
| 236 | else |
| 237 | ret_code = SEXP_number_newucxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:133:9`!((unsigned int) oval_syschar_get_flagcxx . . $ oval_syschar_get_flag(faee96ff7b702646).(res)); |
| 238 | |
| 239 | SEXP_list_addcxx . . $ SEXP_list_add(35a066576d9f6ea6).(ret, ret_code); |
| 240 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ret_code); |
| 241 | |
| 242 | if (oscap_errcxx . . $ oscap_err(c9857a73d68e59ba).()) { |
| 243 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Failed: id: %s, err: %d, %s.", |
| 244 | id_str, oscap_err_family(), oscap_err_desc()); |
| 245 | oscap_clearerrcxx . . $ oscap_clearerr(49f6e7a06ebc5aa8).(); |
| 246 | freecxx . . $ free(5d22bdacc48458e8).(id_str); |
| 247 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ret); |
| 248 | |
| 249 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 250 | } |
| 251 | |
| 252 | freecxx . . $ free(5d22bdacc48458e8).(id_str); |
| 253 | |
| 254 | return (ret); |
| 255 | } |
| 256 | |
| 257 | static SEXP_tcxx . . $ SEXP_t# *oval_probe_cmd_ste_fetchcxx . . $ oval_probe_cmd_ste_fetch(313521213da5ee5).(SEXP_tcxx . . $ SEXP_t# *sexp, void *arg) |
| 258 | { |
| 259 | SEXP_tcxx . . $ SEXP_t# *id, *ste_list, *ste_sexp; |
| 260 | char *id_str; |
| 261 | struct oval_statecxx . . $ oval_state# *ste; |
| 262 | struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model; |
| 263 | oval_pext_tcxx . . $ oval_pext_t# *pext = (oval_pext_tcxx . . $ oval_pext_t# *)arg; |
| 264 | int ret; |
| 265 | |
| 266 | if (sexp == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || arg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 267 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 268 | } |
| 269 | |
| 270 | ste_list = SEXP_list_newcxx . . $ SEXP_list_new(902e4f76566c8810).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 271 | |
| 272 | SEXP_list_foreachcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:470:9`!(id, sexp) { |
| 273 | if (SEXP_stringpcxx . . $ SEXP_stringp(85f078d1f48ac431).(id)) { |
| 274 | id_str = SEXP_string_cstrcxx . . $ SEXP_string_cstr(c831a2fa12818dfe).(id); |
| 275 | definition_model = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(*(pext->modelcxx . . $ oval_pext#model.)); |
| 276 | ste = oval_definition_model_get_statecxx . . $ oval_definition_model_get_state(a16da6d5657b0c91).(definition_model, id_str); |
| 277 | |
| 278 | if (ste == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 279 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't find ste: id: %s.", id_str); |
| 280 | SEXP_list_freecxx . . $ SEXP_list_free(c6b28547479798f4).(ste_list); |
| 281 | freecxx . . $ free(5d22bdacc48458e8).(id_str); |
| 282 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(id); |
| 283 | |
| 284 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 285 | } |
| 286 | |
| 287 | ret = oval_state_to_sexpcxx . . $ oval_state_to_sexp(266a20d65d035320).(pext->sess_ptrcxx . . $ oval_pext#sess_ptr., ste, &ste_sexp); |
| 288 | if (ret !=0) { |
| 289 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Failed to convert OVAL state to SEXP, id: %s.", |
| 290 | id_str); |
| 291 | SEXP_list_freecxx . . $ SEXP_list_free(c6b28547479798f4).(ste_list); |
| 292 | freecxx . . $ free(5d22bdacc48458e8).(id_str); |
| 293 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(id); |
| 294 | |
| 295 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 296 | } |
| 297 | |
| 298 | SEXP_list_addcxx . . $ SEXP_list_add(35a066576d9f6ea6).(ste_list, ste_sexp); |
| 299 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ste_sexp); |
| 300 | |
| 301 | freecxx . . $ free(5d22bdacc48458e8).(id_str); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | return (ste_list); |
| 306 | } |
| 307 | |
| 308 | static inline const char *_probe_strerrorcxx . . $ _probe_strerror(81a3ae90da26a711).(uint32_tcxx . . $ uint32_t# error_code) |
| 309 | { |
| 310 | const char *codemsg; |
| 311 | |
| 312 | /* |
| 313 | * Errors of type USER should all be from the probe "namespace" (i.e. only codes |
| 314 | * defined at public/probe-api.h. |
| 315 | */ |
| 316 | switch (error_code) { |
| 317 | case PROBE_EINVALcxx . . $ `src/OVAL/probes/public/probe-api.h:421:9`!: codemsg = "Invalid type, value or format"; |
| 318 | break; |
| 319 | case PROBE_ENOELMcxx . . $ `src/OVAL/probes/public/probe-api.h:422:9`!: codemsg = "Missing element"; |
| 320 | break; |
| 321 | case PROBE_ENOVALcxx . . $ `src/OVAL/probes/public/probe-api.h:423:9`!: codemsg = "Missing value"; |
| 322 | break; |
| 323 | case PROBE_ENOATTRcxx . . $ `src/OVAL/probes/public/probe-api.h:424:9`!: codemsg = "Missing attribute"; |
| 324 | break; |
| 325 | case PROBE_EINITcxx . . $ `src/OVAL/probes/public/probe-api.h:425:9`!: codemsg = "Initialization failed"; |
| 326 | break; |
| 327 | case PROBE_ENOMEMcxx . . $ `src/OVAL/probes/public/probe-api.h:426:9`!: codemsg = "Insufficient memory"; |
| 328 | break; |
| 329 | case PROBE_EOPNOTSUPPcxx . . $ `src/OVAL/probes/public/probe-api.h:427:9`!: codemsg = "Operation not supported"; |
| 330 | break; |
| 331 | case PROBE_ERANGEcxx . . $ `src/OVAL/probes/public/probe-api.h:428:9`!: codemsg = "Value out of range"; |
| 332 | break; |
| 333 | case PROBE_EDOMcxx . . $ `src/OVAL/probes/public/probe-api.h:429:9`!: codemsg = "Value out of domain"; |
| 334 | break; |
| 335 | case PROBE_EFAULTcxx . . $ `src/OVAL/probes/public/probe-api.h:430:9`!: codemsg = "Memory fault or NULL value"; |
| 336 | break; |
| 337 | case PROBE_EACCESScxx . . $ `src/OVAL/probes/public/probe-api.h:431:9`!: codemsg = "Operation not permitted"; |
| 338 | break; |
| 339 | case PROBE_ESETEVALcxx . . $ `src/OVAL/probes/public/probe-api.h:432:9`!: codemsg = "Set evaluation failed"; |
| 340 | break; |
| 341 | case PROBE_ENOENTcxx . . $ `src/OVAL/probes/public/probe-api.h:433:9`!: codemsg = "Missing entity"; |
| 342 | break; |
| 343 | case PROBE_EFATALcxx . . $ `src/OVAL/probes/public/probe-api.h:437:9`!: codemsg = "Unrecoverable error"; |
| 344 | break; |
| 345 | case PROBE_EUNKNOWNcxx . . $ `src/OVAL/probes/public/probe-api.h:438:9`!: |
| 346 | default: |
| 347 | codemsg = "Unknown error"; |
| 348 | } |
| 349 | |
| 350 | return codemsg; |
| 351 | } |
| 352 | |
| 353 | static inline int _handle_SEAP_receive_failurecxx . . $ _handle_SEAP_receive_failure(225d1fa5b3aa68f8).(SEAP_CTX_tcxx . . $ SEAP_CTX_t# *ctx, oval_pd_tcxx . . $ oval_pd_t# *pd, SEAP_msg_tcxx . . $ SEAP_msg_t# *s_omsg, int flags) |
| 354 | { |
| 355 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 356 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Can't receive message: %u, %s.", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 357 | } |
| 358 | |
| 359 | if (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == ECANCELEDcxx . . $ `<external>/17922322188510340118/errno.h:111:9`!) { |
| 360 | SEAP_err_tcxx . . $ SEAP_err_t# *err = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 361 | |
| 362 | switch(SEAP_recverr_byidcxx . . $ SEAP_recverr_byid(960dd4cce4b45919).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd., &err, |
| 363 | SEAP_msg_idcxx . . $ SEAP_msg_id(18c00517003ebe74).(s_omsg))) |
| 364 | { |
| 365 | case 0: |
| 366 | break; |
| 367 | case 1: /* no error found */ |
| 368 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Internal error: An error was signaled on sd=%d but the error queue is empty.", pd->sd); |
| 369 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "SEAP_recverr_byid: internal error: empty error queue."); |
| 370 | return (-1); |
| 371 | case -1: /* internal error */ |
| 372 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Internal error: SEAP_recverr_byid returned -1"); |
| 373 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "SEAP_recverr_byid: internal error."); |
| 374 | return (-1); |
| 375 | } |
| 376 | |
| 377 | /* |
| 378 | * decide what to do based on the error code/type |
| 379 | */ |
| 380 | switch (err->typecxx . . $ SEAP_err#type.) { |
| 381 | case SEAP_ETYPE_USERcxx . . $ `src/OVAL/probes/SEAP/_seap-types.h:74:9`!: |
| 382 | { |
| 383 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Probe at sd=%d (%s) reported an error: %s", |
| 384 | pd->sd, oval_subtype_to_str(pd->subtype), _probe_strerror(err->code)); |
| 385 | break; |
| 386 | } |
| 387 | case SEAP_ETYPE_INTcxx . . $ `src/OVAL/probes/SEAP/_seap-types.h:73:9`!: |
| 388 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Internal error"); |
| 389 | break; |
| 390 | } |
| 391 | |
| 392 | SEAP_error_freecxx . . $ SEAP_error_free(7b4adf922bbc6529).(err); |
| 393 | return (-1); |
| 394 | } |
| 395 | |
| 396 | if (flags & OVAL_PDFLAG_SLAVEcxx . . $ `src/OVAL/public/oval_probe.h:49:9`!) { |
| 397 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 398 | |
| 399 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) != 0) |
| 400 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Unable to receive a message to probe"); |
| 401 | else |
| 402 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 403 | |
| 404 | return (-1); |
| 405 | } |
| 406 | |
| 407 | if (SEAP_closecxx . . $ SEAP_close(1db39790f33892d1).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd.) != 0) { |
| 408 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 409 | |
| 410 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 411 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't close sd: %u, %s.", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 412 | } |
| 413 | |
| 414 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) != 0) |
| 415 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Unable to close probe sd"); |
| 416 | else |
| 417 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 418 | } |
| 419 | |
| 420 | pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. = -1; |
| 421 | return (-1); |
| 422 | } |
| 423 | |
| 424 | static int oval_probe_commcxx . . $ oval_probe_comm(e326d083cf31bf31).(SEAP_CTX_tcxx . . $ SEAP_CTX_t# *ctx, oval_pd_tcxx . . $ oval_pd_t# *pd, const SEXP_tcxx . . $ SEXP_t# *s_iobj, int flags, SEXP_tcxx . . $ SEXP_t# **out_sexp) |
| 425 | { |
| 426 | int retry, ret; |
| 427 | |
| 428 | SEAP_msg_tcxx . . $ SEAP_msg_t# *s_imsg, *s_omsg; |
| 429 | SEXP_tcxx . . $ SEXP_t# *s_oobj; |
| 430 | |
| 431 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || s_iobj == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 432 | return -1; |
| 433 | } |
| 434 | |
| 435 | ctx->subtypecxx . . $ SEAP_CTX#subtype. = pd->subtypecxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#subtype.; |
| 436 | for (retry = 0;;) { |
| 437 | /* |
| 438 | * Establish connection to probe. The connection may be |
| 439 | * already set up by previous calls to this function or |
| 440 | * by the probe context handling functions. |
| 441 | */ |
| 442 | if (pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. == -1) { |
| 443 | pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. = SEAP_connectcxx . . $ SEAP_connect(8239b944deed0079).(ctx); |
| 444 | |
| 445 | if (pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. < 0) { |
| 446 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 447 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Can't connect: %u, %s.", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 448 | } |
| 449 | |
| 450 | if (++retry <= OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!) { |
| 451 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Connect: retry %u/%u.", retry, OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!); |
| 452 | continue; |
| 453 | } else { |
| 454 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 455 | |
| 456 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 457 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Connect: retry limit (%u) reached.", OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!); |
| 458 | } |
| 459 | |
| 460 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) != 0) |
| 461 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Can't connect to the probe"); |
| 462 | else |
| 463 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 464 | |
| 465 | return (-1); |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | s_omsg = SEAP_msg_newcxx . . $ SEAP_msg_new(b76a66c6f733d68f).(); |
| 471 | SEAP_msg_setcxx . . $ SEAP_msg_set(780f103242f3120a).(s_omsg, (SEXP_tcxx . . $ SEXP_t# *) s_iobj); |
| 472 | |
| 473 | if (flags & OVAL_PDFLAG_NOREPLYcxx . . $ `src/OVAL/public/oval_probe.h:45:9`!) { |
| 474 | if (SEAP_msgattr_setcxx . . $ SEAP_msgattr_set(be99563c35b05491).(s_omsg, "no-reply", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) != 0) { |
| 475 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 476 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't set no-reply attribute."); |
| 477 | } |
| 478 | |
| 479 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_omsg); |
| 480 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "OVAL_EPROBEUNKNOWN"); |
| 481 | |
| 482 | return (-1); |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Sending message."); |
| 487 | |
| 488 | ret = SEAP_sendmsgcxx . . $ SEAP_sendmsg(44b2d65acd10f583).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd., s_omsg); |
| 489 | if (ret != 0) { |
| 490 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 491 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Can't send message: %u, %s.", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 492 | } |
| 493 | |
| 494 | if (flags & OVAL_PDFLAG_SLAVEcxx . . $ `src/OVAL/public/oval_probe.h:49:9`!) { |
| 495 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 496 | |
| 497 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) != 0) |
| 498 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Unable to send a message to probe"); |
| 499 | else |
| 500 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 501 | |
| 502 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_omsg); |
| 503 | return (-1); |
| 504 | } |
| 505 | |
| 506 | if (SEAP_closecxx . . $ SEAP_close(1db39790f33892d1).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd.) != 0) { |
| 507 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 508 | |
| 509 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 510 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't close sd: %u, %s.", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 511 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_omsg); |
| 512 | } |
| 513 | |
| 514 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) != 0) |
| 515 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Can't close sd"); |
| 516 | else |
| 517 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 518 | |
| 519 | pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. = -1; |
| 520 | return (-1); |
| 521 | } |
| 522 | |
| 523 | pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. = -1; |
| 524 | |
| 525 | if (++retry <= OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!) { |
| 526 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Send: retry %u/%u.", retry, OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!); |
| 527 | continue; |
| 528 | } else { |
| 529 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 530 | |
| 531 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 532 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Send: retry limit (%u) reached.", OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!); |
| 533 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_omsg); |
| 534 | } |
| 535 | |
| 536 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) != 0) |
| 537 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Unable to send a message to probe"); |
| 538 | else |
| 539 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 540 | |
| 541 | return (ret); |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Waiting for reply."); |
| 546 | |
| 547 | /* recv_retry: */ |
| 548 | s_imsg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 549 | |
| 550 | ret = SEAP_recvmsgcxx . . $ SEAP_recvmsg(548af285d41333c4).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd., &s_imsg); |
| 551 | if (ret != 0) { |
| 552 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 553 | ret = _handle_SEAP_receive_failurecxx . . $ _handle_SEAP_receive_failure(225d1fa5b3aa68f8).(ctx, pd, s_omsg, flags); |
| 554 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_imsg); |
| 555 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_omsg); |
| 556 | } |
| 557 | if (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == ECONNABORTEDcxx . . $ `<external>/17922322188510340118/errno.h:87:9`!) { |
| 558 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Connection was aborted."); |
| 559 | return (-2); |
| 560 | } else { |
| 561 | if (++retry <= OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!) { |
| 562 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Recv: retry %u/%u.", retry, OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!); |
| 563 | continue; |
| 564 | } else { |
| 565 | protect_errnocxx . . $ `src/common/util.h:446:9`! { |
| 566 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Recv: retry limit (%u) reached.", OVAL_PROBE_MAXRETRYcxx . . $ `src/OVAL/oval_probe_impl.h:49:9`!); |
| 567 | } |
| 568 | |
| 569 | char errbuf[__ERRBUF_SIZEcxx . . $ `src/OVAL/oval_probe_ext.c:51:9`!]; |
| 570 | if (oscap_strerror_rcxx . . $ oscap_strerror_r(c3cf521967a2a310). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, errbuf, sizeof errbuf - 1) == 0) |
| 571 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s", errbuf); |
| 572 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Unable to receive a message from probe"); |
| 573 | |
| 574 | return ret; |
| 575 | } |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Message received."); |
| 580 | break; |
| 581 | } |
| 582 | |
| 583 | s_oobj = SEAP_msg_getcxx . . $ SEAP_msg_get(265ef69b98da50a9).(s_imsg); |
| 584 | |
| 585 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_imsg); |
| 586 | SEAP_msg_freecxx . . $ SEAP_msg_free(4995d55015d41e57).(s_omsg); |
| 587 | |
| 588 | *out_sexp = s_oobj; |
| 589 | return (0); |
| 590 | } |
| 591 | |
| 592 | static int oval_probe_sys_evalcxx . . $ oval_probe_sys_eval(59bae6e10114546b).(SEAP_CTX_tcxx . . $ SEAP_CTX_t# *ctx, oval_pd_tcxx . . $ oval_pd_t# *pd, struct oval_syschar_modelcxx . . $ oval_syschar_model# *model, struct oval_sysinfocxx . . $ oval_sysinfo# **out_sysinf) |
| 593 | { |
| 594 | struct oval_sysinfocxx . . $ oval_sysinfo# *sysinf; |
| 595 | struct oval_sysintcxx . . $ oval_sysint# *ife; |
| 596 | SEXP_tcxx . . $ SEXP_t# *s_obj, *s_sinf, *ent, *r0, *r1; |
| 597 | int ret; |
| 598 | |
| 599 | /* |
| 600 | * Prepare a dummy object. We can't simply send an empty object |
| 601 | * because the preprocessing machinery in probes need an id that |
| 602 | * is used as key in cache lookups. |
| 603 | */ |
| 604 | { |
| 605 | SEXP_tcxx . . $ SEXP_t# *r2, *r3; |
| 606 | |
| 607 | r0 = SEXP_list_newcxx . . $ SEXP_list_new(902e4f76566c8810). (r1 = SEXP_string_newfcxx . . $ SEXP_string_newf(b2137ed863725962). ("%s", "sysinfo_object"), |
| 608 | r2 = SEXP_string_newfcxx . . $ SEXP_string_newf(b2137ed863725962). (":%s", "id"), |
| 609 | r3 = SEXP_string_newfcxx . . $ SEXP_string_newf(b2137ed863725962). ("sysinfo:0"), |
| 610 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 611 | |
| 612 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(r1); |
| 613 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(r2); |
| 614 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(r3); |
| 615 | s_obj = SEXP_list_newcxx . . $ SEXP_list_new(902e4f76566c8810). (r0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 616 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (r0); |
| 617 | } |
| 618 | |
| 619 | ret = oval_probe_commcxx . . $ oval_probe_comm(e326d083cf31bf31).(ctx, pd, s_obj, 0, &r0); |
| 620 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(s_obj); |
| 621 | |
| 622 | if (ret != 0) |
| 623 | return (ret); |
| 624 | |
| 625 | r1 = probe_cobj_get_itemscxx . . $ probe_cobj_get_items(2f7f980afaaae0f0).(r0); |
| 626 | s_sinf = SEXP_list_firstcxx . . $ SEXP_list_first(2f7f980afaaae0f0).(r1); |
| 627 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(r0); |
| 628 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(r1); |
| 629 | |
| 630 | if (s_sinf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 631 | return (-1); |
| 632 | |
| 633 | sysinf = oval_sysinfo_newcxx . . $ oval_sysinfo_new(6aeeda204099c504).(model); |
| 634 | |
| 635 | /* |
| 636 | * Translate S-exp to sysinfo structure |
| 637 | */ |
| 638 | #define SYSINF_EXTcxx . . $ `src/OVAL/oval_probe_ext.c:638:9`!(obj, name, sysinf, fail) \ |
| 639 | do { \ |
| 640 | SEXP_t *val; \ |
| 641 | char buf[128+1]; \ |
| 642 | \ |
| 643 | val = probe_obj_getentval (obj, #name, 1); \ |
| 644 | \ |
| 645 | if (val == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { \ |
| 646 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("No entity or value: %s", #name); \ |
| 647 | goto fail; \ |
| 648 | } \ |
| 649 | \ |
| 650 | if (SEXP_string_cstr_r (val, buf, sizeof buf) >= sizeof buf) { \ |
| 651 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Value too large: %s", #name); \ |
| 652 | SEXP_free (val); \ |
| 653 | goto fail; \ |
| 654 | } \ |
| 655 | \ |
| 656 | oval_sysinfo_set_##name (sysinf, buf); \ |
| 657 | SEXP_free (val); \ |
| 658 | } while (0) |
| 659 | |
| 660 | SYSINF_EXTcxx . . $ `src/OVAL/oval_probe_ext.c:638:9`!(s_sinf, os_name, sysinf, fail_gen); |
| 661 | SYSINF_EXTcxx . . $ `src/OVAL/oval_probe_ext.c:638:9`!(s_sinf, os_version, sysinf, fail_gen); |
| 662 | SYSINF_EXTcxx . . $ `src/OVAL/oval_probe_ext.c:638:9`!(s_sinf, os_architecture, sysinf, fail_gen); |
| 663 | SYSINF_EXTcxx . . $ `src/OVAL/oval_probe_ext.c:638:9`!(s_sinf, primary_host_name, sysinf, fail_gen); |
| 664 | |
| 665 | /* |
| 666 | * Extract interface info |
| 667 | */ |
| 668 | { |
| 669 | uint32_tcxx . . $ uint32_t# n; |
| 670 | |
| 671 | for (n = 1; (ent = probe_obj_getentcxx . . $ probe_obj_getent(7907a01f2ff841f3).(s_sinf, "interface", n)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; ++n) { |
| 672 | ife = oval_sysint_newcxx . . $ oval_sysint_new(c6d52d0a5f55bfef).(model); |
| 673 | |
| 674 | #define SYSINF_IEXTcxx . . $ `src/OVAL/oval_probe_ext.c:674:9`!(ent, name, sysint, fail) \ |
| 675 | do { \ |
| 676 | SEXP_t *val; \ |
| 677 | char buf[128+1]; \ |
| 678 | \ |
| 679 | val = probe_ent_getattrval (ent, #name); \ |
| 680 | \ |
| 681 | if (val == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { \ |
| 682 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("No value: %s", #name); \ |
| 683 | goto fail; \ |
| 684 | } \ |
| 685 | \ |
| 686 | if (SEXP_string_cstr_r (val, buf, sizeof buf) >= sizeof buf) { \ |
| 687 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Value too large: %s", #name); \ |
| 688 | SEXP_free (val); \ |
| 689 | goto fail; \ |
| 690 | } \ |
| 691 | \ |
| 692 | oval_sysint_set_##name (sysint, buf); \ |
| 693 | SEXP_free (val); \ |
| 694 | \ |
| 695 | } while (0) |
| 696 | |
| 697 | SYSINF_IEXTcxx . . $ `src/OVAL/oval_probe_ext.c:674:9`!(ent, ip_address, ife, fail_int); |
| 698 | SYSINF_IEXTcxx . . $ `src/OVAL/oval_probe_ext.c:674:9`!(ent, mac_address, ife, fail_int); |
| 699 | SYSINF_IEXTcxx . . $ `src/OVAL/oval_probe_ext.c:674:9`!(ent, name, ife, fail_int); |
| 700 | |
| 701 | oval_sysinfo_add_interfacecxx . . $ oval_sysinfo_add_interface(b4a4c141fb768bbc).(sysinf, ife); |
| 702 | oval_sysint_freecxx . . $ oval_sysint_free(70dc35ae4d1efae1).(ife); |
| 703 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ent); |
| 704 | } |
| 705 | } |
| 706 | |
| 707 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(s_sinf); |
| 708 | |
| 709 | *out_sysinf = sysinf; |
| 710 | return (0); |
| 711 | fail_int: |
| 712 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(ent); |
| 713 | oval_sysint_freecxx . . $ oval_sysint_free(70dc35ae4d1efae1).(ife); |
| 714 | fail_gen: |
| 715 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(s_sinf); |
| 716 | oval_sysinfo_freecxx . . $ oval_sysinfo_free(d47d2e57c195a0d4).(sysinf); |
| 717 | |
| 718 | return (-1); |
| 719 | } |
| 720 | |
| 721 | int oval_probe_sys_handlercxx . . $ oval_probe_sys_handler(a49301219799be48).(oval_subtype_tcxx . . $ oval_subtype_t# type, void *ptr, int act, ...) |
| 722 | { |
| 723 | int ret = 0; |
| 724 | oval_pext_tcxx . . $ oval_pext_t# *pext = (oval_pext_tcxx . . $ oval_pext_t# *)ptr; |
| 725 | va_listcxx . . $ va_list# ap; |
| 726 | oval_pd_tcxx . . $ oval_pd_t# *pd; |
| 727 | |
| 728 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap, act); |
| 729 | |
| 730 | switch(act) { |
| 731 | case PROBE_HANDLER_ACT_EVALcxx . . $ `src/OVAL/_oval_probe_handler.h:47:9`!: |
| 732 | { |
| 733 | struct oval_sysinfocxx . . $ oval_sysinfo# **inf; |
| 734 | /* int flags = va_arg(ap, int); */ |
| 735 | |
| 736 | va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, struct oval_object *); |
| 737 | inf = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, struct oval_sysinfo **); |
| 738 | pd = oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(pext->pdtblcxx . . $ oval_pext#pdtbl., type); |
| 739 | |
| 740 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 741 | if (oval_probe_sys_handlercxx . . $ oval_probe_sys_handler(a49301219799be48).(type, ptr, PROBE_HANDLER_ACT_OPENcxx . . $ `src/OVAL/_oval_probe_handler.h:46:9`!) != 0) { |
| 742 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 743 | return(-1); |
| 744 | } |
| 745 | |
| 746 | pd = oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(pext->pdtblcxx . . $ oval_pext#pdtbl., type); |
| 747 | } |
| 748 | |
| 749 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 750 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 751 | return -1; |
| 752 | } |
| 753 | ret = oval_probe_sys_evalcxx . . $ oval_probe_sys_eval(59bae6e10114546b).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., pd, *(pext->modelcxx . . $ oval_pext#model.), inf); |
| 754 | break; |
| 755 | } |
| 756 | case PROBE_HANDLER_ACT_OPENcxx . . $ `src/OVAL/_oval_probe_handler.h:46:9`!: |
| 757 | { |
| 758 | char probe_uri[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`! + 1]; |
| 759 | size_t probe_urilen; |
| 760 | |
| 761 | if (!probe_table_existscxx . . $ probe_table_exists(4c65e7724f38ac).(type)) { |
| 762 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "subtype %u not supported", type); |
| 763 | |
| 764 | ret = -1; |
| 765 | break; |
| 766 | } |
| 767 | |
| 768 | probe_urilen = snprintfcxx . . $ snprintf(ea502d73e74c754c).(probe_uri, sizeof probe_uri, "%s://%s", |
| 769 | OVAL_PROBE_SCHEMEcxx . . $ `src/OVAL/oval_probe_impl.h:47:9`!, oval_subtype_get_textcxx . . $ oval_subtype_get_text(ee6b3dcae047e21f).(type)); |
| 770 | |
| 771 | if (probe_urilen >= sizeof probe_uri) { |
| 772 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_GLIBCcxx . . $ `src/common/public/oscap_error.h:58:9`!, "probe URI too long"); |
| 773 | |
| 774 | ret = -1; |
| 775 | } else { |
| 776 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Starting probe on URI '%s'.", probe_uri); |
| 777 | |
| 778 | if (oval_pdtbl_addcxx . . $ oval_pdtbl_add(1c23f644fb3589a5).(pext->pdtblcxx . . $ oval_pext#pdtbl., type, -1, probe_uri) != 0) { |
| 779 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "%s probe not supported", oval_subtype_get_text(type)); |
| 780 | |
| 781 | ret = -1; |
| 782 | } |
| 783 | } |
| 784 | break; |
| 785 | } |
| 786 | case PROBE_HANDLER_ACT_INITcxx . . $ `src/OVAL/_oval_probe_handler.h:44:9`!: |
| 787 | ret = oval_probe_ext_initcxx . . $ oval_probe_ext_init(e97fff7afe636e52).(pext); |
| 788 | break; |
| 789 | default: |
| 790 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = EINVALcxx . . $ `<external>/8987895939074593727/errno-base.h:26:9`!; |
| 791 | ret = -1; |
| 792 | } |
| 793 | |
| 794 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 795 | return(ret); |
| 796 | } |
| 797 | |
| 798 | int oval_probe_ext_handlercxx . . $ oval_probe_ext_handler(a49301219799be48).(oval_subtype_tcxx . . $ oval_subtype_t# type, void *ptr, int act, ...) |
| 799 | { |
| 800 | int ret = 0; |
| 801 | va_listcxx . . $ va_list# ap; |
| 802 | oval_pext_tcxx . . $ oval_pext_t# *pext = (oval_pext_tcxx . . $ oval_pext_t# *)ptr; |
| 803 | oval_pd_tcxx . . $ oval_pd_t# *pd; |
| 804 | |
| 805 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap, act); |
| 806 | |
| 807 | switch(act) { |
| 808 | case PROBE_HANDLER_ACT_EVALcxx . . $ `src/OVAL/_oval_probe_handler.h:47:9`!: |
| 809 | { |
| 810 | struct oval_objectcxx . . $ oval_object# *obj; |
| 811 | struct oval_syscharcxx . . $ oval_syschar# *sys; |
| 812 | int flags; |
| 813 | |
| 814 | sys = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, struct oval_syschar *); |
| 815 | flags = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, int); |
| 816 | obj = oval_syschar_get_objectcxx . . $ oval_syschar_get_object(b82ea9461ca3ba19).(sys); |
| 817 | oval_subtype_tcxx . . $ oval_subtype_t# obj_subtype = oval_object_get_subtypecxx . . $ oval_object_get_subtype(770582e2dbb3228b).(obj); |
| 818 | pd = oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(pext->pdtblcxx . . $ oval_pext#pdtbl., obj_subtype); |
| 819 | |
| 820 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 821 | char probe_uri[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`! + 1]; |
| 822 | size_t probe_urilen; |
| 823 | |
| 824 | if (!probe_table_existscxx . . $ probe_table_exists(4c65e7724f38ac).(obj_subtype)) { |
| 825 | oval_syschar_add_new_messagecxx . . $ oval_syschar_add_new_message(a127cd6af74f53db).(sys, "OVAL object not supported", OVAL_MESSAGE_LEVEL_WARNINGcxx . . $ OVAL_MESSAGE_LEVEL_WARNING.); |
| 826 | oval_syschar_set_flagcxx . . $ oval_syschar_set_flag(46ad62f81d28bed2).(sys, SYSCHAR_FLAG_NOT_COLLECTEDcxx . . $ SYSCHAR_FLAG_NOT_COLLECTED.); |
| 827 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 828 | return (1); |
| 829 | } |
| 830 | |
| 831 | probe_urilen = snprintfcxx . . $ snprintf(ea502d73e74c754c).(probe_uri, sizeof probe_uri, "%s://%s", |
| 832 | OVAL_PROBE_SCHEMEcxx . . $ `src/OVAL/oval_probe_impl.h:47:9`!, oval_subtype_get_textcxx . . $ oval_subtype_get_text(ee6b3dcae047e21f).(obj_subtype)); |
| 833 | |
| 834 | if (probe_urilen >= sizeof probe_uri) { |
| 835 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_GLIBCcxx . . $ `src/common/public/oscap_error.h:58:9`!, "probe URI too long"); |
| 836 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 837 | return (-1); |
| 838 | } |
| 839 | |
| 840 | dIcxx . . $ `src/common/debug_priv.h:61:9`!("Starting probe on URI '%s'.", probe_uri); |
| 841 | |
| 842 | if (oval_pdtbl_addcxx . . $ oval_pdtbl_add(1c23f644fb3589a5).(pext->pdtblcxx . . $ oval_pext#pdtbl., obj_subtype, -1, probe_uri) != 0) { |
| 843 | oval_syschar_add_new_messagecxx . . $ oval_syschar_add_new_message(a127cd6af74f53db).(sys, "OVAL object not supported", OVAL_MESSAGE_LEVEL_WARNINGcxx . . $ OVAL_MESSAGE_LEVEL_WARNING.); |
| 844 | oval_syschar_set_flagcxx . . $ oval_syschar_set_flag(46ad62f81d28bed2).(sys, SYSCHAR_FLAG_NOT_COLLECTEDcxx . . $ SYSCHAR_FLAG_NOT_COLLECTED.); |
| 845 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 846 | return (1); |
| 847 | } |
| 848 | |
| 849 | pd = oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(pext->pdtblcxx . . $ oval_pext#pdtbl., obj_subtype); |
| 850 | |
| 851 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 852 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`! (OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "internal error"); |
| 853 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 854 | return (-1); |
| 855 | } |
| 856 | } |
| 857 | |
| 858 | ret = oval_probe_ext_evalcxx . . $ oval_probe_ext_eval(425a50d432a54efc).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., pd, pext, sys, flags); |
| 859 | |
| 860 | if (ret >= 0) |
| 861 | ret = 0; |
| 862 | |
| 863 | if (ret < 0 && errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == ECONNABORTEDcxx . . $ `<external>/17922322188510340118/errno.h:87:9`!) { |
| 864 | if (!(flags & OVAL_PDFLAG_SLAVEcxx . . $ `src/OVAL/public/oval_probe.h:49:9`!)) { |
| 865 | if (!pext->do_initcxx . . $ oval_pext#do_init.) { |
| 866 | oval_pdtbl_freecxx . . $ oval_pdtbl_free(e9eb6f5a6d560534).(pext->pdtblcxx . . $ oval_pext#pdtbl.); |
| 867 | } |
| 868 | |
| 869 | pext->do_initcxx . . $ oval_pext#do_init. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 870 | pext->pdtblcxx . . $ oval_pext#pdtbl. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 871 | |
| 872 | oval_probe_ext_initcxx . . $ oval_probe_ext_init(e97fff7afe636e52).(pext); |
| 873 | |
| 874 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = ECONNABORTEDcxx . . $ `<external>/17922322188510340118/errno.h:87:9`!; |
| 875 | } |
| 876 | } |
| 877 | |
| 878 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 879 | return ret; |
| 880 | } |
| 881 | case PROBE_HANDLER_ACT_OPENcxx . . $ `src/OVAL/_oval_probe_handler.h:46:9`!: |
| 882 | break; |
| 883 | case PROBE_HANDLER_ACT_INITcxx . . $ `src/OVAL/_oval_probe_handler.h:44:9`!: |
| 884 | ret = oval_probe_ext_initcxx . . $ oval_probe_ext_init(e97fff7afe636e52).(pext); |
| 885 | break; |
| 886 | case PROBE_HANDLER_ACT_RESETcxx . . $ `src/OVAL/_oval_probe_handler.h:48:9`!: |
| 887 | case PROBE_HANDLER_ACT_ABORTcxx . . $ `src/OVAL/_oval_probe_handler.h:50:9`!: |
| 888 | { |
| 889 | if (type == OVAL_SUBTYPE_ALLcxx . . $ OVAL_SUBTYPE_ALL.) { |
| 890 | /* |
| 891 | * Iterate thru probe descriptor table and execute the reset operation |
| 892 | * for each probe descriptor. |
| 893 | */ |
| 894 | for (size_t i = 0; i < pext->pdtblcxx . . $ oval_pext#pdtbl.->countcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#count.; ++i) { |
| 895 | pd = pext->pdtblcxx . . $ oval_pext#pdtbl.->membcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#memb.[i]; |
| 896 | |
| 897 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 898 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 899 | return(0); |
| 900 | } |
| 901 | |
| 902 | if (act == PROBE_HANDLER_ACT_RESETcxx . . $ `src/OVAL/_oval_probe_handler.h:48:9`!) |
| 903 | ret = oval_probe_ext_resetcxx . . $ oval_probe_ext_reset(fb9ef5093e722c42).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., pd, pext); |
| 904 | else |
| 905 | ret = oval_probe_ext_abortcxx . . $ oval_probe_ext_abort(fb9ef5093e722c42).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., pd, pext); |
| 906 | |
| 907 | if (ret != 0) { |
| 908 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 909 | return (ret); |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 914 | return(0); |
| 915 | } else { |
| 916 | /* |
| 917 | * Reset only the probe of specified subtype. |
| 918 | */ |
| 919 | pd = oval_pdtbl_getcxx . . $ oval_pdtbl_get(f25f5a5806526034).(pext->pdtblcxx . . $ oval_pext#pdtbl., type); |
| 920 | |
| 921 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 922 | if (pd == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 923 | return(0); |
| 924 | |
| 925 | if (act == PROBE_HANDLER_ACT_RESETcxx . . $ `src/OVAL/_oval_probe_handler.h:48:9`!) |
| 926 | return oval_probe_ext_resetcxx . . $ oval_probe_ext_reset(fb9ef5093e722c42).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., pd, pext); |
| 927 | else |
| 928 | return oval_probe_ext_abortcxx . . $ oval_probe_ext_abort(fb9ef5093e722c42).(pext->pdtblcxx . . $ oval_pext#pdtbl.->ctxcxx . . $ $anonymous_type_97ec4dd9c18ba30d_1#ctx., pd, pext); |
| 929 | } |
| 930 | break; |
| 931 | } |
| 932 | case PROBE_HANDLER_ACT_FREEcxx . . $ `src/OVAL/_oval_probe_handler.h:45:9`!: |
| 933 | case PROBE_HANDLER_ACT_CLOSEcxx . . $ `src/OVAL/_oval_probe_handler.h:49:9`!: |
| 934 | default: |
| 935 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 936 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = EINVALcxx . . $ `<external>/8987895939074593727/errno-base.h:26:9`!; |
| 937 | return(-1); |
| 938 | } |
| 939 | |
| 940 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 941 | return(ret); |
| 942 | } |
| 943 | |
| 944 | int oval_probe_ext_initcxx . . $ oval_probe_ext_init(e97fff7afe636e52).(oval_pext_tcxx . . $ oval_pext_t# *pext) |
| 945 | { |
| 946 | int ret = 0; |
| 947 | |
| 948 | pthread_mutex_lockcxx . . $ pthread_mutex_lock(d89ae235521888f9).(&pext->lockcxx . . $ oval_pext#lock.); |
| 949 | |
| 950 | if (pext->do_initcxx . . $ oval_pext#do_init.) { |
| 951 | pext->pdtblcxx . . $ oval_pext#pdtbl. = oval_pdtbl_newcxx . . $ oval_pdtbl_new(c75fa850dd422059).(); |
| 952 | |
| 953 | if (oval_probe_cmd_initcxx . . $ oval_probe_cmd_init(e97fff7afe636e52).(pext) != 0) |
| 954 | ret = -1; |
| 955 | else |
| 956 | pext->do_initcxx . . $ oval_pext#do_init. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 957 | } |
| 958 | pthread_mutex_unlockcxx . . $ pthread_mutex_unlock(d89ae235521888f9).(&pext->lockcxx . . $ oval_pext#lock.); |
| 959 | |
| 960 | return(ret); |
| 961 | } |
| 962 | |
| 963 | int oval_probe_ext_evalcxx . . $ oval_probe_ext_eval(425a50d432a54efc).(SEAP_CTX_tcxx . . $ SEAP_CTX_t# *ctx, oval_pd_tcxx . . $ oval_pd_t# *pd, oval_pext_tcxx . . $ oval_pext_t# *pext, struct oval_syscharcxx . . $ oval_syschar# *syschar, int flags) |
| 964 | { |
| 965 | SEXP_tcxx . . $ SEXP_t# *s_obj, *s_sys; |
| 966 | struct oval_objectcxx . . $ oval_object# *object; |
| 967 | int ret; |
| 968 | |
| 969 | if (syschar == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 970 | oscap_seterrcxx . . $ `src/common/_error.h:52:9`!(OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`!, "Internal error: syschar == NULL"); |
| 971 | return (-1); |
| 972 | } |
| 973 | |
| 974 | object = oval_syschar_get_objectcxx . . $ oval_syschar_get_object(b82ea9461ca3ba19).(syschar); |
| 975 | ret = oval_object_to_sexpcxx . . $ oval_object_to_sexp(ed7181725248ec9c).(pext->sess_ptrcxx . . $ oval_pext#sess_ptr., oval_subtype_to_strcxx . . $ oval_subtype_to_str(ee6b3dcae047e21f).(oval_object_get_subtypecxx . . $ oval_object_get_subtype(770582e2dbb3228b).(object)), syschar, &s_obj); |
| 976 | |
| 977 | if (ret != 0) |
| 978 | return (1); |
| 979 | |
| 980 | ret = oval_probe_commcxx . . $ oval_probe_comm(e326d083cf31bf31).(ctx, pd, s_obj, flags, &s_sys); |
| 981 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(s_obj); |
| 982 | |
| 983 | if (ret != 0) { |
| 984 | switch (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!) { |
| 985 | case ECONNABORTEDcxx . . $ `<external>/17922322188510340118/errno.h:87:9`!: |
| 986 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Closing sd=%d (pd=%p) after abort", pd->sd, pd); |
| 987 | |
| 988 | SEAP_closecxx . . $ SEAP_close(1db39790f33892d1).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd.); |
| 989 | pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd. = -1; |
| 990 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = ECONNABORTEDcxx . . $ `<external>/17922322188510340118/errno.h:87:9`!; |
| 991 | } |
| 992 | return (ret); |
| 993 | } |
| 994 | |
| 995 | if (flags & OVAL_PDFLAG_NOREPLYcxx . . $ `src/OVAL/public/oval_probe.h:45:9`!) { |
| 996 | if (s_sys != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 997 | if (SEXP_typeofcxx . . $ SEXP_typeof(dfe0d2bfa8d6f3af).(s_sys) != SEXP_TYPE_LISTcxx . . $ `src/OVAL/probes/SEAP/public/sexp-types.h:78:9`! || SEXP_list_lengthcxx . . $ SEXP_list_length(7b7039adf1662ab5).(s_sys) != 0) { |
| 998 | /* |
| 999 | * The no-reply flag is set and oval_probe_comm returned some |
| 1000 | * data. This is considered a non-fatal error. |
| 1001 | */ |
| 1002 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Obtrusive data from probe!"); |
| 1003 | } |
| 1004 | if (SEXP_typeofcxx . . $ SEXP_typeof(dfe0d2bfa8d6f3af).(s_sys) == SEXP_TYPE_LISTcxx . . $ `src/OVAL/probes/SEAP/public/sexp-types.h:78:9`!) { |
| 1005 | SEXP_list_freecxx . . $ SEXP_list_free(c6b28547479798f4).(s_sys); |
| 1006 | } else { |
| 1007 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(s_sys); |
| 1008 | } |
| 1009 | } |
| 1010 | return (0); |
| 1011 | } |
| 1012 | |
| 1013 | /* |
| 1014 | * Convert the received S-exp to OVAL system characteristic. |
| 1015 | */ |
| 1016 | ret = oval_sexp_to_syschcxx . . $ oval_sexp_to_sysch(fb17cdf60ae672a9).(s_sys, syschar); |
| 1017 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(s_sys); |
| 1018 | |
| 1019 | return (ret); |
| 1020 | } |
| 1021 | |
| 1022 | int oval_probe_ext_resetcxx . . $ oval_probe_ext_reset(fb9ef5093e722c42).(SEAP_CTX_tcxx . . $ SEAP_CTX_t# *ctx, oval_pd_tcxx . . $ oval_pd_t# *pd, oval_pext_tcxx . . $ oval_pext_t# *pext) |
| 1023 | { |
| 1024 | SEAP_cmd_execcxx . . $ SEAP_cmd_exec(68703026cc6e447d).(ctx, pd->sdcxx . . $ $anonymous_type_97ec4dd9c18ba30d_0#sd., SEAP_EXEC_RECVcxx . . $ `src/OVAL/probes/SEAP/_seap-command.h:56:9`!, PROBECMD_RESETcxx . . $ `src/OVAL/probes/public/probe-api.h:442:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, SEAP_CMDTYPE_SYNCcxx . . $ `src/OVAL/probes/SEAP/_seap-command.h:44:9`!, 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`!); |
| 1025 | |
| 1026 | return (0); |
| 1027 | } |
| 1028 | |
| 1029 | #include <signal.h> |
| 1030 | #include "SEAP/_seap-types.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/_seap-types.h`/ |
| 1031 | #include "SEAP/seap-descriptor.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/seap-descriptor.h`/ |
| 1032 | |
| 1033 | #ifdef OS_WINDOWS |
| 1034 | |
| 1035 | int oval_probe_ext_abort(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext) |
| 1036 | { |
| 1037 | dE("Operation oval_probe_ext_abort is not supported on Windows!"); |
| 1038 | return 0; |
| 1039 | } |
| 1040 | |
| 1041 | #else |
| 1042 | |
| 1043 | int oval_probe_ext_abortcxx . . $ oval_probe_ext_abort(fb9ef5093e722c42).(SEAP_CTX_tcxx . . $ SEAP_CTX_t# *ctx, oval_pd_tcxx . . $ oval_pd_t# *pd, oval_pext_tcxx . . $ oval_pext_t# *pext) |
| 1044 | { |
| 1045 | return (0); |
| 1046 | } |
| 1047 | |
| 1048 | #endif |