Skip to content

Operator := not preventing further assignments to RUN #256

@akselaase

Description

@akselaase

Using RUN:="/my_script.sh" in a rule doesn't inhibit later rules from appending RUN commands.

This seems to be due to missing handling of event->run_final here:

if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)

Happens with eudev 3.2.7 (udevd --version shows 220), but the missing code isn't present on master either.

Seems to be resolved with the following patch, although this is only lightly tested.

--- a/src/udev/udev-rules.c	2023-08-29 14:39:36.249571381 +0200
+++ b/src/udev/udev-rules.c	2023-08-29 14:41:01.689303563 +0200
@@ -2589,6 +2589,10 @@
                 case TK_A_RUN_PROGRAM: {
                         struct udev_list_entry *entry;
 
+                        if (event->run_final)
+                                break;
+                        if (cur->key.op == OP_ASSIGN_FINAL)
+                                event->run_final = true;
                         if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
                                 udev_list_cleanup(&event->run_list);
                         log_debug("RUN '%s' %s:%u",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions