LoadCredentials: do not assert on invalid syntax
authorLuca Boccassi <luca.boccassi@microsoft.com>
Thu, 1 Apr 2021 21:18:29 +0000 (22:18 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Apr 2021 06:04:23 +0000 (08:04 +0200)
commit30c872e5fc09596c6f7c61a6955842d124f85f59
tree6508e41dab676fd6073085d8e84e81c79c3b2e3a
parent938bdfc0fa737d86eb3ecc70506e11e5f740e0dc
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)
src/core/load-fragment.c