+ if (cur->key.op == OP_ASSIGN_FINAL)
+ event->devlink_final = true;
+ if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
+ udev_device_cleanup_devlinks_list(event->dev);
+
+ /* allow multiple symlinks separated by spaces */
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], temp, sizeof(temp));
+ if (esc == ESCAPE_UNSET)
+ count = udev_util_replace_chars(temp, "/ ");
+ else if (esc == ESCAPE_REPLACE)
+ count = udev_util_replace_chars(temp, "/");
+ if (count > 0)
+ info(event->udev, "%i character(s) replaced\n" , count);
+ dbg(event->udev, "rule applied, added symlink(s) '%s'\n", temp);
+ pos = temp;
+ while (isspace(pos[0]))
+ pos++;
+ next = strchr(pos, ' ');
+ while (next != NULL) {
+ next[0] = '\0';
+ info(event->udev, "LINK '%s' %s:%u\n", pos,
+ &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", pos, NULL);
+ udev_device_add_devlink(event->dev, filename, cur->key.devlink_unique);
+ while (isspace(next[1]))
+ next++;
+ pos = &next[1];
+ next = strchr(pos, ' ');
+ }
+ if (pos[0] != '\0') {
+ info(event->udev, "LINK '%s' %s:%u\n", pos,
+ &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", pos, NULL);
+ udev_device_add_devlink(event->dev, filename, cur->key.devlink_unique);
+ }
+ break;
+ }
+ case TK_A_ATTR: {
+ const char *key_name = &rules->buf[cur->key.attr_off];
+ char attr[UTIL_PATH_SIZE];
+ char value[UTIL_NAME_SIZE];
+ FILE *f;
+
+ if (util_resolve_subsys_kernel(event->udev, key_name, attr, sizeof(attr), 0) != 0)
+ util_strscpyl(attr, sizeof(attr), udev_device_get_syspath(event->dev), "/", key_name, NULL);
+ attr_subst_subdir(attr, sizeof(attr));
+
+ udev_event_apply_format(event, &rules->buf[cur->key.value_off], value, sizeof(value));
+ info(event->udev, "ATTR '%s' writing '%s' %s:%u\n", attr, value,
+ &rules->buf[rule->rule.filename_off],
+ rule->rule.filename_line);
+ f = fopen(attr, "w");
+ if (f != NULL) {
+ if (fprintf(f, "%s", value) <= 0)
+ err(event->udev, "error writing ATTR{%s}: %m\n", attr);
+ fclose(f);
+ } else {
+ err(event->udev, "error opening ATTR{%s} for writing: %m\n", attr);