- if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &name, true) < 0 ||
- bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &value, false) < 0)
- return -EINVAL;
+ r = cg_get_path(b->controller, b->path, *name, &p);
+ if (r < 0)
+ return r;
+
+ r = read_full_file(p, &v, NULL);
+ if (r >= 0) {
+ r = strv_extend(&result, v);
+ if (r < 0)
+ return r;
+
+ continue;
+ } else if (r != -ENOENT)
+ return r;
+ }
+
+ /* If that didn't work, read our cached value */
+ a = cgroup_attribute_find_list(u->cgroup_attributes, NULL, *name);
+ if (a) {
+ r = strv_extend(&result, a->value);
+ if (r < 0)
+ return r;
+
+ continue;
+ }
+
+ return -ENOENT;
+ }
+
+ *_result = result;
+ result = NULL;
+
+ return 0;
+}
+
+int bus_unit_cgroup_attribute_set(Unit *u, DBusMessageIter *iter) {
+ _cleanup_strv_free_ char **l = NULL;
+ int r;
+ bool runtime = false;
+ char **name, **value;
+
+ assert(u);
+ assert(iter);
+
+ if (!unit_get_exec_context(u))
+ return -EINVAL;
+
+ r = bus_parse_strv_pairs_iter(iter, &l);
+ if (r < 0)
+ return r;
+
+ r = next_and_parse_mode(iter, &runtime);
+ if (r < 0)
+ return r;