LoadCredentials: do not assert on invalid syntax
authorLuca Boccassi <luca.boccassi@microsoft.com>
Thu, 1 Apr 2021 21:18:29 +0000 (22:18 +0100)
committerMichael Biebl <biebl@debian.org>
Mon, 12 Apr 2021 18:21:24 +0000 (19:21 +0100)
commit9a749dc3c225ed1ed9f4524487da79ad44180d9b
tree75ccc9deadc11aaf5cf348eb8358e46cf7bdc0b0
parent4aed6c88c67f690ebbc697ca4c7abae37544844e
LoadCredentials: do not assert on invalid syntax

LoadCredentials=foo causes an assertion to be triggered, as we
are not checking that the rvalue's right hand side part is non-empty
before using it in unit_full_printf.

Fixes #19178

# printf [Service]nLoadCredential=passwd.hashed-password.rootn > hello.service
# systemd-analyze verify ./hello.service
...
Assertion 'format' failed at src/core/unit-printf.c:232, function unit_full_printf(). Aborting.
Aborted (core dumped)

(cherry picked from commit f7a6f1226e800f7695c2073675523062ea697aa4)

Gbp-Pq: Name LoadCredentials-do-not-assert-on-invalid-syntax.patch
src/core/load-fragment.c