]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-rules: perform whitespace replacement for symlink subst values 4837/head
authorDan Streetman <ddstreet@ieee.org>
Tue, 3 Jan 2017 19:39:50 +0000 (14:39 -0500)
committerDan Streetman <ddstreet@ieee.org>
Tue, 3 Jan 2017 22:24:52 +0000 (17:24 -0500)
If the string_escape option is either unset or 'replace' (i.e. if it is
not 'none'), then enable whitespace replacement in SYMLINK variable
substitution values, as added in the last patch.

This will keep any whitespace that is directly contained in a SYMLINK
value, but will replace any whitespace that is added to the SYMLINK
value as a result of variable substitution (except $result/%c).

This fixes bug 4833.

src/udev/udev-rules.c

index c688120552d33fdc78d14d60f472d076554a558f..4d07b8fce03658fac939080694ca145aeacaaa62 100644 (file)
@@ -2336,7 +2336,7 @@ void udev_rules_apply_to_event(struct udev_rules *rules,
                                 udev_device_cleanup_devlinks_list(event->dev);
 
                         /* allow  multiple symlinks separated by spaces */
-                        udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), false);
+                        udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), esc != ESCAPE_NONE);
                         if (esc == ESCAPE_UNSET)
                                 count = util_replace_chars(temp, "/ ");
                         else if (esc == ESCAPE_REPLACE)