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>
Sun, 20 Mar 2022 19:55:25 +0000 (19:55 +0000)
commit8062c23c8fd0c590744a367905db8a1e20b736a9
tree39ea505bae2b7e804d7249720ef15a8d1e396a74
parentc6edc41b643877cddd6dbb6252870806b8b4a361
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