summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2017-02-25 14:59:19 -0500
committerAnthony G. Basile <blueness@gentoo.org>2017-02-25 14:59:19 -0500
commit90a8c95446b345cc9b388fdb30866e1cb77fe711 (patch)
tree0e2499b2ff23b3853ab759cc2c8970a3a46c6c4c
parent5bab4d8de0dcbb8e2e7d4d5125b4aea1652a0d60 (diff)
src/udev/udev-rules.c: fix global properties, issue #142
An important hunk was lost when merging systemd commit adeba500 leading to broken global properties, issue #142. This commit fixes this bug. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/udev/udev-rules.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index e2bb99ca7d..c4f422187f 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1963,7 +1963,18 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
const char *value;
value = udev_device_get_property_value(event->dev, key_name);
- if (value == NULL)
+
+ /* check global properties */
+ if (!value && properties_list) {
+ struct udev_list_entry *list_entry;
+
+ list_entry = udev_list_get_entry(properties_list);
+ list_entry = udev_list_entry_get_by_name(list_entry, key_name);
+ if (list_entry != NULL)
+ value = udev_list_entry_get_value(list_entry);
+ }
+
+ if (!value)
value = "";
if (match_key(rules, cur, value))
goto nomatch;