From 332081b3113dc8e37503e6fb28aeeaf293c55de4 Mon Sep 17 00:00:00 2001 From: Zhang Yaqi Date: Tue, 25 Jun 2024 16:39:52 +0800 Subject: [PATCH] bugfix fix printing of time_t values --- backport-fix-printing-of-time_t-values.patch | 57 ++++++++++++++++++++ rsyslog.spec | 9 +++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 backport-fix-printing-of-time_t-values.patch diff --git a/backport-fix-printing-of-time_t-values.patch b/backport-fix-printing-of-time_t-values.patch new file mode 100644 index 0000000..ebeebd5 --- /dev/null +++ b/backport-fix-printing-of-time_t-values.patch @@ -0,0 +1,57 @@ +From dbe5cba4f725dea49dc70740efe550b141f2cc4c Mon Sep 17 00:00:00 2001 +From: Michael Biebl +Date: Wed, 10 Apr 2024 19:28:52 +0200 +Subject: [PATCH] fix printing of time_t values + +time_t can be 64bit, even on 32bit architectures. So always use 64bit +integers (PRId64) when printing time_t values and upcast as necessary. + +See https://wiki.debian.org/ReleaseGoals/64bit-time + +Fixes: #5355 +--- + contrib/mmkubernetes/mmkubernetes.c | 5 +++-- + plugins/imfile/imfile.c | 8 ++++---- + 2 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/contrib/mmkubernetes/mmkubernetes.c b/contrib/mmkubernetes/mmkubernetes.c +index 525962e..f6d475e 100644 +--- a/contrib/mmkubernetes/mmkubernetes.c ++++ b/contrib/mmkubernetes/mmkubernetes.c +@@ -1722,8 +1722,9 @@ queryKB(wrkrInstanceData_t *pWrkrData, char *url, time_t now, struct json_object + now -= pWrkrData->pData->cache->lastBusyTime; + if (now < pWrkrData->pData->busyRetryInterval) { + LogMsg(0, RS_RET_RETRY, LOG_DEBUG, +- "mmkubernetes: Waited [%ld] of [%d] seconds for the requested url [%s]\n", +- now, pWrkrData->pData->busyRetryInterval, url); ++ "mmkubernetes: Waited [%"PRId64"] of [%d] seconds for " ++ "the requested url [%s]\n", ++ (int64_t) now, pWrkrData->pData->busyRetryInterval, url); + ABORT_FINALIZE(RS_RET_RETRY); + } else { + LogMsg(0, RS_RET_OK, LOG_DEBUG, +diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c +index e922261..9e282a4 100644 +--- a/plugins/imfile/imfile.c ++++ b/plugins/imfile/imfile.c +@@ -854,13 +854,13 @@ detect_updates(fs_edge_t *const edge) + * delay will never be reached and the file will be closed when the inode has changed. + */ + if (act->time_to_delete + FILE_DELETE_DELAY < ttNow) { +- DBGPRINTF("detect_updates obj gone away, unlinking: '%s', ttDelete: %lds, ttNow:%ld\n", +- act->name, ttNow - (act->time_to_delete + FILE_DELETE_DELAY), ttNow); ++ DBGPRINTF("detect_updates obj gone away, unlinking: '%s', ttDelete: %"PRId64"s, ttNow:%"PRId64"\n", ++ act->name, (int64_t) ttNow - (act->time_to_delete + FILE_DELETE_DELAY), (int64_t) ttNow); + act_obj_unlink(act); + restart = 1; + } else { +- DBGPRINTF("detect_updates obj gone away, keep '%s' open: %ld/%ld/%lds!\n", +- act->name, act->time_to_delete, ttNow, ttNow - act->time_to_delete); ++ DBGPRINTF("detect_updates obj gone away, keep '%s' "open: %"PRId64"/%"PRId64"/%"PRId64"s!\n", ++ act->name, (int64_t) act->time_to_delete, (int64_t) ttNow, (int64_t) ttNow - act->time_to_delete); + pollFile(act); + } + } +-- +2.27.0 + diff --git a/rsyslog.spec b/rsyslog.spec index 50aa345..9a0bf1a 100644 --- a/rsyslog.spec +++ b/rsyslog.spec @@ -7,7 +7,7 @@ Name: rsyslog Version: 8.2210.0 -Release: 8 +Release: 9 Summary: The rocket-fast system for log processing License: (GPLv3+ and ASL 2.0) URL: http://www.rsyslog.com/ @@ -49,6 +49,7 @@ Patch6016: backport-tcpflood-bugfix-TCP-sending-was-not-implemented-properl Patch6017: backport-tcpflood-bugfix-plain-tcp-send-error-not-properly-reported.patch Patch6018: backport-fix-startup-issue-on-modern-systemd-systems.patch Patch6019: backport-tcp-net-subsystem-handle-data-race-gracefully.patch +Patch6020: backport-fix-printing-of-time_t-values.patch BuildRequires: gcc autoconf automake bison dos2unix flex pkgconfig python3-docutils libtool BuildRequires: libgcrypt-devel libuuid-devel zlib-devel krb5-devel libnet-devel gnutls-devel @@ -514,6 +515,12 @@ done %{_mandir}/man1/rscryutil.1.gz %changelog +* Tue Jun 25 2024 zhangyaqi -8.2210.0-9 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix printing of time_t values + * Thu Mar 21 2024 zhangqiumiao - 8.2210.0-8 - Type:bugfix - CVE:NA -- Gitee