| 1 | /** |
| 2 | * @file systemdunitproperty_probe.c |
| 3 | * @brief implementation of the systemdunitproperty_object |
| 4 | * @author |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * Copyright 2014 Red Hat Inc., Durham, North Carolina. |
| 9 | * All Rights Reserved. |
| 10 | * |
| 11 | * This library is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU Lesser General Public |
| 13 | * License as published by the Free Software Foundation; either |
| 14 | * version 2.1 of the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This library is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * Lesser General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU Lesser General Public |
| 22 | * License along with this library; if not, write to the Free Software |
| 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 24 | * |
| 25 | * Authors: |
| 26 | * |
| 27 | */ |
| 28 | |
| 29 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 30 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 31 | #endif |
| 32 | |
| 33 | #include <probe-api.h>cxx . . $ `<file>/src/OVAL/probes/public/probe-api.h`/ |
| 34 | #include <string.h> |
| 35 | #include <probe/probe.h>cxx . . $ `<file>/src/OVAL/probes/probe/probe.h`/ |
| 36 | |
| 37 | #include "probe/entcmp.h"cxx . . $ `<file>/src/OVAL/probes/probe/entcmp.h`/ |
| 38 | #include "systemdshared.h"cxx . . $ `<file>/src/OVAL/probes/unix/linux/systemdshared.h`/ |
| 39 | #include "systemdunitproperty_probe.h"cxx . . $ `<file>/src/OVAL/probes/unix/linux/systemdunitproperty_probe.h`/ |
| 40 | |
| 41 | static int get_all_properties_by_unit_pathcxx . . $ get_all_properties_by_unit_path(3f2900d7c8a6e421).(DBusConnectioncxx . . $ DBusConnection# *conn, const char *unit_path, int(*callback)(const char *name, const char *value, void *arg), void *cbarg) |
| 42 | { |
| 43 | int ret = 1; |
| 44 | DBusMessagecxx . . $ DBusMessage# *msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 45 | DBusPendingCallcxx . . $ DBusPendingCall# *pending = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 46 | |
| 47 | msg = dbus_message_new_method_callcxx . . $ dbus_message_new_method_call(a937a8c9de1028ff).( |
| 48 | "org.freedesktop.systemd1", |
| 49 | unit_path, |
| 50 | "org.freedesktop.DBus.Properties", |
| 51 | "GetAll" |
| 52 | ); |
| 53 | if (msg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 54 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to create dbus_message via dbus_message_new_method_call!"); |
| 55 | goto cleanup; |
| 56 | } |
| 57 | |
| 58 | DBusMessageItercxx . . $ DBusMessageIter# args, property_iter; |
| 59 | |
| 60 | const char *interface = "org.freedesktop.systemd1.Unit"; |
| 61 | |
| 62 | dbus_message_iter_init_appendcxx . . $ dbus_message_iter_init_append(bdfd43ed78e92566).(msg, &args); |
| 63 | if (!dbus_message_iter_append_basiccxx . . $ dbus_message_iter_append_basic(dea9ad080b919705).(&args, DBUS_TYPE_STRINGcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:104:9`!, &interface)) { |
| 64 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to append interface '%s' string parameter to dbus message!", interface); |
| 65 | goto cleanup; |
| 66 | } |
| 67 | |
| 68 | if (!dbus_connection_send_with_replycxx . . $ dbus_connection_send_with_reply(ab3797bd4df020e).(conn, msg, &pending, -1)) { |
| 69 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to send message via dbus!"); |
| 70 | goto cleanup; |
| 71 | } |
| 72 | if (pending == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 73 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Invalid dbus pending call!"); |
| 74 | goto cleanup; |
| 75 | } |
| 76 | |
| 77 | dbus_connection_flushcxx . . $ dbus_connection_flush(5ffe6e60e141c747).(conn); |
| 78 | dbus_message_unrefcxx . . $ dbus_message_unref(ef6f40ad6aaa7be8).(msg); msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 79 | |
| 80 | dbus_pending_call_blockcxx . . $ dbus_pending_call_block(f8094f87eabead78).(pending); |
| 81 | msg = dbus_pending_call_steal_replycxx . . $ dbus_pending_call_steal_reply(5c89f41a44f43d9f).(pending); |
| 82 | if (msg == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 83 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to steal dbus pending call reply."); |
| 84 | goto cleanup; |
| 85 | } |
| 86 | dbus_pending_call_unrefcxx . . $ dbus_pending_call_unref(f8094f87eabead78).(pending); pending = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 87 | |
| 88 | if (!dbus_message_iter_initcxx . . $ dbus_message_iter_init(ffe71547a19cf1fb).(msg, &args)) { |
| 89 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Failed to initialize iterator over received dbus message."); |
| 90 | goto cleanup; |
| 91 | } |
| 92 | |
| 93 | if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&args) != DBUS_TYPE_ARRAYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:122:9`! && dbus_message_iter_get_element_typecxx . . $ dbus_message_iter_get_element_type(f50db427ad27749a).(&args) != DBUS_TYPE_DICT_ENTRYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:145:9`!) { |
| 94 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected array of dict_entry argument in reply. Instead received: %s.", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&args))); |
| 95 | goto cleanup; |
| 96 | } |
| 97 | |
| 98 | dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&args, &property_iter); |
| 99 | do { |
| 100 | DBusMessageItercxx . . $ DBusMessageIter# dict_entry, value_variant; |
| 101 | dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&property_iter, &dict_entry); |
| 102 | |
| 103 | if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&dict_entry) != DBUS_TYPE_STRINGcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:104:9`!) { |
| 104 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected string as key in dict_entry. Instead received: %s.", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&dict_entry))); |
| 105 | goto cleanup; |
| 106 | } |
| 107 | |
| 108 | _DBusBasicValuecxx . . $ _DBusBasicValue# value; |
| 109 | dbus_message_iter_get_basiccxx . . $ dbus_message_iter_get_basic(5a06ffdfd9031a8).(&dict_entry, &value); |
| 110 | char *property_name = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(value.strcxx . . $ $anonymous_type_4cbcdbc067a1c97e_1#str.); |
| 111 | |
| 112 | if (dbus_message_iter_nextcxx . . $ dbus_message_iter_next(e45094e8c4b79815).(&dict_entry) == falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!) { |
| 113 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Expected another field in dict_entry."); |
| 114 | freecxx . . $ free(5d22bdacc48458e8).(property_name); |
| 115 | goto cleanup; |
| 116 | } |
| 117 | |
| 118 | if (dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&dict_entry) != DBUS_TYPE_VARIANTcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:126:9`!) { |
| 119 | dDcxx . . $ `src/common/debug_priv.h:64:9`!("Expected variant as value in dict_entry. Instead received: %s.", dbus_message_type_to_string(dbus_message_iter_get_arg_type(&dict_entry))); |
| 120 | freecxx . . $ free(5d22bdacc48458e8).(property_name); |
| 121 | goto cleanup; |
| 122 | } |
| 123 | |
| 124 | dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&dict_entry, &value_variant); |
| 125 | |
| 126 | int cbret = 0; |
| 127 | const int arg_type = dbus_message_iter_get_arg_typecxx . . $ dbus_message_iter_get_arg_type(f50db427ad27749a).(&value_variant); |
| 128 | // DBUS_TYPE_ARRAY is a special case, we report each element as one value entry |
| 129 | if (arg_type == DBUS_TYPE_ARRAYcxx . . $ `<external>/9999628393408380398/dbus-protocol.h:122:9`!) { |
| 130 | DBusMessageItercxx . . $ DBusMessageIter# array; |
| 131 | dbus_message_iter_recursecxx . . $ dbus_message_iter_recurse(6e42dd501f62eaf0).(&value_variant, &array); |
| 132 | |
| 133 | do { |
| 134 | char *element = oval_dbus_value_to_stringcxx . . $ oval_dbus_value_to_string(c8641a873d86c3b).(&array); |
| 135 | if (element == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 136 | continue; |
| 137 | |
| 138 | const int elementcbret = callback(property_name, element, cbarg); |
| 139 | if (elementcbret > cbret) |
| 140 | cbret = elementcbret; |
| 141 | |
| 142 | freecxx . . $ free(5d22bdacc48458e8).(element); |
| 143 | } |
| 144 | while (dbus_message_iter_nextcxx . . $ dbus_message_iter_next(e45094e8c4b79815).(&array)); |
| 145 | } |
| 146 | else { |
| 147 | char *property_value = oval_dbus_value_to_stringcxx . . $ oval_dbus_value_to_string(c8641a873d86c3b).(&value_variant); |
| 148 | cbret = callback(property_name, property_value, cbarg); |
| 149 | freecxx . . $ free(5d22bdacc48458e8).(property_value); |
| 150 | } |
| 151 | |
| 152 | freecxx . . $ free(5d22bdacc48458e8).(property_name); |
| 153 | if (cbret != 0) { |
| 154 | goto cleanup; |
| 155 | } |
| 156 | } |
| 157 | while (dbus_message_iter_nextcxx . . $ dbus_message_iter_next(e45094e8c4b79815).(&property_iter)); |
| 158 | |
| 159 | dbus_message_unrefcxx . . $ dbus_message_unref(ef6f40ad6aaa7be8).(msg); msg = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 160 | ret = 0; |
| 161 | |
| 162 | cleanup: |
| 163 | if (pending != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 164 | dbus_pending_call_unrefcxx . . $ dbus_pending_call_unref(f8094f87eabead78).(pending); |
| 165 | |
| 166 | if (msg != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 167 | dbus_message_unrefcxx . . $ dbus_message_unref(ef6f40ad6aaa7be8).(msg); |
| 168 | |
| 169 | return ret; |
| 170 | } |
| 171 | |
| 172 | struct unit_callback_varscxx . . $ unit_callback_vars# { |
| 173 | DBusConnectioncxx . . $ DBusConnection# *dbus_conncxx . . $ unit_callback_vars#dbus_conn.; |
| 174 | probe_ctxcxx . . $ probe_ctx# *ctxcxx . . $ unit_callback_vars#ctx.; |
| 175 | SEXP_tcxx . . $ SEXP_t# *unit_entitycxx . . $ unit_callback_vars#unit_entity.; |
| 176 | SEXP_tcxx . . $ SEXP_t# *property_entitycxx . . $ unit_callback_vars#property_entity.; |
| 177 | SEXP_tcxx . . $ SEXP_t# *se_unitcxx . . $ unit_callback_vars#se_unit.; |
| 178 | SEXP_tcxx . . $ SEXP_t# *se_propertycxx . . $ unit_callback_vars#se_property.; |
| 179 | SEXP_tcxx . . $ SEXP_t# *itemcxx . . $ unit_callback_vars#item.; |
| 180 | }; |
| 181 | |
| 182 | static int property_callbackcxx . . $ property_callback(285a709643be31b2).(const char *property, const char *value, void *cbarg) |
| 183 | { |
| 184 | struct unit_callback_varscxx . . $ unit_callback_vars# *vars = (struct unit_callback_varscxx . . $ unit_callback_vars# *)cbarg; |
| 185 | |
| 186 | if (vars->se_propertycxx . . $ unit_callback_vars#se_property. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 187 | // |
| 188 | // Compare the previously matched entity to the current one |
| 189 | // If they are the same, continue to fill the current item |
| 190 | // with property values. If not, collect the item and create |
| 191 | // a new one for the current property. |
| 192 | // |
| 193 | if (SEXP_strcmpcxx . . $ SEXP_strcmp(3ef1a37bcb3c2a).(vars->se_propertycxx . . $ unit_callback_vars#se_property., property) == 0) { |
| 194 | SEXP_tcxx . . $ SEXP_t# *se_value = SEXP_string_newcxx . . $ SEXP_string_new(a588a58d7514eee2).(value, strlencxx . . $ strlen(751346f8406fd082).(value)); |
| 195 | probe_item_ent_addcxx . . $ probe_item_ent_add(9f488d3b029fc9d1).(vars->itemcxx . . $ unit_callback_vars#item., "value", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, se_value); |
| 196 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(se_value); |
| 197 | return 0; |
| 198 | } else { |
| 199 | probe_item_collectcxx . . $ probe_item_collect(11bb80e0c30650d7).(vars->ctxcxx . . $ unit_callback_vars#ctx., vars->itemcxx . . $ unit_callback_vars#item.); |
| 200 | vars->itemcxx . . $ unit_callback_vars#item. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 201 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(vars->se_propertycxx . . $ unit_callback_vars#se_property.); |
| 202 | vars->se_propertycxx . . $ unit_callback_vars#se_property. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | SEXP_tcxx . . $ SEXP_t# *se_property = SEXP_string_newcxx . . $ SEXP_string_new(a588a58d7514eee2).(property, strlencxx . . $ strlen(751346f8406fd082).(property)); |
| 207 | |
| 208 | if (probe_entobj_cmpcxx . . $ probe_entobj_cmp(e245451a1311e799).(vars->property_entitycxx . . $ unit_callback_vars#property_entity., se_property) != OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.) { |
| 209 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(se_property); |
| 210 | return 0; |
| 211 | } |
| 212 | |
| 213 | vars->se_propertycxx . . $ unit_callback_vars#se_property. = se_property; |
| 214 | vars->itemcxx . . $ unit_callback_vars#item. = probe_item_createcxx . . $ probe_item_create(36b16a6622050a9c).(OVAL_LINUX_SYSTEMDUNITPROPERTYcxx . . $ OVAL_LINUX_SYSTEMDUNITPROPERTY., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 215 | "unit", OVAL_DATATYPE_SEXPcxx . . $ OVAL_DATATYPE_SEXP., vars->se_unitcxx . . $ unit_callback_vars#se_unit., |
| 216 | "property", OVAL_DATATYPE_SEXPcxx . . $ OVAL_DATATYPE_SEXP., vars->se_propertycxx . . $ unit_callback_vars#se_property., |
| 217 | "value", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., value, |
| 218 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 219 | return 0; |
| 220 | } |
| 221 | |
| 222 | static int unit_callbackcxx . . $ unit_callback(53df3a489c338db2).(const char *unit, void *cbarg) |
| 223 | { |
| 224 | struct unit_callback_varscxx . . $ unit_callback_vars# *vars = (struct unit_callback_varscxx . . $ unit_callback_vars# *)cbarg; |
| 225 | SEXP_tcxx . . $ SEXP_t# *se_unit = SEXP_string_newcxx . . $ SEXP_string_new(a588a58d7514eee2).(unit, strlencxx . . $ strlen(751346f8406fd082).(unit)); |
| 226 | |
| 227 | if (probe_entobj_cmpcxx . . $ probe_entobj_cmp(e245451a1311e799).(vars->unit_entitycxx . . $ unit_callback_vars#unit_entity., se_unit) != OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.) { |
| 228 | /* Do nothing, continue with the next unit */ |
| 229 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(se_unit); |
| 230 | return 0; |
| 231 | } |
| 232 | |
| 233 | vars->se_unitcxx . . $ unit_callback_vars#se_unit. = se_unit; |
| 234 | vars->se_propertycxx . . $ unit_callback_vars#se_property. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 235 | vars->itemcxx . . $ unit_callback_vars#item. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 236 | |
| 237 | char *unit_path = get_path_by_unitcxx . . $ get_path_by_unit(9da5f9108eb37f8b).(vars->dbus_conncxx . . $ unit_callback_vars#dbus_conn., unit); |
| 238 | |
| 239 | if (unit_path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 240 | return 1; |
| 241 | } |
| 242 | |
| 243 | get_all_properties_by_unit_pathcxx . . $ get_all_properties_by_unit_path(3f2900d7c8a6e421).(vars->dbus_conncxx . . $ unit_callback_vars#dbus_conn., unit_path, |
| 244 | property_callbackcxx . . $ property_callback(285a709643be31b2)., vars); |
| 245 | freecxx . . $ free(5d22bdacc48458e8).(unit_path); |
| 246 | |
| 247 | if (vars->itemcxx . . $ unit_callback_vars#item. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 248 | probe_item_collectcxx . . $ probe_item_collect(11bb80e0c30650d7).(vars->ctxcxx . . $ unit_callback_vars#ctx., vars->itemcxx . . $ unit_callback_vars#item.); |
| 249 | vars->itemcxx . . $ unit_callback_vars#item. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 250 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(vars->se_propertycxx . . $ unit_callback_vars#se_property.); |
| 251 | vars->se_propertycxx . . $ unit_callback_vars#se_property. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 252 | } |
| 253 | |
| 254 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(se_unit); |
| 255 | return 0; |
| 256 | } |
| 257 | |
| 258 | int systemdunitproperty_probe_offline_mode_supportedcxx . . $ systemdunitproperty_probe_offline_mode_supported(b126dc7c1de90089).(void) |
| 259 | { |
| 260 | return PROBE_OFFLINE_OWNcxx . . $ PROBE_OFFLINE_OWN.; |
| 261 | } |
| 262 | |
| 263 | int systemdunitproperty_probe_maincxx . . $ systemdunitproperty_probe_main(470536d3ffacaf10).(probe_ctxcxx . . $ probe_ctx# *ctx, void *probe_arg) |
| 264 | { |
| 265 | SEXP_tcxx . . $ SEXP_t# *unit_entity, *probe_in, *property_entity; |
| 266 | oval_schema_version_tcxx . . $ oval_schema_version_t# oval_version; |
| 267 | |
| 268 | probe_in = probe_ctx_getobjectcxx . . $ probe_ctx_getobject(4299b6b53fa804a5).(ctx); |
| 269 | oval_version = probe_obj_get_platform_schema_versioncxx . . $ probe_obj_get_platform_schema_version(5bacca80194debea).(probe_in); |
| 270 | |
| 271 | if (oval_schema_version_cmpcxx . . $ oval_schema_version_cmp(b4d0c2bfb97f274f).(oval_version, OVAL_SCHEMA_VERSIONcxx . . $ `src/OVAL/public/oval_schema_version.h:39:9`!(5.11)) < 0) { |
| 272 | // OVAL 5.10 and less |
| 273 | return PROBE_EOPNOTSUPPcxx . . $ `src/OVAL/probes/public/probe-common.h:14:9`!; |
| 274 | } |
| 275 | |
| 276 | DBusErrorcxx . . $ DBusError# dbus_error; |
| 277 | DBusConnectioncxx . . $ DBusConnection# *dbus_conn; |
| 278 | |
| 279 | dbus_error_initcxx . . $ dbus_error_init(b79b632916b634d5).(&dbus_error); |
| 280 | dbus_conn = oval_connect_dbuscxx . . $ oval_connect_dbus(f89cc4e9350282f7).(); |
| 281 | |
| 282 | if (dbus_conn == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 283 | dbus_error_freecxx . . $ dbus_error_free(b79b632916b634d5).(&dbus_error); |
| 284 | SEXP_tcxx . . $ SEXP_t# *msg = probe_msg_creatcxx . . $ probe_msg_creat(c07e3aa4e7ab9719).(OVAL_MESSAGE_LEVEL_INFOcxx . . $ OVAL_MESSAGE_LEVEL_INFO., "DBus connection failed, could not identify systemd units."); |
| 285 | probe_cobj_set_flagcxx . . $ probe_cobj_set_flag(644bab5dffe689c).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), ctx->offline_modecxx . . $ probe_ctx#offline_mode. == PROBE_OFFLINE_NONEcxx . . $ PROBE_OFFLINE_NONE. ? SYSCHAR_FLAG_ERRORcxx . . $ SYSCHAR_FLAG_ERROR. : SYSCHAR_FLAG_NOT_COLLECTEDcxx . . $ SYSCHAR_FLAG_NOT_COLLECTED.); |
| 286 | probe_cobj_add_msgcxx . . $ probe_cobj_add_msg(ef7ee42b5817e0be).(probe_ctx_getresultcxx . . $ probe_ctx_getresult(4299b6b53fa804a5).(ctx), msg); |
| 287 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(msg); |
| 288 | return 0; |
| 289 | } |
| 290 | |
| 291 | unit_entity = probe_obj_getentcxx . . $ probe_obj_getent(7907a01f2ff841f3).(probe_in, "unit", 1); |
| 292 | property_entity = probe_obj_getentcxx . . $ probe_obj_getent(7907a01f2ff841f3).(probe_in, "property", 1); |
| 293 | |
| 294 | struct unit_callback_varscxx . . $ unit_callback_vars# vars; |
| 295 | |
| 296 | vars.dbus_conncxx . . $ unit_callback_vars#dbus_conn. = dbus_conn; |
| 297 | vars.ctxcxx . . $ unit_callback_vars#ctx. = ctx; |
| 298 | vars.unit_entitycxx . . $ unit_callback_vars#unit_entity. = unit_entity; |
| 299 | vars.property_entitycxx . . $ unit_callback_vars#property_entity. = property_entity; |
| 300 | |
| 301 | get_all_systemd_unitscxx . . $ get_all_systemd_units(cc44debc175259da).(dbus_conn, unit_callbackcxx . . $ unit_callback(53df3a489c338db2)., &vars); |
| 302 | |
| 303 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(unit_entity); |
| 304 | SEXP_freecxx . . $ SEXP_free(c6b28547479798f4).(property_entity); |
| 305 | dbus_error_freecxx . . $ dbus_error_free(b79b632916b634d5).(&dbus_error); |
| 306 | oval_disconnect_dbuscxx . . $ oval_disconnect_dbus(5ffe6e60e141c747).(dbus_conn); |
| 307 | |
| 308 | return 0; |
| 309 | } |