summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorMichal Sekletar <msekletar@users.noreply.github.com>2016-10-28 12:09:14 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2016-10-28 12:09:14 +0200
commit4f985bd80278972912b80df1390f84d7a89f8d51 (patch)
treeff76fe53af0d0bbbcc9580315b1a28f976cbc09e /src/udev
parente100155dccaf90521f3e4da5af06736685e9e935 (diff)
udev: allow substitutions for SECLABEL key (#4505)
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-rules.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 7619c8371b..f6c416bf70 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -2218,10 +2218,16 @@ void udev_rules_apply_to_event(struct udev_rules *rules,
rule->rule.filename_line);
break;
case TK_A_SECLABEL: {
+ char label_str[UTIL_LINE_SIZE] = {};
const char *name, *label;
name = rules_str(rules, cur->key.attr_off);
- label = rules_str(rules, cur->key.value_off);
+ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), label_str, sizeof(label_str));
+ if (label_str[0] != '\0')
+ label = label_str;
+ else
+ label = rules_str(rules, cur->key.value_off);
+
if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL)
udev_list_cleanup(&event->seclabel_list);
udev_list_entry_add(&event->seclabel_list, name, label);