]> git.ipfire.org Git - thirdparty/systemd.git/commit
bus-util: replace non-printable values with [unprintable] 6255/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 1 Jul 2017 20:49:15 +0000 (16:49 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 3 Jul 2017 13:30:57 +0000 (09:30 -0400)
commit5993d46a1a4472cc5a9a227311f913ff934395a3
tree8803bf6b3d06a1ff5dcb42826a00fa82233c66c2
parent3dfbc968e8343172faf754a3c81e27f0dbd8f157
bus-util: replace non-printable values with [unprintable]

Like I said in the previous commit, such values do not seem to appear in normal
use, but it's pretty hard to prove that all paths to assign values properly
check that they contain no spaces. So just in case some slip through, replace
values with spaces (in case of single-valued properties) or spaces and newlines
(in case of array proprties) with "[unprintable]". We were already doing it
in case of properties which we didn't know how to print, so this fits in well.
The advantage is the previous code which used escaping that a) this is easier
to spot, b) does not mess up printing of properties which were properly escaped
already.

v2:
- add comments
src/shared/bus-util.c