]> granicus.if.org Git - cronie/commit
do not log carriage return master
authorChristian Hesse <mail@eworm.de>
Mon, 9 Sep 2019 08:17:32 +0000 (10:17 +0200)
committerTomáš Mráz <t8m@users.noreply.github.com>
Mon, 9 Sep 2019 09:02:58 +0000 (11:02 +0200)
commitcdc44c2b78ae88bf62bb870969ba814d3a79e71c
tree69399067a22ec520a728219af760b68f7068f295
parent153a43fc68ce6c2c7aeaaf4d0c72131d918c7634
do not log carriage return

Some commands (like ssh) end their output with carriage return (\r) and
new line (\n). Just cutting the new line before sending to syslog may
have undesired effects of unprintable characters. Reading cronie logs
with journalctl I can see:

Sep 06 16:50:01 linux CROND[152575]: [96B blob data]

Adding switch --all for unprintable characters it shows:

Sep 06 16:50:01 linux CROND[152575]: (root) CMDOUT (Warning: Permanently
added '10.52.33.217' (ED25519) to the list of known hosts.^M)

Just skip carriage return for syslog to prevent this.
src/do_command.c