]>
git.ipfire.org Git - thirdparty/util-linux.git/commit
logger: make sure structured data are escaped
For the option --sd-param all formatting chars (" \ and ]) has to be
escaped by \. This patch also allow escape [ to make it more user
friendly.
For example
$ logger --rfc5424 --sd-id zoo@123 --sd-param 'foo="b\"A\"r"' --no-act --stderr "this is message"
<13>1 2022-05-02T15:35:00.342141+02:00 ws.net.home kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="45291"][zoo@123 foo="b\"A\"r"] this is message
Reported-by: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
Signed-off-by: Karel Zak <kzak@redhat.com>