]> err.no Git - systemd/commitdiff
builtin: apply format string
authorKay Sievers <kay.sievers@vrfy.org>
Fri, 23 Dec 2011 04:12:34 +0000 (05:12 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Fri, 23 Dec 2011 04:12:34 +0000 (05:12 +0100)
udev/udev-rules.c

index 0de44054b75b29401e85272f67ce12d4942ae238..4226d0b4e0ea801439765db624131ffeb960cf00 100644 (file)
@@ -2304,7 +2304,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                        break;
                }
                case TK_M_IMPORT_BUILTIN: {
-                       const char *command = &rules->buf[cur->key.value_off];
+                       char command[UTIL_PATH_SIZE];
 
                        if (udev_builtin_run_once(cur->key.builtin_cmd)) {
                                /* check if we ran already */
@@ -2322,10 +2322,13 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                /* mark as ran */
                                event->builtin_run |= (1 << cur->key.builtin_cmd);
                        }
+
+                       udev_event_apply_format(event, &rules->buf[cur->key.value_off], command, sizeof(command));
                        info(event->udev, "IMPORT builtin '%s' %s:%u\n",
                             udev_builtin_name(cur->key.builtin_cmd),
                             &rules->buf[rule->rule.filename_off],
                             rule->rule.filename_line);
+
                        if (udev_builtin_run(event->dev, cur->key.builtin_cmd, command, false) != 0) {
                                /* remember failure */
                                info(rules->udev, "IMPORT builtin '%s' returned non-zero\n",