LoadCredentials: do not assert on invalid syntax
authorLuca Boccassi <luca.boccassi@microsoft.com>
Thu, 1 Apr 2021 21:18:29 +0000 (22:18 +0100)
committerCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Thu, 26 Jun 2025 00:44:53 +0000 (21:44 -0300)
commit79949b66a5dc948bc2e50e203498ec8e3d27c980
treea3025a055ab015a746a6a6c8649789c66adbdf6d
parente2c5b0b1bc14e15a642ffa705f11fc2b410c3b50
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