From 86c783d93dafde1d175170b6366725ebfd148de6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 5 Mar 2021 09:37:24 +0900 Subject: [PATCH] udev: do not unescape command result This fixes a bug introduced by 28a5065149c31a8689738ddcd1100502371a7c34. Fixes RHBZ#1935062 (https://bugzilla.redhat.com/show_bug.cgi?id=1935062). --- src/udev/udev-rules.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 0f10116a99..57ede6a197 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -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;