| 1 | /** |
| 2 | * @file xinetd_probe.c |
| 3 | * @brief xinetd probe |
| 4 | * @author "Daniel Kopecek" <[email protected]> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2010 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 | * Daniel Kopecek <[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 <probe-api.h>cxx . . $ `<file>/src/OVAL/probes/public/probe-api.h`/ |
| 35 | #include <probe/probe.h>cxx . . $ `<file>/src/OVAL/probes/probe/probe.h`/ |
| 36 | #include <probe/entcmp.h>cxx . . $ `<file>/src/OVAL/probes/probe/entcmp.h`/ |
| 37 | #include <probe/option.h>cxx . . $ `<file>/src/OVAL/probes/probe/option.h`/ |
| 38 | #include <errno.h> |
| 39 | #include <unistd.h> |
| 40 | #include <stdlib.h> |
| 41 | #include <ctype.h> |
| 42 | #include <string.h> |
| 43 | #include <stddef.h> |
| 44 | #include <stdbool.h> |
| 45 | #include <stdint.h> |
| 46 | #include <limits.h> |
| 47 | #include <fcntl.h> |
| 48 | #include <sys/types.h> |
| 49 | #include <sys/stat.h> |
| 50 | #include <dirent.h> |
| 51 | #include <fnmatch.h> |
| 52 | #include <bfind.h>cxx . . $ `<file>/src/common/bfind.h`/ |
| 53 | #include <common/debug_priv.h>cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 54 | #include <netdb.h> |
| 55 | |
| 56 | #if defined(OS_FREEBSD) |
| 57 | #include <arpa/inet.h> |
| 58 | #endif |
| 59 | |
| 60 | #include "../SEAP/generic/rbt/rbt.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/generic/rbt/rbt.h`/ |
| 61 | #include "xinetd_probe.h"cxx . . $ `<file>/src/OVAL/probes/unix/xinetd_probe.h`/ |
| 62 | |
| 63 | #define PATH_SEPARATORcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:63:9`! '/' |
| 64 | |
| 65 | /* |
| 66 | * the code bellow implements a minimal xinetd configuration parser |
| 67 | */ |
| 68 | |
| 69 | #define XICFG_PARSER_IGNORE_UNKNOWNcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:69:9`! 1 |
| 70 | #define XICFG_PARSER_IGNORE_INVSECTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:70:9`! 0 |
| 71 | #define XICFG_PARSER_MAXFILESIZEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:71:9`! 655360 /**< hard limit for configuration file size; 640K ought to be enough for anybody */ |
| 72 | #define XICFG_PARSER_MAXFILECOUNTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:72:9`! 128 /**< a reasonable high limit for the number of configuration files to be opened at one time */ |
| 73 | |
| 74 | struct xiconf_attrcxx . . $ xiconf_attr# { |
| 75 | char *namecxx . . $ xiconf_attr#name.; /* name of the attribute */ |
| 76 | size_t offsetcxx . . $ xiconf_attr#offset.; /* offset of the corresponding member in the xinetd_service_t structure */ |
| 77 | int (*op_assigncxx . . $ xiconf_attr#op_assign.)(void *, char *); /* = */ |
| 78 | int (*op_insertcxx . . $ xiconf_attr#op_insert.)(void *, char *); /* += */ |
| 79 | int (*op_removecxx . . $ xiconf_attr#op_remove.)(void *, char *); /* -= */ |
| 80 | int (*op_coercecxx . . $ xiconf_attr#op_coerce.)(void *, int); /* coerce to another type */ |
| 81 | int (*op_mergecxx . . $ xiconf_attr#op_merge.) (void *, void *, int); /* merge two values */ |
| 82 | int sectionscxx . . $ xiconf_attr#sections.; /* which type of sections are valid */ |
| 83 | int pass_argcxx . . $ xiconf_attr#pass_arg.; |
| 84 | }; |
| 85 | |
| 86 | #define XIATTR_SECTION_NILcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:86:9`! 0x01 |
| 87 | #define XIATTR_SECTION_DEFcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:87:9`! 0x02 |
| 88 | #define XIATTR_SECTION_SRVcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:88:9`! 0x04 |
| 89 | |
| 90 | #define XIATTR_OPARG_LOCALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:90:9`! 0 /* local service attribute */ |
| 91 | #define XIATTR_OPARG_GLOBALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:91:9`! 1 /* xiconf_t structure */ |
| 92 | |
| 93 | #define XIATTR_MERGE_DEFAULTScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:93:9`! 1 |
| 94 | |
| 95 | #define XICONF_SECTION_DEFAULTScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:95:9`! XIATTR_SECTION_DEFcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:87:9`! |
| 96 | #define XICONF_SECTION_SERVICEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:96:9`! XIATTR_SECTION_SRVcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:88:9`! |
| 97 | |
| 98 | #define OPRES_SUCCESScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:98:9`! 0 |
| 99 | #define OPRES_ESYNTAXcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:99:9`! 1 /* Invalid syntax */ |
| 100 | #define OPRES_EINVALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:100:9`! 2 /* Invalid operation */ |
| 101 | #define OPRES_EFAULTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:101:9`! 3 /* Invalid memory access */ |
| 102 | #define OPRES_ELIMITcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:102:9`! 4 /* Limit reached */ |
| 103 | |
| 104 | typedef struct xiconf_servicecxx . . $ xiconf_service# { |
| 105 | /* |
| 106 | * Attributes needed by the xinetd probe |
| 107 | */ |
| 108 | char *idcxx . . $ xiconf_service#id.; |
| 109 | char *typecxx . . $ xiconf_service#type.; |
| 110 | char **flagscxx . . $ xiconf_service#flags.; |
| 111 | char *socket_typecxx . . $ xiconf_service#socket_type.; |
| 112 | char *namecxx . . $ xiconf_service#name.; |
| 113 | char *protocolcxx . . $ xiconf_service#protocol.; |
| 114 | char *usercxx . . $ xiconf_service#user.; |
| 115 | char *servercxx . . $ xiconf_service#server.; |
| 116 | char *server_argscxx . . $ xiconf_service#server_args.; |
| 117 | char **only_fromcxx . . $ xiconf_service#only_from.; |
| 118 | char **no_accesscxx . . $ xiconf_service#no_access.; |
| 119 | |
| 120 | uint16_tcxx . . $ uint16_t# portcxx . . $ xiconf_service#port.; |
| 121 | |
| 122 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! disablecxx . . $ xiconf_service#disable.; |
| 123 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! waitcxx . . $ xiconf_service#wait.; |
| 124 | int def_disabledcxx . . $ xiconf_service#def_disabled.; |
| 125 | int def_enabledcxx . . $ xiconf_service#def_enabled.; |
| 126 | |
| 127 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! internalcxx . . $ xiconf_service#internal.; |
| 128 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! unlistedcxx . . $ xiconf_service#unlisted.; |
| 129 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! rpccxx . . $ xiconf_service#rpc.; |
| 130 | |
| 131 | struct xiconf_servicecxx . . $ xiconf_service# *nextcxx . . $ xiconf_service#next.; |
| 132 | |
| 133 | #if 0 /* Unused attributes; Maybe we will need them in some future version. */ |
| 134 | bool groups; |
| 135 | bool mdns; |
| 136 | bool enabled; |
| 137 | char *log_on_success; |
| 138 | char *log_on_failure; |
| 139 | int32_t instances; |
| 140 | int32_t nice; |
| 141 | int32_t rpc_number; |
| 142 | int32_t per_source; |
| 143 | float max_load; |
| 144 | int64_t rlimit_as; |
| 145 | int64_t rlimit_cpu; |
| 146 | int64_t rlimit_data; |
| 147 | int64_t rlimit_rss; |
| 148 | int64_t rlimit_stack; |
| 149 | char *group; |
| 150 | char *access_times; |
| 151 | char *log_type; |
| 152 | char *rpc_version; |
| 153 | char *env; |
| 154 | char *passenv; |
| 155 | char *redirect; |
| 156 | char *bind; |
| 157 | char *interface; |
| 158 | char *banner; |
| 159 | char *banner_success; |
| 160 | char *banner_fail; |
| 161 | char *cps; |
| 162 | char *umask; |
| 163 | char *deny_time; |
| 164 | char *libwrap; |
| 165 | #endif /* 0 */ |
| 166 | } xiconf_service_tcxx . . $ xiconf_service_t#; |
| 167 | |
| 168 | typedef structcxx . . $ $anonymous_type_e980a4b00bc08fab_0# { |
| 169 | xiconf_service_tcxx . . $ xiconf_service_t# **srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.; |
| 170 | uint32_tcxx . . $ uint32_t# cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt.; |
| 171 | } xiconf_strans_tcxx . . $ xiconf_strans_t#; |
| 172 | |
| 173 | #define XICFG_STRANS_MAXKEYLENcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:173:9`! 256 |
| 174 | |
| 175 | typedef structcxx . . $ $anonymous_type_e980a4b00bc08fab_1# { |
| 176 | int fdcxx . . $ $anonymous_type_e980a4b00bc08fab_1#fd.; /**< file descriptor */ |
| 177 | char *cpathcxx . . $ $anonymous_type_e980a4b00bc08fab_1#cpath.; /**< path to the configuration file */ |
| 178 | time_tcxx . . $ time_t# mtimecxx . . $ $anonymous_type_e980a4b00bc08fab_1#mtime.; /**< modification time of the file */ |
| 179 | rbt_str_node_tcxx . . $ rbt_str_node_t# *nodescxx . . $ $anonymous_type_e980a4b00bc08fab_1#nodes.; /**< node pointers in the service tree that belong to this file; */ |
| 180 | size_t countcxx . . $ $anonymous_type_e980a4b00bc08fab_1#count.; /**< number of node pointers */ |
| 181 | char *inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.; /**< contents of the file mmaped or copied into memory */ |
| 182 | size_t inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.; /**< in-memory size */ |
| 183 | size_t inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; /**< in-memory offset */ |
| 184 | int flagscxx . . $ $anonymous_type_e980a4b00bc08fab_1#flags.; /**< flags; see bellow */ |
| 185 | unsigned int depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth.; /**< include depth */ |
| 186 | } xiconf_file_tcxx . . $ xiconf_file_t#; |
| 187 | |
| 188 | #define XICONF_FILE_MMAPEDcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:188:9`! 0x00000001 /**< try to mmap the file */ |
| 189 | #define XICONF_FILE_PERSISTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:189:9`! 0x00000002 /**< keep the file open/mmaped */ |
| 190 | #define XICONF_FILE_DEADcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:190:9`! 0x00000004 /**< this item can be skipped/deleted/reused for a different file */ |
| 191 | |
| 192 | typedef structcxx . . $ $anonymous_type_e980a4b00bc08fab_2# { |
| 193 | xiconf_file_tcxx . . $ xiconf_file_t# **cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.; /**< */ |
| 194 | size_t countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count.; /**< */ |
| 195 | rbt_tcxx . . $ rbt_t# *streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree.; /**< service tree */ |
| 196 | rbt_tcxx . . $ rbt_t# *ttreecxx . . $ $anonymous_type_e980a4b00bc08fab_2#ttree.; /**< service name & protocol to ID(s) tree */ |
| 197 | xiconf_service_tcxx . . $ xiconf_service_t# *defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults.; /**< parsed defaults for services */ |
| 198 | } xiconf_tcxx . . $ xiconf_t#; |
| 199 | |
| 200 | xiconf_tcxx . . $ xiconf_t# *xiconf_parsecxx . . $ xiconf_parse(f5b8ae12de0fe0ae).(const char *path, unsigned int max_depth); |
| 201 | void xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf_tcxx . . $ xiconf_t# *xiconf); |
| 202 | int xiconf_updatecxx . . $ xiconf_update(b7caf5a703c02030).(xiconf_tcxx . . $ xiconf_t# *xiconf); |
| 203 | int xiconf_parse_sectioncxx . . $ xiconf_parse_section(9625bdb04a939f38).(xiconf_tcxx . . $ xiconf_t# *xiconf, xiconf_file_tcxx . . $ xiconf_file_t# *xifile, int type, char *name); |
| 204 | int xiconf_parse_servicecxx . . $ xiconf_parse_service(9b8171991c37e1c6).(xiconf_file_tcxx . . $ xiconf_file_t# *file, xiconf_service_tcxx . . $ xiconf_service_t# *service); |
| 205 | int xiconf_parse_defaultscxx . . $ xiconf_parse_defaults(f3046f6d03b13edd).(xiconf_file_tcxx . . $ xiconf_file_t# *file, xiconf_service_tcxx . . $ xiconf_service_t# *defaults, rbt_tcxx . . $ rbt_t# *stree); |
| 206 | xiconf_strans_tcxx . . $ xiconf_strans_t# *xiconf_getservicecxx . . $ xiconf_getservice(eb1a29164e530e66).(xiconf_tcxx . . $ xiconf_t# *xiconf, char *name, char *prot); |
| 207 | xiconf_strans_tcxx . . $ xiconf_strans_t# *xiconf_dumpcxx . . $ xiconf_dump(a769c210e3489895).(xiconf_tcxx . . $ xiconf_t# *xiconf); |
| 208 | void xiconf_strans_freecxx . . $ xiconf_strans_free(c2fd63465702dca).(xiconf_strans_tcxx . . $ xiconf_strans_t# *strans); |
| 209 | |
| 210 | int op_assign_boolcxx . . $ op_assign_bool(e256373c99a31857).(void *var, char *val); |
| 211 | int op_assign_u16cxx . . $ op_assign_u16(e256373c99a31857).(void *var, char *val); |
| 212 | int op_merge_u16cxx . . $ op_merge_u16(8bc41909eac9e5d8).(void *dst, void *src, int type); |
| 213 | int op_assign_strcxx . . $ op_assign_str(e256373c99a31857).(void *var, char *val); |
| 214 | int op_merge_strcxx . . $ op_merge_str(8bc41909eac9e5d8).(void *dst, void *src, int type); |
| 215 | int op_assign_strlcxx . . $ op_assign_strl(e256373c99a31857).(void *var, char *val); |
| 216 | int op_insert_strlcxx . . $ op_insert_strl(e256373c99a31857).(void *var, char *val); |
| 217 | int op_remove_strlcxx . . $ op_remove_strl(e256373c99a31857).(void *var, char *val); |
| 218 | int op_assign_disabledcxx . . $ op_assign_disabled(e256373c99a31857).(void *var, char *val); |
| 219 | int op_assign_enabledcxx . . $ op_assign_enabled(e256373c99a31857).(void *var, char *val); |
| 220 | |
| 221 | #ifndef STR |
| 222 | # define STRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:222:10`!(s) #s |
| 223 | #endif |
| 224 | |
| 225 | #define XICONF_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:225:9`!(name, op_a, op_i, op_r) \ |
| 226 | { STR(name), offsetof(xiconf_service_t, name), (op_a), (op_i), (op_r) } |
| 227 | |
| 228 | /* |
| 229 | * Service only attribute. |
| 230 | * |
| 231 | * Flags set: |
| 232 | * - service section flag |
| 233 | * |
| 234 | * Functions implementing the operators get the pointer to the |
| 235 | * corresponding xiconf_service_t structure item pointer (using |
| 236 | * offsetof) as their first argument. |
| 237 | */ |
| 238 | #define XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(name, op_a, op_i, op_r, op_c, op_m) \ |
| 239 | { STRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:222:10`!(name), offsetofcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:431:9`!(xiconf_service_t, name), (op_a), (op_i), (op_r), (op_c), (op_m), XIATTR_SECTION_SRVcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:88:9`!, XIATTR_OPARG_LOCALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:90:9`! } |
| 240 | |
| 241 | /* |
| 242 | * Defaults only attribute. |
| 243 | * |
| 244 | * Flags set: |
| 245 | * - defaults section flag |
| 246 | * |
| 247 | * Type of the first argument to be passed to the operator |
| 248 | * functions has to be specified in the last argument. |
| 249 | * Recognized types are: |
| 250 | * XIATTR_OPTARG_LOCAL - ptr(service + offsetof(attr_name)) |
| 251 | * XIATTR_OPTARG_GLOBAL - pointer to the xiconf_t structure |
| 252 | */ |
| 253 | #define XICONF_DO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:253:9`!(name, op_a, op_i, op_r, op_c, op_m, off, arg) \ |
| 254 | { STRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:222:10`!(name), (off), (op_a), (op_i), (op_r), (op_c), (op_m), XIATTR_SECTION_DEFcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:87:9`!, (arg) } |
| 255 | |
| 256 | /* |
| 257 | * Service attribute which default attribute can be specified |
| 258 | * in the defaults section. |
| 259 | * |
| 260 | * Flags set: |
| 261 | * - service section flag |
| 262 | * - defaults section flag |
| 263 | * |
| 264 | * Functions implementing the operators get the pointer to the |
| 265 | * corresponding xiconf_service_t structure item pointer (using |
| 266 | * offsetof) as their first argument. |
| 267 | */ |
| 268 | #define XICONF_SD_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:268:9`!(name, op_a, op_i, op_r, op_c, op_m) \ |
| 269 | { STRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:222:10`!(name), offsetofcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:431:9`!(xiconf_service_t, name), (op_a), (op_i), (op_r), (op_c), (op_m), XIATTR_SECTION_SRVcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:88:9`!|XIATTR_SECTION_DEFcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:87:9`!, XIATTR_OPARG_LOCALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:90:9`! } |
| 270 | |
| 271 | /* |
| 272 | * Service attribute table; keep this table sorted by attribute name |
| 273 | */ |
| 274 | struct xiconf_attrcxx . . $ xiconf_attr# xiattr_tablecxx . . $ xiattr_table.[] = { |
| 275 | /* |
| 276 | * XICONF_ATTR(attr_name, op_assign, op_insert, op_remove) |
| 277 | */ |
| 278 | //XICONF_ATTR(access_times, NULL, NULL, NULL), |
| 279 | //XICONF_ATTR(banner, NULL, NULL, NULL), |
| 280 | //XICONF_ATTR(banner_fail, NULL, NULL, NULL), |
| 281 | //XICONF_ATTR(banner_success, NULL, NULL, NULL), |
| 282 | //XICONF_ATTR(bind, NULL, NULL, NULL), |
| 283 | //XICONF_ATTR(cps, NULL, NULL, NULL), |
| 284 | //XICONF_ATTR(deny_time, NULL, NULL, NULL), |
| 285 | |
| 286 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(disable, |
| 287 | &op_assign_bool, 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`!, 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`!), |
| 288 | XICONF_DO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:253:9`!(disabled, |
| 289 | &op_assign_disabled, 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`!, 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`!, 0, XIATTR_OPARG_GLOBALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:91:9`!), |
| 290 | XICONF_DO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:253:9`!(enabled, |
| 291 | &op_assign_enabled, 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`!, 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`!, 0, XIATTR_OPARG_GLOBALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:91:9`!), |
| 292 | |
| 293 | //XICONF_ATTR(env, NULL, NULL, NULL), |
| 294 | |
| 295 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(flags, |
| 296 | &op_assign_strl, &op_insert_strl, &op_remove_strl, 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`!), |
| 297 | |
| 298 | //XICONF_ATTR(group, NULL, NULL, NULL), |
| 299 | //XICONF_ATTR(groups, NULL, NULL, NULL), |
| 300 | |
| 301 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(id, |
| 302 | &op_assign_str, 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`!, 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`!), |
| 303 | |
| 304 | //XICONF_ATTR(instances, NULL, NULL, NULL), |
| 305 | //XICONF_ATTR(interface, NULL, NULL, NULL), |
| 306 | //XICONF_ATTR(libwrap, NULL, NULL, NULL), |
| 307 | //XICONF_ATTR(log_on_failure, NULL, NULL, NULL), |
| 308 | //XICONF_ATTR(log_on_success, NULL, NULL, NULL), |
| 309 | //XICONF_ATTR(log_type, NULL, NULL, NULL), |
| 310 | //XICONF_ATTR(max_load, NULL, NULL, NULL), |
| 311 | //XICONF_ATTR(mdns, NULL, NULL, NULL), |
| 312 | //XICONF_ATTR(nice, NULL, NULL, NULL), |
| 313 | |
| 314 | XICONF_SD_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:268:9`!(no_access, |
| 315 | &op_assign_strl, &op_insert_strl, &op_remove_strl, 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`!), |
| 316 | XICONF_SD_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:268:9`!(only_from, |
| 317 | &op_assign_strl, &op_insert_strl, &op_remove_strl, 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`!), |
| 318 | |
| 319 | //XICONF_ATTR(passenv, NULL, NULL, NULL), |
| 320 | //XICONF_ATTR(per_source, NULL, NULL, NULL), |
| 321 | |
| 322 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(port, |
| 323 | &op_assign_u16, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &op_merge_u16), |
| 324 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(protocol, |
| 325 | &op_assign_str, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &op_merge_str), |
| 326 | |
| 327 | //XICONF_ATTR(redirect, NULL, NULL, NULL), |
| 328 | //XICONF_ATTR(rlimit_as, NULL, NULL, NULL), |
| 329 | //XICONF_ATTR(rlimit_cpu, NULL, NULL, NULL), |
| 330 | //XICONF_ATTR(rlimit_data, NULL, NULL, NULL), |
| 331 | //XICONF_ATTR(rlimit_rss, NULL, NULL, NULL), |
| 332 | //XICONF_ATTR(rlimit_stack, NULL, NULL, NULL), |
| 333 | //XICONF_ATTR(rpc_number, NULL, NULL, NULL), |
| 334 | //XICONF_ATTR(rpc_version, NULL, NULL, NULL), |
| 335 | |
| 336 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(server, |
| 337 | &op_assign_str, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &op_merge_str), |
| 338 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(server_args, |
| 339 | &op_assign_str, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &op_merge_str), |
| 340 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(socket_type, |
| 341 | &op_assign_str, 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`!, 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`!), |
| 342 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(type, |
| 343 | &op_assign_str, 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`!, 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`!), |
| 344 | |
| 345 | //XICONF_ATTR(umask, NULL, NULL, NULL), |
| 346 | |
| 347 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(user, |
| 348 | &op_assign_str, 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`!, 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`!), |
| 349 | XICONF_SO_ATTRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:238:9`!(wait, |
| 350 | &op_assign_bool, 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`!, 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`!) |
| 351 | }; |
| 352 | |
| 353 | #define XIATTR_TABLE_COUNTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:353:9`! (sizeof xiattr_table / sizeof(struct xiconf_attr)) |
| 354 | |
| 355 | #define xiattr_ptrcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:355:9`!(ptr, off) ((void *)(((uint8_t *)(ptr))+(off))) |
| 356 | |
| 357 | static int xiattr_cmpcxx . . $ xiattr_cmp(361d5d7064a2a85d).(void *a, void *b) |
| 358 | { |
| 359 | return strcmpcxx . . $ strcmp(5ae29d726ae57f88).((char *)a, ((struct xiconf_attrcxx . . $ xiconf_attr# *)b)->namecxx . . $ xiconf_attr#name.); |
| 360 | } |
| 361 | |
| 362 | /* |
| 363 | * Allocate and initialize a xinetd configuration structure |
| 364 | */ |
| 365 | static xiconf_tcxx . . $ xiconf_t# *xiconf_newcxx . . $ xiconf_new(25aaf72b6c2c4856).(void) |
| 366 | { |
| 367 | xiconf_tcxx . . $ xiconf_t# *xiconf = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_tcxx . . $ xiconf_t#)); |
| 368 | xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile. = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_file_tcxx . . $ xiconf_file_t# *)); |
| 369 | xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count. = 0; |
| 370 | xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree. = rbt_str_newcxx . . $ rbt_str_new(557e4aca7c153cb).(); |
| 371 | xiconf->ttreecxx . . $ $anonymous_type_e980a4b00bc08fab_2#ttree. = rbt_str_newcxx . . $ rbt_str_new(557e4aca7c153cb).(); |
| 372 | xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 373 | |
| 374 | return (xiconf); |
| 375 | } |
| 376 | |
| 377 | static xiconf_service_tcxx . . $ xiconf_service_t# *xiconf_service_newcxx . . $ xiconf_service_new(d730cd206a75c606).(void) |
| 378 | { |
| 379 | xiconf_service_tcxx . . $ xiconf_service_t# *service = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_service_tcxx . . $ xiconf_service_t#)); |
| 380 | |
| 381 | service->idcxx . . $ xiconf_service#id. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 382 | service->typecxx . . $ xiconf_service#type. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 383 | service->flagscxx . . $ xiconf_service#flags. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 384 | service->socket_typecxx . . $ xiconf_service#socket_type. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 385 | service->namecxx . . $ xiconf_service#name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 386 | service->protocolcxx . . $ xiconf_service#protocol. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 387 | service->usercxx . . $ xiconf_service#user. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 388 | service->servercxx . . $ xiconf_service#server. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 389 | service->server_argscxx . . $ xiconf_service#server_args. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 390 | service->only_fromcxx . . $ xiconf_service#only_from. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 391 | service->no_accesscxx . . $ xiconf_service#no_access. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 392 | service->portcxx . . $ xiconf_service#port. = 0; |
| 393 | service->disablecxx . . $ xiconf_service#disable. = 0; |
| 394 | service->waitcxx . . $ xiconf_service#wait. = 0; |
| 395 | service->def_disabledcxx . . $ xiconf_service#def_disabled. = 0; |
| 396 | service->def_enabledcxx . . $ xiconf_service#def_enabled. = 0; |
| 397 | |
| 398 | service->internalcxx . . $ xiconf_service#internal. = 0; |
| 399 | service->unlistedcxx . . $ xiconf_service#unlisted. = 0; |
| 400 | service->rpccxx . . $ xiconf_service#rpc. = 0; |
| 401 | |
| 402 | service->nextcxx . . $ xiconf_service#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 403 | |
| 404 | return (service); |
| 405 | } |
| 406 | |
| 407 | static void xiconf_service_freecxx . . $ xiconf_service_free(42eb29d01799d060).(xiconf_service_tcxx . . $ xiconf_service_t# *service) |
| 408 | { |
| 409 | if (service == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 410 | return; |
| 411 | |
| 412 | #define NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(p) if (service->p != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) free(service->p) |
| 413 | |
| 414 | if (service->idcxx . . $ xiconf_service#id. != service->namecxx . . $ xiconf_service#name.) |
| 415 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(id); |
| 416 | |
| 417 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(name); |
| 418 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(type); |
| 419 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(flags); |
| 420 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(socket_type); |
| 421 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(protocol); |
| 422 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(user); |
| 423 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(server); |
| 424 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(server_args); |
| 425 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(only_from); |
| 426 | NONNULL_FREEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:412:9`!(no_access); |
| 427 | |
| 428 | if (service->nextcxx . . $ xiconf_service#next. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 429 | xiconf_service_freecxx . . $ xiconf_service_free(42eb29d01799d060).(service->nextcxx . . $ xiconf_service#next.); |
| 430 | } |
| 431 | |
| 432 | freecxx . . $ free(5d22bdacc48458e8).(service); |
| 433 | } |
| 434 | |
| 435 | static void xiconf_stree_free_cbcxx . . $ xiconf_stree_free_cb(bd95e63a1880cd3a).(struct rbt_str_nodecxx . . $ rbt_str_node# *n) |
| 436 | { |
| 437 | xiconf_service_freecxx . . $ xiconf_service_free(42eb29d01799d060).(n->datacxx . . $ rbt_str_node#data.); |
| 438 | } |
| 439 | |
| 440 | static void xiconf_ttree_free_cbcxx . . $ xiconf_ttree_free_cb(bd95e63a1880cd3a).(struct rbt_str_nodecxx . . $ rbt_str_node# *n) |
| 441 | { |
| 442 | xiconf_strans_freecxx . . $ xiconf_strans_free(c2fd63465702dca).(n->datacxx . . $ rbt_str_node#data.); |
| 443 | freecxx . . $ free(5d22bdacc48458e8).(n->keycxx . . $ rbt_str_node#key.); |
| 444 | } |
| 445 | |
| 446 | void xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf_tcxx . . $ xiconf_t# *xiconf) |
| 447 | { |
| 448 | register size_t i; |
| 449 | |
| 450 | if (xiconf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 451 | return; |
| 452 | |
| 453 | for (i = 0; i < xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count.; ++i) { |
| 454 | if (xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[i]) { |
| 455 | if (xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[i]->cpathcxx . . $ $anonymous_type_e980a4b00bc08fab_1#cpath.) |
| 456 | freecxx . . $ free(5d22bdacc48458e8).(xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[i]->cpathcxx . . $ $anonymous_type_e980a4b00bc08fab_1#cpath.); |
| 457 | if (xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[i]->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.) |
| 458 | freecxx . . $ free(5d22bdacc48458e8).(xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[i]->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.); |
| 459 | freecxx . . $ free(5d22bdacc48458e8).(xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[i]); |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | freecxx . . $ free(5d22bdacc48458e8).(xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.); |
| 464 | |
| 465 | rbt_str_free_cbcxx . . $ rbt_str_free_cb(d6c6edd7b040d8d5).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., xiconf_stree_free_cbcxx . . $ xiconf_stree_free_cb(bd95e63a1880cd3a).); |
| 466 | rbt_str_free_cbcxx . . $ rbt_str_free_cb(d6c6edd7b040d8d5).(xiconf->ttreecxx . . $ $anonymous_type_e980a4b00bc08fab_2#ttree., xiconf_ttree_free_cbcxx . . $ xiconf_ttree_free_cb(bd95e63a1880cd3a).); |
| 467 | |
| 468 | if (xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 469 | freecxx . . $ free(5d22bdacc48458e8).(xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults.->namecxx . . $ xiconf_service#name.); |
| 470 | freecxx . . $ free(5d22bdacc48458e8).(xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults.); |
| 471 | } |
| 472 | |
| 473 | freecxx . . $ free(5d22bdacc48458e8).(xiconf); |
| 474 | |
| 475 | return; |
| 476 | } |
| 477 | |
| 478 | static xiconf_file_tcxx . . $ xiconf_file_t# *xiconf_readcxx . . $ xiconf_read(d9867385071d6115).(const char *path, int flags) |
| 479 | { |
| 480 | int fd; |
| 481 | struct statcxx . . $ stat# st; |
| 482 | |
| 483 | fd = opencxx . . $ open(e156e3aa1e5c4ad1).(path, O_RDONLYcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:43:9`!); |
| 484 | |
| 485 | if (fd < 0) |
| 486 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 487 | |
| 488 | if (fstatcxx . . $ fstat(a43660ce2f600cb5).(fd, &st) < 0) { |
| 489 | closecxx . . $ close(7864480464b09eea). (fd); |
| 490 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 491 | } |
| 492 | |
| 493 | if ((st.st_modecxx . . $ stat#st_mode. & S_IFMTcxx . . $ `<external>/531885356569766532/stat.h:104:10`!) != S_IFREGcxx . . $ `<external>/531885356569766532/stat.h:108:10`!) { |
| 494 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Not a regular file: %s", path); |
| 495 | closecxx . . $ close(7864480464b09eea). (fd); |
| 496 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 497 | } |
| 498 | |
| 499 | if (st.st_sizecxx . . $ stat#st_size. > XICFG_PARSER_MAXFILESIZEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:71:9`!) { |
| 500 | /* You're probably trying to parse a wrong file... or 640k is not enough for you. */ |
| 501 | closecxx . . $ close(7864480464b09eea). (fd); |
| 502 | |
| 503 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 504 | } |
| 505 | |
| 506 | xiconf_file_tcxx . . $ xiconf_file_t# *file = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_file_tcxx . . $ xiconf_file_t#)); |
| 507 | |
| 508 | /* initialize items that don't need to have extra memory allocated for them */ |
| 509 | file->fdcxx . . $ $anonymous_type_e980a4b00bc08fab_1#fd. = fd; |
| 510 | file->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen. = (size_t)st.st_sizecxx . . $ stat#st_size.; |
| 511 | file->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff. = 0; |
| 512 | file->mtimecxx . . $ $anonymous_type_e980a4b00bc08fab_1#mtime. = st.st_mtimecxx . . $ `<external>/16045971866008360577/struct_stat.h:78:11`!; |
| 513 | file->nodescxx . . $ $anonymous_type_e980a4b00bc08fab_1#nodes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 514 | file->countcxx . . $ $anonymous_type_e980a4b00bc08fab_1#count. = 0; |
| 515 | file->flagscxx . . $ $anonymous_type_e980a4b00bc08fab_1#flags. = flags; |
| 516 | |
| 517 | #if !defined(XICFG_PARSER_WITHOUT_MMAP) && defined(HAVE_MMAP) |
| 518 | file->inmem = mmap (NULL, file->inlen, PROT_READ, MAP_SHARED, file->fd, 0); |
| 519 | |
| 520 | if (file->inmem == MAP_FAILED) |
| 521 | #endif |
| 522 | { |
| 523 | /* fallback method - copy the contents into memory */ |
| 524 | |
| 525 | file->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem. = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(file->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.+1); |
| 526 | file->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.[file->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.] = '\0'; |
| 527 | |
| 528 | if (readcxx . . $ read(7e34d0a36f355389). (file->fdcxx . . $ $anonymous_type_e980a4b00bc08fab_1#fd., file->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem., file->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.) != (ssize_tcxx . . $ ssize_t#)file->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.) { |
| 529 | /* Can't read the contents of the file */ |
| 530 | closecxx . . $ close(7864480464b09eea). (fd); |
| 531 | freecxx . . $ free(5d22bdacc48458e8).(file); |
| 532 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 533 | } |
| 534 | |
| 535 | /* |
| 536 | * We have the contents of the file and don't need the fd anymore. |
| 537 | * Unless the FILE_PERSIST flag is set, close fd now. The allocated |
| 538 | * memory will be freed after the parsing is done |
| 539 | */ |
| 540 | if (!(flags & XICONF_FILE_PERSISTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:189:9`!)) { |
| 541 | closecxx . . $ close(7864480464b09eea).(fd); |
| 542 | file->fdcxx . . $ $anonymous_type_e980a4b00bc08fab_1#fd. = -1; |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | /* now initialize item that do need extra memory to be allocated */ |
| 547 | file->cpathcxx . . $ $anonymous_type_e980a4b00bc08fab_1#cpath. = strdupcxx . . $ strdup(a8b8e32347182212).(path); |
| 548 | |
| 549 | return (file); |
| 550 | } |
| 551 | |
| 552 | static int xiconf_add_cfilecxx . . $ xiconf_add_cfile(af7c41febd0de46a).(xiconf_tcxx . . $ xiconf_t# *xiconf, const char *path, int depth) |
| 553 | { |
| 554 | xiconf_file_tcxx . . $ xiconf_file_t# *xifile; |
| 555 | |
| 556 | if (xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count. + 1 > XICFG_PARSER_MAXFILECOUNTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:72:9`!) { |
| 557 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("include count limit reached: %u", XICFG_PARSER_MAXFILECOUNTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:72:9`!); |
| 558 | return (-1); |
| 559 | } |
| 560 | |
| 561 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Reading included file: %s", path); |
| 562 | xifile = xiconf_readcxx . . $ xiconf_read(d9867385071d6115). (path, 0); |
| 563 | |
| 564 | if (xifile == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 565 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Failed to read file: %s", path); |
| 566 | return (-1); |
| 567 | } |
| 568 | |
| 569 | xifile->depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth. = depth; |
| 570 | void *cfile = realloccxx . . $ realloc(417ab160f6baadc6).(xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile., sizeof(xiconf_file_tcxx . . $ xiconf_file_t# *) * ++xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count.); |
| 571 | if (cfile == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 572 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Failed re-allocate memory for cfile"); |
| 573 | xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count.--; |
| 574 | if (xifile->cpathcxx . . $ $anonymous_type_e980a4b00bc08fab_1#cpath.) |
| 575 | freecxx . . $ free(5d22bdacc48458e8).(xifile->cpathcxx . . $ $anonymous_type_e980a4b00bc08fab_1#cpath.); |
| 576 | if (xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.) |
| 577 | freecxx . . $ free(5d22bdacc48458e8).(xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.); |
| 578 | freecxx . . $ free(5d22bdacc48458e8).(xifile); |
| 579 | return (-1); |
| 580 | } |
| 581 | xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile. = cfile; |
| 582 | xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count. - 1] = xifile; |
| 583 | |
| 584 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Added new file to the cfile queue: %s; fi=%zu", path, xiconf->count - 1); |
| 585 | |
| 586 | return (0); |
| 587 | } |
| 588 | |
| 589 | #define tmpbuf_defcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:589:9`!(size) char __tmpbuf[size] |
| 590 | #define tmpbuf_getcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:590:9`!(size) (((sizeof __tmpbuf)/sizeof(char))<(size)?malloc(sizeof(char)*(size)):__tmpbuf) |
| 591 | #define tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(ptr) do { if ((ptr) != __tmpbuf) free(ptr); (ptr) = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; } while(0) |
| 592 | |
| 593 | xiconf_tcxx . . $ xiconf_t# *xiconf_parsecxx . . $ xiconf_parse(f5b8ae12de0fe0ae).(const char *path, unsigned int max_depth) |
| 594 | { |
| 595 | xiconf_tcxx . . $ xiconf_t# *xiconf; |
| 596 | xiconf_file_tcxx . . $ xiconf_file_t# *xifile; /* pointer to the currently parsed file */ |
| 597 | size_t findex; /* index of currently parsed file */ |
| 598 | |
| 599 | tmpbuf_defcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:589:9`!(512); |
| 600 | |
| 601 | if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 602 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 603 | |
| 604 | xiconf = xiconf_newcxx . . $ xiconf_new(25aaf72b6c2c4856).(); |
| 605 | |
| 606 | if (xiconf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 607 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 608 | |
| 609 | xifile = xiconf_readcxx . . $ xiconf_read(d9867385071d6115).(path, 0); |
| 610 | |
| 611 | if (xifile == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 612 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf); |
| 613 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 614 | } |
| 615 | |
| 616 | xifile->depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth. = 0; |
| 617 | xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[0] = xifile; |
| 618 | xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count. = 1; |
| 619 | |
| 620 | for (findex = 0; findex < xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count.; ++findex) { |
| 621 | char *buffer; |
| 622 | register char *l_pbeg, *l_pend; |
| 623 | register size_t bufidx, l_size; |
| 624 | |
| 625 | /* sanity checks */ |
| 626 | if (xifile->depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth. > max_depth && xiconf->countcxx . . $ $anonymous_type_e980a4b00bc08fab_2#count. > findex) |
| 627 | abortcxx . . $ abort(8df32a62017fbbf6).(); |
| 628 | |
| 629 | xifile = xiconf->cfilecxx . . $ $anonymous_type_e980a4b00bc08fab_2#cfile.[findex]; |
| 630 | |
| 631 | for (;xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff. < xifile->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.;) { |
| 632 | /* locate end-of-line & compute the line lenght */ |
| 633 | l_pbeg = xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem. + xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; |
| 634 | l_pend = strchrcxx . . $ strchr(2050848944e00d54).(l_pbeg, '\n'); |
| 635 | |
| 636 | if (l_pend == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 637 | l_pend = l_pbeg + xifile->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.; |
| 638 | l_size = xifile->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.; |
| 639 | } else |
| 640 | l_size = (size_t)(l_pend - l_pbeg); |
| 641 | |
| 642 | xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff. += l_size + 1; /* update the next line offset */ |
| 643 | |
| 644 | /* |
| 645 | * copy the current line into a separate buffer |
| 646 | * where we can modify the data (change spaces to |
| 647 | * newlines, etc.) |
| 648 | */ |
| 649 | buffer = tmpbuf_getcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:590:9`!(l_size + 1); |
| 650 | bufidx = 0; |
| 651 | memcpycxx . . $ memcpy(cc817cb175f282d). (buffer, l_pbeg, l_size); |
| 652 | buffer[l_size] = ' '; |
| 653 | *strchrcxx . . $ strchr(2050848944e00d54).(buffer, ' ') = '\0'; |
| 654 | |
| 655 | /* skip whitespaces before the keyword */ |
| 656 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(buffer[bufidx])) ++bufidx; |
| 657 | |
| 658 | switch(buffer[bufidx]) { |
| 659 | case 's': |
| 660 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).("ervice", buffer + bufidx + 1) == 0) { |
| 661 | /* skip the service keyword */ |
| 662 | bufidx += 8; |
| 663 | |
| 664 | if (bufidx >= l_size) { |
| 665 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 666 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf); |
| 667 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 668 | } |
| 669 | |
| 670 | /* skip whitespaces before the keyword */ |
| 671 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(buffer[bufidx])) ++bufidx; |
| 672 | |
| 673 | if (bufidx >= l_size) { |
| 674 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 675 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf); |
| 676 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 677 | } |
| 678 | |
| 679 | *strchrcxx . . $ strchr(2050848944e00d54).(buffer + bufidx, ' ') = '\0'; |
| 680 | |
| 681 | if (xiconf_parse_sectioncxx . . $ xiconf_parse_section(9625bdb04a939f38). (xiconf, xifile, XICONF_SECTION_SERVICEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:96:9`!, buffer + bufidx) != 0) { |
| 682 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 683 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf); |
| 684 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 685 | } |
| 686 | } |
| 687 | break; |
| 688 | case 'd': |
| 689 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).("efaults", buffer + bufidx + 1) == 0) { |
| 690 | if (xiconf_parse_sectioncxx . . $ xiconf_parse_section(9625bdb04a939f38). (xiconf, xifile, XICONF_SECTION_DEFAULTScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:95:9`!, buffer + bufidx) != 0) { |
| 691 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 692 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf); |
| 693 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 694 | } |
| 695 | } |
| 696 | break; |
| 697 | case '#': |
| 698 | /* comment */ |
| 699 | case '\0': |
| 700 | /* blank line */ |
| 701 | break; |
| 702 | case 'i': |
| 703 | { |
| 704 | #define XICONF_INCTYPE_FILEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:704:9`! 0 |
| 705 | #define XICONF_INCTYPE_DIRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:705:9`! 1 |
| 706 | int inctype = -1; |
| 707 | char *inclarg; |
| 708 | char pathbuf[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!+1]; |
| 709 | size_t incllen; |
| 710 | |
| 711 | incllen = strlencxx . . $ strlen(751346f8406fd082). (buffer + bufidx); |
| 712 | |
| 713 | if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).("nclude", buffer + bufidx + 1, 6) != 0) |
| 714 | break; |
| 715 | switch (buffer[bufidx+1+6]) { |
| 716 | case '\0': |
| 717 | inctype = XICONF_INCTYPE_FILEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:704:9`!; |
| 718 | break; |
| 719 | case 'd': |
| 720 | if (buffer[bufidx+1+6+1] == 'i' && |
| 721 | buffer[bufidx+1+6+2] == 'r' && |
| 722 | buffer[bufidx+1+6+3] == '\0') |
| 723 | { |
| 724 | inctype = XICONF_INCTYPE_DIRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:705:9`!; |
| 725 | } |
| 726 | break; |
| 727 | } |
| 728 | |
| 729 | /* |
| 730 | * Get the include(dir) argument |
| 731 | */ |
| 732 | bufidx += strlencxx . . $ strlen(751346f8406fd082).("includedir"); |
| 733 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(buffer[bufidx])) ++bufidx; |
| 734 | inclarg = buffer + bufidx + 1; |
| 735 | buffer[l_size] = '\0'; |
| 736 | |
| 737 | if (*inclarg == '\0') { |
| 738 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Found includedir directive without an argument!"); |
| 739 | break; |
| 740 | } |
| 741 | |
| 742 | if (xifile->depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth. + 1 > max_depth) { |
| 743 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("include depth limit reached: %u", max_depth); |
| 744 | break; |
| 745 | } |
| 746 | |
| 747 | switch (inctype) { |
| 748 | case XICONF_INCTYPE_FILEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:704:9`!: |
| 749 | strncpycxx . . $ strncpy(255158a415b673b0). (pathbuf, inclarg, sizeof(pathbuf)-1); |
| 750 | |
| 751 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("includefile: %s", pathbuf); |
| 752 | |
| 753 | if (xiconf_add_cfilecxx . . $ xiconf_add_cfile(af7c41febd0de46a). (xiconf, pathbuf, xifile->depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth. + 1) != 0) { |
| 754 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 755 | continue; |
| 756 | } |
| 757 | else |
| 758 | break; |
| 759 | case XICONF_INCTYPE_DIRcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:705:9`!: |
| 760 | { |
| 761 | DIRcxx . . $ DIR# *dirfp; |
| 762 | struct direntcxx . . $ dirent# *dent = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 763 | |
| 764 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("includedir open: %s", inclarg); |
| 765 | dirfp = opendircxx . . $ opendir(f465d4b65cec8dd2). (inclarg); |
| 766 | |
| 767 | if (dirfp == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 768 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Can't open includedir: %s; %d, %s.", inclarg, errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 769 | break; |
| 770 | } |
| 771 | |
| 772 | strcpycxx . . $ strcpy(b7b3a83273496486). (pathbuf, inclarg); |
| 773 | incllen = strlencxx . . $ strlen(751346f8406fd082).(inclarg); |
| 774 | |
| 775 | if (pathbuf[incllen - 1] != PATH_SEPARATORcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:63:9`!) { |
| 776 | if (incllen < PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!) { |
| 777 | pathbuf[incllen++] = '/'; |
| 778 | pathbuf[incllen ] = '\0'; |
| 779 | } else { |
| 780 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Length of the includedir argument is out of range: len=%zu, max=%zu", |
| 781 | incllen, PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!); |
| 782 | closedircxx . . $ closedir(ac30a447bc7c2f80).(dirfp); |
| 783 | break; |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | for (;;) { |
| 788 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 789 | dent = readdircxx . . $ readdir(ffbaae344e1a615a). (dirfp); |
| 790 | if (dent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 791 | if (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!) |
| 792 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Can't read directory: %s; %d, %s.", inclarg, errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!, strerror (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 793 | break; |
| 794 | } |
| 795 | |
| 796 | if (fnmatchcxx . . $ fnmatch(f0be30763a490cce). ("*~", dent->d_namecxx . . $ dirent#d_name., FNM_PATHNAMEcxx . . $ `<external>/16949266674305116258/fnmatch.h:32:9`!) == 0 || |
| 797 | fnmatchcxx . . $ fnmatch(f0be30763a490cce). ("*.*", dent->d_namecxx . . $ dirent#d_name., FNM_PATHNAMEcxx . . $ `<external>/16949266674305116258/fnmatch.h:32:9`!) == 0) |
| 798 | { |
| 799 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Skipping: %s", dent->d_name); |
| 800 | continue; |
| 801 | } |
| 802 | |
| 803 | strcpycxx . . $ strcpy(b7b3a83273496486).(pathbuf + incllen, dent->d_namecxx . . $ dirent#d_name.); |
| 804 | |
| 805 | if (xiconf_add_cfilecxx . . $ xiconf_add_cfile(af7c41febd0de46a). (xiconf, pathbuf, xifile->depthcxx . . $ $anonymous_type_e980a4b00bc08fab_1#depth. + 1) != 0) |
| 806 | continue; |
| 807 | } |
| 808 | |
| 809 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("includedir close: %s", inclarg); |
| 810 | closedircxx . . $ closedir(ac30a447bc7c2f80).(dirfp); |
| 811 | break; |
| 812 | }} |
| 813 | break; |
| 814 | } |
| 815 | default: |
| 816 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Don't know how to parse the line: %s", buffer); |
| 817 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 818 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(xiconf); |
| 819 | |
| 820 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 821 | } |
| 822 | |
| 823 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 824 | } |
| 825 | } |
| 826 | |
| 827 | return (xiconf); |
| 828 | } |
| 829 | |
| 830 | int xiconf_updatecxx . . $ xiconf_update(b7caf5a703c02030).(xiconf_tcxx . . $ xiconf_t# *xiconf) |
| 831 | { |
| 832 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Not implemented yet."); |
| 833 | return (0); |
| 834 | } |
| 835 | |
| 836 | static int xiconf_service_merge_defaultscxx . . $ xiconf_service_merge_defaults(6788f6af2cacae7a).(xiconf_service_tcxx . . $ xiconf_service_t# *dst, xiconf_service_tcxx . . $ xiconf_service_t# *def) |
| 837 | { |
| 838 | register size_t i; |
| 839 | |
| 840 | for (i = 0; i < XIATTR_TABLE_COUNTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:353:9`!; ++i) { |
| 841 | if (xiattr_tablecxx . . $ xiattr_table.[i].pass_argcxx . . $ xiconf_attr#pass_arg. == XIATTR_OPARG_LOCALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:90:9`! && |
| 842 | xiattr_tablecxx . . $ xiattr_table.[i].sectionscxx . . $ xiconf_attr#sections. & XIATTR_SECTION_DEFcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:87:9`! && |
| 843 | xiattr_tablecxx . . $ xiattr_table.[i].op_mergecxx . . $ xiconf_attr#op_merge. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 844 | { |
| 845 | if (xiattr_tablecxx . . $ xiattr_table.[i].op_mergecxx . . $ xiconf_attr#op_merge. (xiattr_ptrcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:355:9`!(dst, xiattr_table[i].offset), |
| 846 | xiattr_ptrcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:355:9`!(def, xiattr_table[i].offset), XIATTR_MERGE_DEFAULTScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:93:9`!) != 0) |
| 847 | { |
| 848 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Merge failed. Merge operation returned a non-zero value."); |
| 849 | return (-1); |
| 850 | } |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | return (0); |
| 855 | } |
| 856 | |
| 857 | int xiconf_parse_sectioncxx . . $ xiconf_parse_section(9625bdb04a939f38).(xiconf_tcxx . . $ xiconf_t# *xiconf, xiconf_file_tcxx . . $ xiconf_file_t# *xifile, int type, char *name) |
| 858 | { |
| 859 | xiconf_service_tcxx . . $ xiconf_service_t# *snew, *scur; |
| 860 | char *buffer; |
| 861 | register size_t bufidx, keyidx; |
| 862 | char *l_pbeg; |
| 863 | char *l_pend; |
| 864 | size_t l_size; |
| 865 | char *key, *op, *opval; |
| 866 | void **opvar; |
| 867 | int (*opfun)(void *, char *); |
| 868 | struct xiconf_attrcxx . . $ xiconf_attr# *xiattr; |
| 869 | tmpbuf_defcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:589:9`!(128); |
| 870 | |
| 871 | if (type == XICONF_SECTION_DEFAULTScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:95:9`! && xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 872 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("defaults section was already parsed!"); |
| 873 | return (-1); |
| 874 | } else if (type == XICONF_SECTION_SERVICEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:96:9`! && name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 875 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Don't know how to handle anonymous service sections!"); |
| 876 | return (-1); |
| 877 | } |
| 878 | |
| 879 | /* |
| 880 | * Find the left brace. Only the left brace, whitespace |
| 881 | * characters before and after it and a newline character |
| 882 | * at the end are allowed here. |
| 883 | */ |
| 884 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(xifile->inmem[xifile->inoff])) |
| 885 | ++xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; |
| 886 | if (xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.[xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.] != '{') |
| 887 | return(-1); |
| 888 | else |
| 889 | ++xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; |
| 890 | while(xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.[xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.] != '\n' && |
| 891 | isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(xifile->inmem[xifile->inoff])) |
| 892 | ++xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; |
| 893 | if (xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem.[xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.] != '\n') |
| 894 | return (-1); |
| 895 | else |
| 896 | ++xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; |
| 897 | |
| 898 | /* |
| 899 | * Now there should be only <keyword> <op> <value> items, comments |
| 900 | * blank lines or a right brace which signals and of the section. |
| 901 | */ |
| 902 | snew = xiconf_service_newcxx . . $ xiconf_service_new(d730cd206a75c606).(); |
| 903 | snew->namecxx . . $ xiconf_service#name. = strdupcxx . . $ strdup(a8b8e32347182212).(name); |
| 904 | |
| 905 | for (;;) { |
| 906 | /* |
| 907 | * Find out the line boundaries. |
| 908 | */ |
| 909 | l_pbeg = xifile->inmemcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inmem. + xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff.; |
| 910 | l_pend = strchrcxx . . $ strchr(2050848944e00d54).(l_pbeg, '\n'); |
| 911 | |
| 912 | if (l_pend == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 913 | l_pend = l_pbeg + xifile->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.; |
| 914 | l_size = xifile->inlencxx . . $ $anonymous_type_e980a4b00bc08fab_1#inlen.; |
| 915 | } else |
| 916 | l_size = (size_t)(l_pend - l_pbeg); |
| 917 | |
| 918 | xifile->inoffcxx . . $ $anonymous_type_e980a4b00bc08fab_1#inoff. += l_size + 1; /* update the next line offset */ |
| 919 | |
| 920 | /* |
| 921 | * copy the current line into a separate buffer |
| 922 | * where we can modify the data (change spaces to |
| 923 | * newlines, etc.) |
| 924 | */ |
| 925 | buffer = tmpbuf_getcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:590:9`!(l_size + 1); |
| 926 | bufidx = 0; |
| 927 | |
| 928 | memcpycxx . . $ memcpy(cc817cb175f282d). (buffer, l_pbeg, l_size); |
| 929 | |
| 930 | buffer[l_size] = '\0'; |
| 931 | |
| 932 | /* skip whitespaces in the line buffer */ |
| 933 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(buffer[bufidx])) ++bufidx; |
| 934 | |
| 935 | /* |
| 936 | * now there should be a attribute name, comment |
| 937 | * or the end-of-line. |
| 938 | */ |
| 939 | key = strdupcxx . . $ strdup(a8b8e32347182212).(buffer + bufidx); |
| 940 | if (key == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 941 | exitcxx . . $ exit(3ca292c338df9bb3).(ENOMEMcxx . . $ `<external>/8987895939074593727/errno-base.h:16:9`!); |
| 942 | |
| 943 | for (keyidx = 0; ! isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(key[keyidx]) && key[keyidx]; keyidx++); |
| 944 | key[keyidx] = '\0'; |
| 945 | |
| 946 | switch (*key) { |
| 947 | case '#': |
| 948 | case '\0': |
| 949 | /* skip this line */ |
| 950 | break; |
| 951 | case '}': |
| 952 | /* end of section reached */ |
| 953 | ++bufidx; |
| 954 | |
| 955 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(buffer[bufidx])) |
| 956 | ++bufidx; |
| 957 | if (buffer[bufidx] != '\0') |
| 958 | goto fail; |
| 959 | |
| 960 | goto finish_section; |
| 961 | default: |
| 962 | op = key + strlencxx . . $ strlen(751346f8406fd082).(key) + 1; |
| 963 | |
| 964 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*op)) ++op; |
| 965 | |
| 966 | if (op == l_pend) |
| 967 | goto fail; |
| 968 | |
| 969 | xiattr = oscap_bfindcxx . . $ oscap_bfind(55e9dbee426f048c).(xiattr_tablecxx . . $ xiattr_table., XIATTR_TABLE_COUNTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:353:9`!, sizeof(struct xiconf_attrcxx . . $ xiconf_attr#), key, &xiattr_cmpcxx . . $ xiattr_cmp(361d5d7064a2a85d).); |
| 970 | |
| 971 | if (xiattr == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 972 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Unknown keyword: %s", key); |
| 973 | #if XICFG_PARSER_IGNORE_UNKNOWNcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:69:9`! != 1 |
| 974 | goto fail; |
| 975 | #else |
| 976 | break; |
| 977 | #endif |
| 978 | } |
| 979 | |
| 980 | if (!(type & xiattr->sectionscxx . . $ xiconf_attr#sections.)) { |
| 981 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Don't know how to handle attribute %s in this sections type (%d)", |
| 982 | key, type); |
| 983 | #if XICFG_PARSER_IGNORE_INVSECTcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:70:9`! != 1 |
| 984 | goto fail; |
| 985 | #else |
| 986 | break; |
| 987 | #endif |
| 988 | } |
| 989 | |
| 990 | switch (xiattr->pass_argcxx . . $ xiconf_attr#pass_arg.) { |
| 991 | case XIATTR_OPARG_LOCALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:90:9`!: |
| 992 | opvar = (void *)xiattr_ptrcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:355:9`!(snew, xiattr->offset); |
| 993 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("local opvar"); |
| 994 | break; |
| 995 | case XIATTR_OPARG_GLOBALcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:91:9`!: |
| 996 | opvar = (void *)xiconf; |
| 997 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("global opvar"); |
| 998 | break; |
| 999 | default: |
| 1000 | abortcxx . . $ abort(8df32a62017fbbf6). (); |
| 1001 | } |
| 1002 | |
| 1003 | if (*op == '=') { |
| 1004 | opfun = xiattr->op_assigncxx . . $ xiconf_attr#op_assign.; |
| 1005 | opval = op + 1; |
| 1006 | |
| 1007 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("assign(%p): var=%s (at %p+%zu = %p), val=%s", |
| 1008 | opfun, xiattr->name, snew, xiattr->offset, opvar, opval); |
| 1009 | |
| 1010 | } else if (*op == '+' && *(op+1) == '=') { |
| 1011 | opfun = xiattr->op_insertcxx . . $ xiconf_attr#op_insert.; |
| 1012 | opval = op + 2; |
| 1013 | |
| 1014 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("insert(%p): var=%s (at %p+%zu = %p), val=%s", |
| 1015 | opfun, xiattr->name, snew, xiattr->offset, opvar, opval); |
| 1016 | |
| 1017 | } else if (*op == '-' && *(op+1) == '=') { |
| 1018 | opfun = xiattr->op_removecxx . . $ xiconf_attr#op_remove.; |
| 1019 | opval = op + 2; |
| 1020 | |
| 1021 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("remove(%p): var=%s (at %p+%zu = %p), val=%s", |
| 1022 | opfun, xiattr->name, snew, xiattr->offset, opvar, opval); |
| 1023 | } else |
| 1024 | goto fail; |
| 1025 | |
| 1026 | while (*opval && isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*opval)) ++opval; |
| 1027 | if (opfun == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1028 | break; |
| 1029 | if (opfun(opvar, opval) != 0) |
| 1030 | goto fail; |
| 1031 | } |
| 1032 | |
| 1033 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 1034 | freecxx . . $ free(5d22bdacc48458e8).(key); |
| 1035 | key = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1036 | } |
| 1037 | |
| 1038 | finish_section: |
| 1039 | if (buffer != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1040 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Line buffer not freed; freeing now..."); |
| 1041 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 1042 | } |
| 1043 | |
| 1044 | if (key != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1045 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("key not freed; freeing now..."); |
| 1046 | freecxx . . $ free(5d22bdacc48458e8).(key); |
| 1047 | } |
| 1048 | |
| 1049 | switch (type) { |
| 1050 | case XICONF_SECTION_DEFAULTScxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:95:9`!: |
| 1051 | xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults. = snew; |
| 1052 | break; |
| 1053 | case XICONF_SECTION_SERVICEcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:96:9`!: |
| 1054 | { |
| 1055 | xiconf_strans_tcxx . . $ xiconf_strans_t# *st; |
| 1056 | char st_key[XICFG_STRANS_MAXKEYLENcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:173:9`!+1]; |
| 1057 | |
| 1058 | if (snew->idcxx . . $ xiconf_service#id. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1059 | snew->idcxx . . $ xiconf_service#id. = snew->namecxx . . $ xiconf_service#name.; |
| 1060 | |
| 1061 | scur = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1062 | /* |
| 1063 | * TODO: get a write lock |
| 1064 | */ |
| 1065 | rbt_str_getcxx . . $ rbt_str_get(3cd4f904f7b02e6c).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., snew->idcxx . . $ xiconf_service#id., (void *)&scur); |
| 1066 | |
| 1067 | if (scur == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1068 | if (rbt_str_addcxx . . $ rbt_str_add(d471093ac4c699c2). (xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., snew->idcxx . . $ xiconf_service#id., snew) != 0) { |
| 1069 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't add service (%s) into the service tree (%p)", |
| 1070 | snew->id, xiconf->stree); |
| 1071 | |
| 1072 | xiconf_service_freecxx . . $ xiconf_service_free(42eb29d01799d060).(snew); |
| 1073 | return (-1); |
| 1074 | } |
| 1075 | } else { |
| 1076 | if (scur->nextcxx . . $ xiconf_service#next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1077 | scur->nextcxx . . $ xiconf_service#next. = snew; |
| 1078 | } else { |
| 1079 | snew->nextcxx . . $ xiconf_service#next. = scur->nextcxx . . $ xiconf_service#next.; |
| 1080 | scur->nextcxx . . $ xiconf_service#next. = snew; |
| 1081 | } |
| 1082 | } |
| 1083 | scur = snew; |
| 1084 | if (scur->protocolcxx . . $ xiconf_service#protocol. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1085 | // First try to guess the protocol from the socket_type setting |
| 1086 | if (scur->socket_typecxx . . $ xiconf_service#socket_type. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1087 | // dgram => udp |
| 1088 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(scur->socket_typecxx . . $ xiconf_service#socket_type., "dgram") == 0) { |
| 1089 | scur->protocolcxx . . $ xiconf_service#protocol. = strdupcxx . . $ strdup(a8b8e32347182212).("udp"); |
| 1090 | } |
| 1091 | // stream => tcp |
| 1092 | else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(scur->socket_typecxx . . $ xiconf_service#socket_type., "stream") == 0) { |
| 1093 | scur->protocolcxx . . $ xiconf_service#protocol. = strdupcxx . . $ strdup(a8b8e32347182212).("tcp"); |
| 1094 | } |
| 1095 | } |
| 1096 | // If we still don't know the protocol, then get the default from /etc/services |
| 1097 | if (scur->protocolcxx . . $ xiconf_service#protocol. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1098 | struct serventcxx . . $ servent# *service = getservbynamecxx . . $ getservbyname(b6435b1a98249257).(scur->namecxx . . $ xiconf_service#name., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1099 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("protocol is empty, trying to guess from /etc/services for %s", scur->name); |
| 1100 | if (service != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1101 | scur->protocolcxx . . $ xiconf_service#protocol. = strdupcxx . . $ strdup(a8b8e32347182212).(service->s_protocxx . . $ servent#s_proto.); |
| 1102 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("service %s has default protocol=%s", scur->name, scur->protocol); |
| 1103 | } |
| 1104 | endserventcxx . . $ endservent(49f6e7a06ebc5aa8).(); |
| 1105 | } |
| 1106 | } |
| 1107 | if (scur->portcxx . . $ xiconf_service#port. == 0) { |
| 1108 | struct serventcxx . . $ servent# *service = getservbynamecxx . . $ getservbyname(b6435b1a98249257).(scur->namecxx . . $ xiconf_service#name., scur->protocolcxx . . $ xiconf_service#protocol.); |
| 1109 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("port not set, trying to guess from /etc/services for %s", scur->name); |
| 1110 | if (service != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1111 | if (service->s_portcxx . . $ servent#s_port. > 0 && service->s_portcxx . . $ servent#s_port. < 65536) { |
| 1112 | scur->portcxx . . $ xiconf_service#port. = ntohscxx . . $ `<external>/9581057695539925927/in.h:429:12`!((uint16_t)service->s_port); |
| 1113 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("service %s has default port=%hu/%s", |
| 1114 | scur->name, scur->port, scur->protocol); |
| 1115 | } |
| 1116 | } |
| 1117 | endserventcxx . . $ endservent(49f6e7a06ebc5aa8).(); |
| 1118 | } |
| 1119 | if (scur->typecxx . . $ xiconf_service#type. != 0) { |
| 1120 | // Check that the type is one of the allowed values by OVAL. |
| 1121 | // The xinetd configuration acually allows any combination of |
| 1122 | // the values. In such case, we set the type to an empty string. |
| 1123 | const char *type_enum[] = { "RPC", "INTERNAL", "UNLISTED", "TCPMUX", "TCPMUXPLUS", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! }; |
| 1124 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! type_enum_match = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1125 | size_t i; |
| 1126 | for (i = 0; type_enum[i]; ++i) { |
| 1127 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(scur->typecxx . . $ xiconf_service#type., type_enum[i]) == 0) { |
| 1128 | type_enum_match = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1129 | break; |
| 1130 | } |
| 1131 | } |
| 1132 | if (!type_enum_match) { |
| 1133 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("The value of the type setting does not match" |
| 1134 | " any of the allowed values by OVAL: %s", scur->type); |
| 1135 | scur->typecxx . . $ xiconf_service#type. = ""; |
| 1136 | } |
| 1137 | } |
| 1138 | /* |
| 1139 | * Add entry to the ttree for (name, protocol) -> (id) translation |
| 1140 | * (in case it's not already there) |
| 1141 | */ |
| 1142 | st = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1143 | strcpycxx . . $ strcpy(b7b3a83273496486).(st_key, scur->namecxx . . $ xiconf_service#name.); |
| 1144 | strcatcxx . . $ strcat(b7b3a83273496486).(st_key, scur->protocolcxx . . $ xiconf_service#protocol.); |
| 1145 | |
| 1146 | rbt_str_getcxx . . $ rbt_str_get(3cd4f904f7b02e6c).(xiconf->ttreecxx . . $ $anonymous_type_e980a4b00bc08fab_2#ttree., st_key, (void *)&st); |
| 1147 | |
| 1148 | if (st == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1149 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("new strans record: k=%s", st_key); |
| 1150 | |
| 1151 | st = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_strans_tcxx . . $ xiconf_strans_t#)); |
| 1152 | st->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt. = 1; |
| 1153 | st->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv. = malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (sizeof (xiconf_service_tcxx . . $ xiconf_service_t# *)); |
| 1154 | st->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.[0] = scur; |
| 1155 | |
| 1156 | if (rbt_str_addcxx . . $ rbt_str_add(d471093ac4c699c2). (xiconf->ttreecxx . . $ $anonymous_type_e980a4b00bc08fab_2#ttree., strdupcxx . . $ strdup(a8b8e32347182212).(st_key), st) != 0) { |
| 1157 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't add strans record (k=%s) into the strans tree (%p)", |
| 1158 | st_key, xiconf->ttree); |
| 1159 | return (-1); |
| 1160 | } |
| 1161 | } else { |
| 1162 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("adding new strans record to an exiting one: k=%s, cnt=%u+1", |
| 1163 | st_key, st->cnt); |
| 1164 | |
| 1165 | void *new_srv = realloccxx . . $ realloc(417ab160f6baadc6).(st->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv., sizeof (xiconf_service_tcxx . . $ xiconf_service_t# *) * ++(st->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt.)); |
| 1166 | if (new_srv == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1167 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Failed to re-allocate memory for st->srv"); |
| 1168 | return (-1); |
| 1169 | } else { |
| 1170 | st->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv. = new_srv; |
| 1171 | st->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.[st->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt. - 1] = scur; |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | /* |
| 1176 | * Merge the service entry with defaults so as to fill all unset attributes |
| 1177 | * that happen to have a default value defined. |
| 1178 | */ |
| 1179 | if (xiconf_service_merge_defaultscxx . . $ xiconf_service_merge_defaults(6788f6af2cacae7a).(scur, xiconf->defaultscxx . . $ $anonymous_type_e980a4b00bc08fab_2#defaults.) != 0) { |
| 1180 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Failed to merge service (%p, id=%s) with defaults (%p)", |
| 1181 | scur, scur->id, xiconf->defaults); |
| 1182 | return (-1); |
| 1183 | } |
| 1184 | |
| 1185 | /* TODO: resolve values for all attributes */ |
| 1186 | /* TODO: unlock the service tree */ |
| 1187 | } |
| 1188 | break; |
| 1189 | default: |
| 1190 | abortcxx . . $ abort(8df32a62017fbbf6). (); |
| 1191 | } |
| 1192 | |
| 1193 | return (0); |
| 1194 | fail: |
| 1195 | tmpbuf_freecxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:591:9`!(buffer); |
| 1196 | if (key) { |
| 1197 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("fail: key not freed; freeing now..."); |
| 1198 | freecxx . . $ free(5d22bdacc48458e8).(key); |
| 1199 | } |
| 1200 | |
| 1201 | if (snew->namecxx . . $ xiconf_service#name.) { |
| 1202 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("fail: snew->name not freed; freeing now..."); |
| 1203 | freecxx . . $ free(5d22bdacc48458e8).(snew->namecxx . . $ xiconf_service#name.); |
| 1204 | } |
| 1205 | freecxx . . $ free(5d22bdacc48458e8).(snew); |
| 1206 | |
| 1207 | return (-1); |
| 1208 | } |
| 1209 | |
| 1210 | xiconf_strans_tcxx . . $ xiconf_strans_t# *xiconf_getservicecxx . . $ xiconf_getservice(eb1a29164e530e66).(xiconf_tcxx . . $ xiconf_t# *xiconf, char *name, char *prot) |
| 1211 | { |
| 1212 | char strans_key[XICFG_STRANS_MAXKEYLENcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:173:9`!+1]; |
| 1213 | xiconf_strans_tcxx . . $ xiconf_strans_t# *strans = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1214 | |
| 1215 | if (xiconf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1216 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1217 | } |
| 1218 | |
| 1219 | if (name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || prot == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1220 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1221 | |
| 1222 | if (strlencxx . . $ strlen(751346f8406fd082).(name) + strlencxx . . $ strlen(751346f8406fd082).(prot) > XICFG_STRANS_MAXKEYLENcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:173:9`!) |
| 1223 | return (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1224 | |
| 1225 | strcpycxx . . $ strcpy(b7b3a83273496486).(strans_key, name); |
| 1226 | strcatcxx . . $ strcat(b7b3a83273496486).(strans_key, prot); |
| 1227 | |
| 1228 | rbt_str_getcxx . . $ rbt_str_get(3cd4f904f7b02e6c).(xiconf->ttreecxx . . $ $anonymous_type_e980a4b00bc08fab_2#ttree., strans_key, (void *)&strans); |
| 1229 | |
| 1230 | return (strans); |
| 1231 | } |
| 1232 | |
| 1233 | static int xiconf_dump_cbcxx . . $ xiconf_dump_cb(216f1646fc7fe5da).(struct rbt_str_nodecxx . . $ rbt_str_node# *node, void *user) |
| 1234 | { |
| 1235 | xiconf_strans_tcxx . . $ xiconf_strans_t# *res = (xiconf_strans_tcxx . . $ xiconf_strans_t# *)user; |
| 1236 | |
| 1237 | if (res->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt. <= 0) { |
| 1238 | return -1; |
| 1239 | } |
| 1240 | |
| 1241 | res->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.[res->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt. - 1] = (xiconf_service_tcxx . . $ xiconf_service_t# *)node->datacxx . . $ rbt_str_node#data.; |
| 1242 | --res->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt.; |
| 1243 | |
| 1244 | return (0); |
| 1245 | } |
| 1246 | |
| 1247 | xiconf_strans_tcxx . . $ xiconf_strans_t# *xiconf_dumpcxx . . $ xiconf_dump(a769c210e3489895).(xiconf_tcxx . . $ xiconf_t# *xiconf) |
| 1248 | { |
| 1249 | if (xiconf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1250 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1251 | } |
| 1252 | |
| 1253 | xiconf_strans_tcxx . . $ xiconf_strans_t# *res = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_strans_tcxx . . $ xiconf_strans_t#)); |
| 1254 | res->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt. = rbt_str_sizecxx . . $ rbt_str_size(6ae908cc234686bf).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree.); |
| 1255 | res->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv. = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(xiconf_service_tcxx . . $ xiconf_service_t# *) * res->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt.); |
| 1256 | |
| 1257 | rbt_str_walk_inorder2cxx . . $ rbt_str_walk_inorder2(1f9f5f59823fc556).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., xiconf_dump_cbcxx . . $ xiconf_dump_cb(216f1646fc7fe5da)., (void *)res, 0); |
| 1258 | |
| 1259 | res->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt. = rbt_str_sizecxx . . $ rbt_str_size(6ae908cc234686bf).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree.); |
| 1260 | |
| 1261 | return (res); |
| 1262 | } |
| 1263 | |
| 1264 | void xiconf_strans_freecxx . . $ xiconf_strans_free(c2fd63465702dca).(xiconf_strans_tcxx . . $ xiconf_strans_t# *strans) |
| 1265 | { |
| 1266 | if (strans == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1267 | return; |
| 1268 | |
| 1269 | freecxx . . $ free(5d22bdacc48458e8).(strans->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.); |
| 1270 | freecxx . . $ free(5d22bdacc48458e8).(strans); |
| 1271 | return; |
| 1272 | } |
| 1273 | |
| 1274 | int op_assign_boolcxx . . $ op_assign_bool(e256373c99a31857).(void *var, char *val) |
| 1275 | { |
| 1276 | if (var == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1277 | return -1; |
| 1278 | } |
| 1279 | |
| 1280 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "yes") == 0) { |
| 1281 | *((boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *)(var)) = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1282 | } else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "no") == 0) { |
| 1283 | *((boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *)(var)) = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1284 | } else { |
| 1285 | char *endptr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1286 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 1287 | *((boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *)(var)) = (boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`!) strtolcxx . . $ strtol(44bbb87609b212fc). (val, &endptr, 2); |
| 1288 | if (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == EINVALcxx . . $ `<external>/8987895939074593727/errno-base.h:26:9`! || errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == ERANGEcxx . . $ `<external>/8987895939074593727/errno-base.h:38:9`!) { |
| 1289 | return -1; |
| 1290 | } |
| 1291 | if (endptr != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1292 | if (*endptr != '\0' || endptr == val) { |
| 1293 | return -1; |
| 1294 | } |
| 1295 | } |
| 1296 | } |
| 1297 | return 0; |
| 1298 | } |
| 1299 | |
| 1300 | int op_assign_u16cxx . . $ op_assign_u16(e256373c99a31857).(void *var, char *val) |
| 1301 | { |
| 1302 | long num = strtolcxx . . $ strtol(44bbb87609b212fc).(val, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 10); |
| 1303 | |
| 1304 | if (num > 0 && num < (1<<16)) { |
| 1305 | *(uint16_tcxx . . $ uint16_t# *)(var) = (uint16_tcxx . . $ uint16_t#)(num); |
| 1306 | return (0); |
| 1307 | } |
| 1308 | |
| 1309 | return (-1); |
| 1310 | } |
| 1311 | |
| 1312 | int op_merge_u16cxx . . $ op_merge_u16(8bc41909eac9e5d8).(void *dst, void *src, int type) |
| 1313 | { |
| 1314 | uint16_tcxx . . $ uint16_t# *a = (uint16_tcxx . . $ uint16_t# *)dst; |
| 1315 | uint16_tcxx . . $ uint16_t# *b = (uint16_tcxx . . $ uint16_t# *)src; |
| 1316 | |
| 1317 | if (*a != 0) |
| 1318 | return (-1); |
| 1319 | else |
| 1320 | *a = *b; |
| 1321 | |
| 1322 | return (0); |
| 1323 | } |
| 1324 | |
| 1325 | int op_assign_strcxx . . $ op_assign_str(e256373c99a31857).(void *var, char *val) |
| 1326 | { |
| 1327 | char *strend = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1328 | if (var == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1329 | return -1; |
| 1330 | } |
| 1331 | |
| 1332 | /* skip whitespaces */ |
| 1333 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*val)) ++val; |
| 1334 | |
| 1335 | if (*val != '\0') { |
| 1336 | strend = strrchrcxx . . $ strrchr(2050848944e00d54).(val, '\0'); |
| 1337 | /* strip trailing whitespaces */ |
| 1338 | do { |
| 1339 | strend--; |
| 1340 | } while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*strend)); |
| 1341 | if((strend-val) < 0) { |
| 1342 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Error stripping white space from string '%s'", val); |
| 1343 | return (-1); |
| 1344 | } |
| 1345 | *((char **)(var)) = strndupcxx . . $ strndup(eabdfdef77619b3d).(val, (strend-val+1)); |
| 1346 | return (0); |
| 1347 | } else |
| 1348 | return (-1); |
| 1349 | } |
| 1350 | |
| 1351 | int op_merge_strcxx . . $ op_merge_str(8bc41909eac9e5d8).(void *dst, void *src, int type) |
| 1352 | { |
| 1353 | char **a = (char **)dst; |
| 1354 | char **b = (char **)src; |
| 1355 | |
| 1356 | if (*a != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1357 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Cannot merge str value: dst=%p (%s), src=%p (%s)", dst, *a, src, *b); |
| 1358 | return (-1); |
| 1359 | } else |
| 1360 | *a = *b; |
| 1361 | |
| 1362 | return (0); |
| 1363 | } |
| 1364 | |
| 1365 | int op_assign_strlcxx . . $ op_assign_strl(e256373c99a31857).(void *var, char *val) |
| 1366 | { |
| 1367 | char ***aptr = (char ***)var; |
| 1368 | char **string_array = *aptr; |
| 1369 | char *tok, *str; |
| 1370 | size_t string_array_size = 0; |
| 1371 | |
| 1372 | if (string_array != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1373 | // Destroy previous array state |
| 1374 | while(string_array[string_array_size]) { |
| 1375 | freecxx . . $ free(5d22bdacc48458e8).(string_array[string_array_size]); |
| 1376 | ++string_array_size; |
| 1377 | } |
| 1378 | freecxx . . $ free(5d22bdacc48458e8).(string_array); |
| 1379 | string_array = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1380 | string_array_size = 0; |
| 1381 | } |
| 1382 | str = val; |
| 1383 | while ((tok = strsepcxx . . $ strsep(f4782bac5b8a260e).(&str, " ")) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1384 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*tok)) { |
| 1385 | ++tok; |
| 1386 | } |
| 1387 | if (*tok == '\0') { |
| 1388 | continue; |
| 1389 | } |
| 1390 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Adding new member to string array: %s", tok); |
| 1391 | void *new_string_array = realloccxx . . $ realloc(417ab160f6baadc6).(string_array, sizeof(char *) * (++string_array_size + 1)); |
| 1392 | if (new_string_array == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1393 | *aptr = string_array; |
| 1394 | return -1; |
| 1395 | } |
| 1396 | string_array = new_string_array; |
| 1397 | string_array[string_array_size-1] = strdupcxx . . $ strdup(a8b8e32347182212).(tok); |
| 1398 | string_array[string_array_size] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1399 | } |
| 1400 | *aptr = string_array; |
| 1401 | return 0; |
| 1402 | } |
| 1403 | |
| 1404 | int op_insert_strlcxx . . $ op_insert_strl(e256373c99a31857).(void *var, char *val) |
| 1405 | { |
| 1406 | char ***aptr = (char ***)var; |
| 1407 | char **string_array = *aptr; |
| 1408 | char *tok, *str; |
| 1409 | size_t string_array_size = 0; |
| 1410 | |
| 1411 | if (string_array != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1412 | // Count the number of items in the array |
| 1413 | while(string_array[string_array_size]) { |
| 1414 | ++string_array_size; |
| 1415 | } |
| 1416 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("String array has %zu members", string_array_size); |
| 1417 | } |
| 1418 | str = val; |
| 1419 | while ((tok = strsepcxx . . $ strsep(f4782bac5b8a260e).(&str, " ")) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1420 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*tok)) { |
| 1421 | ++tok; |
| 1422 | } |
| 1423 | if (*tok == '\0') { |
| 1424 | continue; |
| 1425 | } |
| 1426 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Adding new member to string array: %s", tok); |
| 1427 | void *new_string_array = realloccxx . . $ realloc(417ab160f6baadc6).(string_array, sizeof(char *) * (++string_array_size + 1)); |
| 1428 | if (new_string_array == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1429 | *aptr = string_array; |
| 1430 | return -1; |
| 1431 | } |
| 1432 | string_array = new_string_array; |
| 1433 | string_array[string_array_size-1] = strdupcxx . . $ strdup(a8b8e32347182212).(tok); |
| 1434 | string_array[string_array_size] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1435 | } |
| 1436 | *aptr = string_array; |
| 1437 | return 0; |
| 1438 | } |
| 1439 | |
| 1440 | int op_remove_strlcxx . . $ op_remove_strl(e256373c99a31857).(void *var, char *val) |
| 1441 | { |
| 1442 | char ***aptr = (char ***)var; |
| 1443 | char **string_array = *aptr, **valstr_array; |
| 1444 | char **newstr_array; |
| 1445 | char *tok, *str; |
| 1446 | size_t string_array_size = 0, valstr_array_size; |
| 1447 | size_t string_array_pos, valstr_array_pos; |
| 1448 | size_t newstr_array_size; |
| 1449 | |
| 1450 | if (string_array != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1451 | // Count the number of items in the array |
| 1452 | while(string_array[string_array_size]) { |
| 1453 | ++string_array_size; |
| 1454 | } |
| 1455 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("String array has %zu members", string_array_size); |
| 1456 | } |
| 1457 | |
| 1458 | if (string_array_size < 1) { |
| 1459 | // Nothing to remove here |
| 1460 | return 0; |
| 1461 | } else { |
| 1462 | // Allocate the new string array |
| 1463 | newstr_array = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(char *) * (string_array_size + 1)); |
| 1464 | if (newstr_array == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1465 | return -1; |
| 1466 | } |
| 1467 | |
| 1468 | // Create an array of strings to be removed from the array |
| 1469 | valstr_array = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1470 | valstr_array_size = 0; |
| 1471 | str = val; |
| 1472 | while ((tok = strsepcxx . . $ strsep(f4782bac5b8a260e).(&str, " ")) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1473 | while(isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*tok)) { |
| 1474 | ++tok; |
| 1475 | } |
| 1476 | if (*tok == '\0') { |
| 1477 | continue; |
| 1478 | } |
| 1479 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Adding new member to string array: %s", tok); |
| 1480 | void *new_valstr_array = realloccxx . . $ realloc(417ab160f6baadc6).(valstr_array, sizeof(char *) * (++valstr_array_size + 1)); |
| 1481 | if (new_valstr_array == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1482 | freecxx . . $ free(5d22bdacc48458e8).(newstr_array); |
| 1483 | freecxx . . $ free(5d22bdacc48458e8).(valstr_array); |
| 1484 | return -2; |
| 1485 | } |
| 1486 | valstr_array = new_valstr_array; |
| 1487 | valstr_array[valstr_array_size-1] = tok; |
| 1488 | valstr_array[valstr_array_size] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1489 | } |
| 1490 | if (valstr_array == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1491 | freecxx . . $ free(5d22bdacc48458e8).(newstr_array); |
| 1492 | return -2; |
| 1493 | } |
| 1494 | |
| 1495 | // Remove the insersection from the string array |
| 1496 | newstr_array_size = 0; |
| 1497 | for (string_array_pos = 0; string_array_pos < string_array_size; ++string_array_pos) { |
| 1498 | char *string_array_val = string_array[string_array_pos]; |
| 1499 | |
| 1500 | for (valstr_array_pos = 0; valstr_array[valstr_array_pos]; ++valstr_array_pos) { |
| 1501 | char *delete_val = valstr_array[valstr_array_pos]; |
| 1502 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Removing: %s", delete_val); |
| 1503 | // Destroy the string if it matches a string from the value string array |
| 1504 | // Otherwise move it to the new string array |
| 1505 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("cmp: %s ?= %s", string_array_val, delete_val); |
| 1506 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(string_array_val, delete_val) == 0) { |
| 1507 | freecxx . . $ free(5d22bdacc48458e8).(string_array_val); |
| 1508 | string_array_val = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1509 | break; |
| 1510 | } |
| 1511 | } |
| 1512 | // If the value wasn't removed, move it to the new string array |
| 1513 | if (string_array_val != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1514 | newstr_array[newstr_array_size] = string_array_val; |
| 1515 | ++newstr_array_size; |
| 1516 | } |
| 1517 | string_array[string_array_pos] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1518 | } |
| 1519 | |
| 1520 | newstr_array[newstr_array_size] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1521 | freecxx . . $ free(5d22bdacc48458e8).(string_array); |
| 1522 | freecxx . . $ free(5d22bdacc48458e8).(valstr_array); |
| 1523 | void *new_newstr_array = realloccxx . . $ realloc(417ab160f6baadc6).(newstr_array, sizeof(char *) * (newstr_array_size + 1)); |
| 1524 | if (new_newstr_array != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1525 | newstr_array = new_newstr_array; |
| 1526 | *aptr = newstr_array; |
| 1527 | return 0; |
| 1528 | } |
| 1529 | |
| 1530 | int op_assign_disabledcxx . . $ op_assign_disabled(e256373c99a31857).(void *var, char *val) |
| 1531 | { |
| 1532 | xiconf_tcxx . . $ xiconf_t# *xiconf; |
| 1533 | xiconf_service_tcxx . . $ xiconf_service_t# *srv; |
| 1534 | char *tok, *str; |
| 1535 | |
| 1536 | xiconf = (xiconf_tcxx . . $ xiconf_t# *)var; |
| 1537 | str = val; |
| 1538 | srv = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1539 | |
| 1540 | while ((tok = strsepcxx . . $ strsep(f4782bac5b8a260e). (&str, " ")) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1541 | while (isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*tok)) |
| 1542 | ++tok; |
| 1543 | if (*tok == '\0') |
| 1544 | continue; |
| 1545 | |
| 1546 | rbt_str_getcxx . . $ rbt_str_get(3cd4f904f7b02e6c).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., tok, (void *)&srv); |
| 1547 | |
| 1548 | if (srv == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1549 | srv = xiconf_service_newcxx . . $ xiconf_service_new(d730cd206a75c606).(); |
| 1550 | srv->idcxx . . $ xiconf_service#id. = strdupcxx . . $ strdup(a8b8e32347182212). (tok); |
| 1551 | srv->def_disabledcxx . . $ xiconf_service#def_disabled. = 1; |
| 1552 | |
| 1553 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("new: def_disabled: = 1: %s", srv->id); |
| 1554 | |
| 1555 | if (rbt_str_addcxx . . $ rbt_str_add(d471093ac4c699c2). (xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., srv->idcxx . . $ xiconf_service#id., srv) != 0) { |
| 1556 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't add service (%s) into the service tree (%p)", |
| 1557 | srv->id, xiconf->stree); |
| 1558 | |
| 1559 | xiconf_service_freecxx . . $ xiconf_service_free(42eb29d01799d060).(srv); |
| 1560 | return (-1); |
| 1561 | } |
| 1562 | } else { |
| 1563 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("mod: def_disabled: %u -> 1: %s", srv->def_disabled, srv->id); |
| 1564 | srv->def_disabledcxx . . $ xiconf_service#def_disabled. = 1; |
| 1565 | } |
| 1566 | } |
| 1567 | |
| 1568 | return (0); |
| 1569 | } |
| 1570 | |
| 1571 | int op_assign_enabledcxx . . $ op_assign_enabled(e256373c99a31857).(void *var, char *val) |
| 1572 | { |
| 1573 | xiconf_tcxx . . $ xiconf_t# *xiconf; |
| 1574 | xiconf_service_tcxx . . $ xiconf_service_t# *srv; |
| 1575 | char *tok, *str; |
| 1576 | |
| 1577 | xiconf = (xiconf_tcxx . . $ xiconf_t# *)var; |
| 1578 | str = val; |
| 1579 | srv = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1580 | |
| 1581 | while ((tok = strsepcxx . . $ strsep(f4782bac5b8a260e). (&str, " ")) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1582 | while (isspacecxx . . $ `<external>/17904084882347303253/ctype.h:197:10`!(*tok)) |
| 1583 | ++tok; |
| 1584 | if (*tok == '\0') |
| 1585 | continue; |
| 1586 | |
| 1587 | rbt_str_getcxx . . $ rbt_str_get(3cd4f904f7b02e6c).(xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., tok, (void *)&srv); |
| 1588 | |
| 1589 | if (srv == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1590 | srv = xiconf_service_newcxx . . $ xiconf_service_new(d730cd206a75c606).(); |
| 1591 | srv->idcxx . . $ xiconf_service#id. = strdupcxx . . $ strdup(a8b8e32347182212). (tok); |
| 1592 | srv->def_enabledcxx . . $ xiconf_service#def_enabled. = 1; |
| 1593 | |
| 1594 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("new: def_enabled: = 1: %s", srv->id); |
| 1595 | |
| 1596 | if (rbt_str_addcxx . . $ rbt_str_add(d471093ac4c699c2). (xiconf->streecxx . . $ $anonymous_type_e980a4b00bc08fab_2#stree., srv->idcxx . . $ xiconf_service#id., srv) != 0) { |
| 1597 | dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't add service (%s) into the service tree (%p)", |
| 1598 | srv->id, xiconf->stree); |
| 1599 | |
| 1600 | xiconf_service_freecxx . . $ xiconf_service_free(42eb29d01799d060).(srv); |
| 1601 | return (-1); |
| 1602 | } |
| 1603 | } else { |
| 1604 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("mod: def_enabled: %u -> 1: %s", srv->def_disabled, srv->id); |
| 1605 | srv->def_enabledcxx . . $ xiconf_service#def_enabled. = 1; |
| 1606 | } |
| 1607 | } |
| 1608 | |
| 1609 | return (0); |
| 1610 | } |
| 1611 | |
| 1612 | /* |
| 1613 | * xinetd probe |
| 1614 | */ |
| 1615 | |
| 1616 | #ifndef XINETD_CONFPATH |
| 1617 | #define XINETD_CONFPATHcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:1617:9`! "/etc/xinetd.conf" |
| 1618 | #endif |
| 1619 | |
| 1620 | #ifndef XINETD_CONFDEPTH |
| 1621 | #define XINETD_CONFDEPTHcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:1621:9`! 32 |
| 1622 | #endif |
| 1623 | |
| 1624 | #ifndef XINETD_TEST |
| 1625 | static void xiservice_process_querycxx . . $ xiservice_process_query(c3aa4159812ed61d).(probe_ctxcxx . . $ probe_ctx# *ctx, SEXP_tcxx . . $ SEXP_t# *service_name, SEXP_tcxx . . $ SEXP_t# *protocol, const xiconf_service_tcxx . . $ xiconf_service_t# *xsrv) |
| 1626 | { |
| 1627 | SEXP_tcxx . . $ SEXP_t# *xres_service_name, *xres_protocol, *item; |
| 1628 | |
| 1629 | xres_service_name = SEXP_string_newcxx . . $ SEXP_string_new(a588a58d7514eee2).(xsrv->namecxx . . $ xiconf_service#name., strlencxx . . $ strlen(751346f8406fd082).(xsrv->namecxx . . $ xiconf_service#name.)); |
| 1630 | xres_protocol = SEXP_string_newcxx . . $ SEXP_string_new(a588a58d7514eee2).(xsrv->protocolcxx . . $ xiconf_service#protocol., strlencxx . . $ strlen(751346f8406fd082).(xsrv->protocolcxx . . $ xiconf_service#protocol.)); |
| 1631 | if (probe_entobj_cmpcxx . . $ probe_entobj_cmp(e245451a1311e799).(service_name, xres_service_name) == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE. && |
| 1632 | probe_entobj_cmpcxx . . $ probe_entobj_cmp(e245451a1311e799).(protocol, xres_protocol) == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE. |
| 1633 | ) { |
| 1634 | item = probe_item_createcxx . . $ probe_item_create(36b16a6622050a9c).(OVAL_UNIX_XINETDcxx . . $ OVAL_UNIX_XINETD., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1635 | "protocol", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->protocolcxx . . $ xiconf_service#protocol., |
| 1636 | "service_name", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->namecxx . . $ xiconf_service#name., |
| 1637 | "flags", OVAL_DATATYPE_STRING_Mcxx . . $ OVAL_DATATYPE_STRING_M., xsrv->flagscxx . . $ xiconf_service#flags., |
| 1638 | "no_access", OVAL_DATATYPE_STRING_Mcxx . . $ OVAL_DATATYPE_STRING_M., xsrv->no_accesscxx . . $ xiconf_service#no_access., |
| 1639 | "only_from", OVAL_DATATYPE_STRING_Mcxx . . $ OVAL_DATATYPE_STRING_M., xsrv->only_fromcxx . . $ xiconf_service#only_from., |
| 1640 | "port", OVAL_DATATYPE_INTEGERcxx . . $ OVAL_DATATYPE_INTEGER., (int64_tcxx . . $ int64_t#)xsrv->portcxx . . $ xiconf_service#port., |
| 1641 | "server", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->servercxx . . $ xiconf_service#server., |
| 1642 | "server_arguments", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->server_argscxx . . $ xiconf_service#server_args., |
| 1643 | "socket_type", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->socket_typecxx . . $ xiconf_service#socket_type., |
| 1644 | "type", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->typecxx . . $ xiconf_service#type., |
| 1645 | "user", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., xsrv->usercxx . . $ xiconf_service#user., |
| 1646 | "wait", OVAL_DATATYPE_BOOLEANcxx . . $ OVAL_DATATYPE_BOOLEAN., xsrv->waitcxx . . $ xiconf_service#wait., |
| 1647 | "disabled", OVAL_DATATYPE_BOOLEANcxx . . $ OVAL_DATATYPE_BOOLEAN., xsrv->disablecxx . . $ xiconf_service#disable., |
| 1648 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1649 | |
| 1650 | probe_item_collectcxx . . $ probe_item_collect(11bb80e0c30650d7).(ctx, item); |
| 1651 | } |
| 1652 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(xres_service_name); |
| 1653 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(xres_protocol); |
| 1654 | } |
| 1655 | |
| 1656 | int xinetd_probe_offline_mode_supportedcxx . . $ xinetd_probe_offline_mode_supported(b126dc7c1de90089).() |
| 1657 | { |
| 1658 | return PROBE_OFFLINE_CHROOTcxx . . $ PROBE_OFFLINE_CHROOT.; |
| 1659 | } |
| 1660 | |
| 1661 | void *xinetd_probe_initcxx . . $ xinetd_probe_init(50c7df7de5344ebb).(void) |
| 1662 | { |
| 1663 | return xiconf_parsecxx . . $ xiconf_parse(f5b8ae12de0fe0ae).(XINETD_CONFPATHcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:1617:9`!, XINETD_CONFDEPTHcxx . . $ `src/OVAL/probes/unix/xinetd_probe.c:1621:9`!); |
| 1664 | } |
| 1665 | |
| 1666 | void xinetd_probe_finicxx . . $ xinetd_probe_fini(5d22bdacc48458e8).(void *arg) |
| 1667 | { |
| 1668 | if (arg != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1669 | xiconf_freecxx . . $ xiconf_free(a1a1d6d3e59a9c09).(arg); |
| 1670 | } |
| 1671 | |
| 1672 | int xinetd_probe_maincxx . . $ xinetd_probe_main(470536d3ffacaf10).(probe_ctxcxx . . $ probe_ctx# *ctx, void *arg) |
| 1673 | { |
| 1674 | SEXP_tcxx . . $ SEXP_t# *service_name, *protocol, *eval, *object; |
| 1675 | char srv_name[256]; |
| 1676 | char srv_prot[256]; |
| 1677 | int err; |
| 1678 | |
| 1679 | xiconf_service_tcxx . . $ xiconf_service_t# *xsrv; |
| 1680 | xiconf_strans_tcxx . . $ xiconf_strans_t# *xres; |
| 1681 | xiconf_tcxx . . $ xiconf_t# *xcfg = (xiconf_tcxx . . $ xiconf_t# *)arg; |
| 1682 | |
| 1683 | if (arg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1684 | probe_cobj_set_flagcxx . . $ probe_cobj_set_flag(644bab5dffe689c).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), SYSCHAR_FLAG_NOT_APPLICABLEcxx . . $ SYSCHAR_FLAG_NOT_APPLICABLE.); |
| 1685 | return (0); |
| 1686 | } |
| 1687 | |
| 1688 | object = probe_ctx_getobjectcxx . . $ probe_ctx_getobject(4299b6b53fa804a5).(ctx); |
| 1689 | |
| 1690 | service_name = probe_obj_getentcxx . . $ probe_obj_getent(7907a01f2ff841f3).(object, "service_name", 1); |
| 1691 | |
| 1692 | if (service_name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1693 | err = PROBE_ENOVALcxx . . $ `src/OVAL/probes/public/probe-common.h:10:9`!; |
| 1694 | goto fail; |
| 1695 | } |
| 1696 | |
| 1697 | eval = probe_ent_getvalcxx . . $ probe_ent_getval(2f7f980afaaae0f0).(service_name); |
| 1698 | |
| 1699 | if (SEXP_string_cstr_rcxx . . $ SEXP_string_cstr_r(ca07af91a4fa826f). (eval, srv_name, sizeof srv_name) == (size_t)-1) { |
| 1700 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (service_name); |
| 1701 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (eval); |
| 1702 | err = PROBE_ERANGEcxx . . $ `src/OVAL/probes/public/probe-common.h:15:9`!; |
| 1703 | goto fail; |
| 1704 | } |
| 1705 | |
| 1706 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (eval); |
| 1707 | |
| 1708 | protocol = probe_obj_getentcxx . . $ probe_obj_getent(7907a01f2ff841f3).(object, "protocol", 1); |
| 1709 | |
| 1710 | if (protocol == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1711 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (service_name); |
| 1712 | err = PROBE_ENOVALcxx . . $ `src/OVAL/probes/public/probe-common.h:10:9`!; |
| 1713 | goto fail; |
| 1714 | } |
| 1715 | |
| 1716 | eval = probe_ent_getvalcxx . . $ probe_ent_getval(2f7f980afaaae0f0).(protocol); |
| 1717 | |
| 1718 | if (SEXP_string_cstr_rcxx . . $ SEXP_string_cstr_r(ca07af91a4fa826f). (eval, srv_prot, sizeof srv_prot) == (size_t)-1) { |
| 1719 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (service_name); |
| 1720 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (protocol); |
| 1721 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (eval); |
| 1722 | err = PROBE_ERANGEcxx . . $ `src/OVAL/probes/public/probe-common.h:15:9`!; |
| 1723 | goto fail; |
| 1724 | } |
| 1725 | |
| 1726 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (eval); |
| 1727 | |
| 1728 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Updating xinetd configuration cache"); |
| 1729 | |
| 1730 | if (xiconf_updatecxx . . $ xiconf_update(b7caf5a703c02030).(arg) != 0) { |
| 1731 | err = PROBE_EUNKNOWNcxx . . $ `src/OVAL/probes/public/probe-common.h:24:9`!; |
| 1732 | goto fail; |
| 1733 | } |
| 1734 | |
| 1735 | xres = xiconf_dumpcxx . . $ xiconf_dump(a769c210e3489895).(xcfg); |
| 1736 | |
| 1737 | if (xres != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1738 | register unsigned int l; |
| 1739 | |
| 1740 | for (l = 0; l < xres->cntcxx . . $ $anonymous_type_e980a4b00bc08fab_0#cnt.; ++l) { |
| 1741 | xsrv = xres->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.[l]; |
| 1742 | while (xsrv != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 1743 | xiservice_process_querycxx . . $ xiservice_process_query(c3aa4159812ed61d).(ctx, service_name, protocol, xsrv); |
| 1744 | xsrv = xsrv->nextcxx . . $ xiconf_service#next.; |
| 1745 | } |
| 1746 | } |
| 1747 | freecxx . . $ free(5d22bdacc48458e8).(xres->srvcxx . . $ $anonymous_type_e980a4b00bc08fab_0#srv.); |
| 1748 | freecxx . . $ free(5d22bdacc48458e8).(xres); |
| 1749 | |
| 1750 | } |
| 1751 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(service_name); |
| 1752 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(protocol); |
| 1753 | |
| 1754 | return (0); |
| 1755 | fail: |
| 1756 | probe_cobj_set_flagcxx . . $ probe_cobj_set_flag(644bab5dffe689c).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), SYSCHAR_FLAG_ERRORcxx . . $ SYSCHAR_FLAG_ERROR.); |
| 1757 | return err; |
| 1758 | } |
| 1759 | #endif |