]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-bus: escape invalid characters in error message
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 26 Jul 2025 18:55:16 +0000 (03:55 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 27 Jul 2025 10:03:15 +0000 (11:03 +0100)
commit31f388ea15b09c410882051e482f1145366e4940
treecc6d66caf1cbf5bdc78b2342a32df3d63a06b2fc
parentef101750caa758744e9162980bedba6dcfbc4c05
sd-bus: escape invalid characters in error message

At many places, we pass arguments of dbus method calls to
sd_bus_error_setf(), and produces unprintable log messages.
Let's always escape the generated error message.

This fixes something like the following:
```
[ 1921.875668] systemd-logind[611]: Got message type=method_call sender=:1.46 destination=:1.6 path=/org/freedesktop/login1 interface=org.freedesktop.login1.Manager member=GetSeat  cookie=1344 reply_cookie=0 signature=s error-name=n/a error-message=n/a
[ 1921.875758] systemd-logind[611]: [725B blob data]
[ 1921.875777] systemd-logind[611]: [768B blob data]
```
src/libsystemd/sd-bus/bus-error.c