]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: do not unescape command result
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 5 Mar 2021 00:37:24 +0000 (09:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 5 Mar 2021 00:42:56 +0000 (09:42 +0900)
This fixes a bug introduced by 28a5065149c31a8689738ddcd1100502371a7c34.

Fixes RHBZ#1935062 (https://bugzilla.redhat.com/show_bug.cgi?id=1935062).

src/udev/udev-rules.c

index 0f10116a997075600d9d3311e3b9f638b266c05e..57ede6a197f6dffef867b835fb11f4de8c1dd35f 100644 (file)
@@ -1746,9 +1746,10 @@ static int udev_rule_apply_token_to_event(
                         return token->op == OP_NOMATCH;
                 }
 
-                lines = strv_split_newlines(result);
-                if (!lines)
-                        return log_oom();
+                r = strv_split_newlines_full(&lines, result, EXTRACT_RETAIN_ESCAPE);
+                if (r < 0)
+                        log_rule_warning_errno(dev, rules, r,
+                                               "Failed to extract lines from result of command \"%s\", ignoring: %m", buf);
 
                 STRV_FOREACH(line, lines) {
                         char *key, *value;