- if (path == NULL) {
- r = -EINVAL;
- goto finish;
- }
-
- r = bus_method_call_with_reply(
- bus,
- "org.freedesktop.systemd1",
- path,
- "org.freedesktop.DBus.Properties",
- "GetAll",
- &reply,
- NULL,
- DBUS_TYPE_STRING, &interface,
- DBUS_TYPE_INVALID);
- if (r < 0)
- goto finish;
-
- if (!dbus_message_iter_init(reply, &iter) ||
- dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
- dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_DICT_ENTRY) {
- log_error("Failed to parse reply.");
- r = -EIO;
- goto finish;
- }
-
- dbus_message_iter_recurse(&iter, &sub);
-
- while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
- const char *prop;
-
- assert(dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_DICT_ENTRY);
- dbus_message_iter_recurse(&sub, &sub2);
-
- if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &prop, true) < 0) {
- log_error("Failed to parse reply.");
- r = -EIO;
- goto finish;
- }
-
- if (dbus_message_iter_get_arg_type(&sub2) != DBUS_TYPE_VARIANT) {
- log_error("Failed to parse reply.");
- r = -EIO;
- goto finish;
- }
-
- dbus_message_iter_recurse(&sub2, &sub3);
- dbus_message_iter_next(&sub);
-
- if (!nulstr_contains(dependencies, prop))
- continue;
-
- if (dbus_message_iter_get_arg_type(&sub3) == DBUS_TYPE_ARRAY) {
- if (dbus_message_iter_get_element_type(&sub3) == DBUS_TYPE_STRING) {
- DBusMessageIter sub4;
- dbus_message_iter_recurse(&sub3, &sub4);
-
- while (dbus_message_iter_get_arg_type(&sub4) != DBUS_TYPE_INVALID) {
- const char *s;
-
- assert(dbus_message_iter_get_arg_type(&sub4) == DBUS_TYPE_STRING);
- dbus_message_iter_get_basic(&sub4, &s);
-
- r = strv_extend(&ret, s);
- if (r < 0) {
- log_oom();
- goto finish;
- }