[systemd-bugs] [Bug 90794] [v220 regression] "Failed to unescape command line"

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jun 1 07:03:13 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90794

--- Comment #1 from Daniel Mack <fdo at zonque.org> ---
It seems this broke with commit 527b7a42 ("util: rework cunescape(), improve
error handling"). As load-fragment.c does not pass the UNESCAPE_RELAX flag to
cunescape(), the code now errors out in the attempt of unescaping the quoted
perl regexp '\w+@\K[\d.]+', which it didn't before. As this is clearly a
regression from an older version of systemd, I guess the best we can do is to
restore the old behavior and gracefully handles unescaping errors by copying
the characters verbatim that cannot be unescaped.

Lennart, any reason why you omitted this flag for that specific use case?

My proposed fix would be:

diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index c95c110..df5fe6f 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -610,7 +610,7 @@ int config_parse_exec(
                         else
                                 skip = strneq(word, "\\;", MAX(l, 1U));

-                        r = cunescape_length(word + skip, l - skip, 0, &c);
+                        r = cunescape_length(word + skip, l - skip,
UNESCAPE_RELAX, &c);
                         if (r < 0) {
                                 log_syntax(unit, LOG_ERR, filename, line, r,
"Failed to unescape command line, ignoring: %s", rvalue);
                                 r = 0;

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20150601/3af2af39/attachment.html>


More information about the systemd-bugs mailing list