Date: Friday, September 13, 2019 @ 17:10:39 Author: eworm Revision: 362578
upgpkg: cronie 1.5.4-2 do not log carriage return Added: cronie/trunk/0001-do-not-log-carriage-return.patch Modified: cronie/trunk/PKGBUILD ---------------------------------------+ 0001-do-not-log-carriage-return.patch | 35 ++++++++++++++++++++++++++++++++ PKGBUILD | 9 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) Added: 0001-do-not-log-carriage-return.patch =================================================================== --- 0001-do-not-log-carriage-return.patch (rev 0) +++ 0001-do-not-log-carriage-return.patch 2019-09-13 17:10:39 UTC (rev 362578) @@ -0,0 +1,35 @@ +From cdc44c2b78ae88bf62bb870969ba814d3a79e71c Mon Sep 17 00:00:00 2001 +From: Christian Hesse <m...@eworm.de> +Date: Mon, 9 Sep 2019 10:17:32 +0200 +Subject: [PATCH 1/1] 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 | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/do_command.c b/src/do_command.c +index 45c49f7..ed56775 100644 +--- a/src/do_command.c ++++ b/src/do_command.c +@@ -506,6 +506,8 @@ static int child_process(entry * e, char **jobenv) { + */ + + while (EOF != (ch = getc(in))) { ++ if (ch == '\r') ++ continue; + bytes++; + if (mail) + putc(ch, mail); Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-09-13 13:57:20 UTC (rev 362577) +++ PKGBUILD 2019-09-13 17:10:39 UTC (rev 362578) @@ -3,7 +3,7 @@ pkgname='cronie' pkgver=1.5.4 -pkgrel=1 +pkgrel=2 pkgdesc='Daemon that runs specified programs at scheduled times and related tools' url='https://github.com/cronie-crond/cronie/' license=('custom:BSD') @@ -12,10 +12,12 @@ optdepends=('smtp-server: send job output via email' 'smtp-forwarder: forward job output to email server') source=("https://github.com/cronie-crond/cronie/releases/download/${pkgname}-${pkgver}-final/${pkgname}-${pkgver}.tar.gz" + '0001-do-not-log-carriage-return.patch' 'service' 'pam.d' 'deny') sha256sums=('af8970559cad4262f8ffd7ec72abf682d2dcce04fdfb8f206a71d96566aba882' + '595e96997afe506ad93a98896830f3651667f56406a5ae67f4bcf513cfcb45ad' 'ac3ff3c8a5ce1b6367b06877b4b12ff74e7f18a3c510fb9f80d6ea6b6321e3b1' '00864268b491bab8c66400a4a4b4bf85f168a6e44e85676105e084940924090c' 'ae6e533ecdfc1bd2dd80a9e25acb0260cbe9f00c4e4abee93d552b3660f263fc') @@ -28,6 +30,11 @@ conflicts=('cron') provides=('cron') +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -Np1 < ../0001-do-not-log-carriage-return.patch +} + build() { cd "${srcdir}/${pkgname}-${pkgver}" ./configure \