import CS rsyslog-8.2506.0-2.el9

This commit is contained in:
eabdullin 2025-09-15 12:40:16 +00:00
parent 4b95dbbfb9
commit c77baeae5e
7 changed files with 202 additions and 43 deletions

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
SOURCES/qpid-proton-0.39.0.tar.gz
SOURCES/rsyslog-8.2412.0.tar.gz
SOURCES/rsyslog-doc-8.2412.0.tar.gz
SOURCES/rsyslog-8.2506.0.tar.gz
SOURCES/rsyslog-doc-8.2506.0.tar.gz

View File

@ -1,3 +1,3 @@
de593ff72792d70b9027dd67aaa2b830dc148574 SOURCES/qpid-proton-0.39.0.tar.gz
d2b48451c525a76a554acc3232605b67ee270aa9 SOURCES/rsyslog-8.2412.0.tar.gz
9b9e0379f368781b4bee17b2b117bf8234c4e9e6 SOURCES/rsyslog-doc-8.2412.0.tar.gz
67be4e7ccc309864c035c7dc1b982d126a1079f3 SOURCES/rsyslog-8.2506.0.tar.gz
f4f3ecd9ba870a747577c1873a53ca606fbba737 SOURCES/rsyslog-doc-8.2506.0.tar.gz

View File

@ -0,0 +1,101 @@
diff -up a/plugins/imfile/imfile.c.orig b/plugins/imfile/imfile.c
--- a/plugins/imfile/imfile.c.orig 2025-07-29 15:54:35.659288215 +0200
+++ b/plugins/imfile/imfile.c 2025-07-29 15:54:40.119329980 +0200
@@ -157,6 +157,7 @@ struct instanceConf_s {
int readTimeout;
unsigned delay_perMsg;
sbool bRMStateOnDel;
+ sbool bRMStateOnMove;
uint8_t readMode;
uchar *startRegex;
uchar *endRegex;
@@ -253,6 +254,7 @@ struct modConfData_s {
instanceConf_t *root, *tail;
fs_node_t *conf_tree;
uint8_t opMode;
+ sbool bRMStateOnMove;
sbool configSetViaV2Method;
uchar *stateFileDirectory;
sbool sortFiles;
@@ -310,7 +312,8 @@ static struct cnfparamdescr modpdescr[]
{ "sortfiles", eCmdHdlrBinary, 0 },
{ "statefile.directory", eCmdHdlrString, 0 },
{ "normalizepath", eCmdHdlrBinary, 0 },
- { "mode", eCmdHdlrGetWord, 0 }
+ { "mode", eCmdHdlrGetWord, 0 },
+ { "deletestateonfilemove", eCmdHdlrBinary, 0 },
};
static struct cnfparamblk modpblk =
{ CNFPARAMBLK_VERSION,
@@ -350,7 +353,8 @@ static struct cnfparamdescr inppdescr[]
{ "needparse", eCmdHdlrBinary, 0},
{ "ignoreolderthan", eCmdHdlrInt, 0},
{ "maxbytesperminute", eCmdHdlrInt, 0},
- { "maxlinesperminute", eCmdHdlrInt, 0}
+ { "maxlinesperminute", eCmdHdlrInt, 0},
+ { "deletestateonfilemove", eCmdHdlrBinary, 0}
};
static struct cnfparamblk inppblk =
{ CNFPARAMBLK_VERSION,
@@ -856,7 +860,7 @@ detect_updates(fs_edge_t *const edge)
*/
sbool is_file = act->edge->is_file;
if (!is_file || act->time_to_delete + FILE_DELETE_DELAY < ttNow) {
- DBGPRINTF("detect_updates obj gone away, unlinking: "
+ DBGPRINTF("detect_updates obj gone away, unlinking: "
"'%s', ttDelete: %"PRId64"s, ttNow:%"PRId64" isFile: %d\n",
act->name, (int64_t) ttNow - (act->time_to_delete + FILE_DELETE_DELAY),
(int64_t) ttNow, is_file);
@@ -1061,8 +1065,17 @@ act_obj_destroy(act_obj_t *const act, co
}
persistStrmState(act);
strm.Destruct(&act->pStrm);
- /* we delete state file after destruct in case strm obj initiated a write */
- if(is_deleted && !act->in_move && inst->bRMStateOnDel) {
+
+ /*
+ * We delete the state file after the destruct operation to ensure that any pending
+ * writes initiated by the stream object are completed before removal. The state file
+ * is deleted in the following scenarios:
+ * - If the file has not been moved and we are configured to delete the state file
+ * when the original file is removed.
+ * - If the configuration specifies not to preserve the state file after the file
+ * has been renamed. This prevents orphaned state files.
+ */
+ if(is_deleted && ((!act->in_move && inst->bRMStateOnDel) || inst->bRMStateOnMove)) {
DBGPRINTF("act_obj_destroy: deleting state file %s\n", statefn);
unlink((char*)statefn);
}
@@ -1773,6 +1786,7 @@ createInstance(instanceConf_t **const pi
inst->discardTruncatedMsg = 0;
inst->msgDiscardingError = 1;
inst->bRMStateOnDel = 1;
+ inst->bRMStateOnMove = loadModConf->bRMStateOnMove;
inst->escapeLF = 1;
inst->escapeLFString = NULL;
inst->reopenOnTruncate = 0;
@@ -1932,6 +1946,7 @@ addInstance(void __attribute__((unused))
inst->addMetadata = 0;
inst->addCeeTag = 0;
inst->bRMStateOnDel = 0;
+ inst->bRMStateOnMove = loadModConf->bRMStateOnMove;
inst->readTimeout = loadModConf->readTimeout;
inst->msgFlag = 0;
@@ -2089,6 +2104,7 @@ CODESTARTbeginCnfLoad
/* init our settings */
loadModConf->opMode = OPMODE_POLLING;
loadModConf->iPollInterval = DFLT_PollInterval;
+ loadModConf->bRMStateOnMove = 0;
loadModConf->configSetViaV2Method = 0;
loadModConf->readTimeout = 0; /* default: no timeout */
loadModConf->timeoutGranularity = 1000; /* default: 1 second */
@@ -2142,6 +2158,8 @@ CODESTARTsetModCnf
continue;
if(!strcmp(modpblk.descr[i].name, "pollinginterval")) {
loadModConf->iPollInterval = (int) pvals[i].val.d.n;
+ } else if(!strcmp(modpblk.descr[i].name, "deletestateonfilemove")) {
+ loadModConf->bRMStateOnMove = (sbool) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "readtimeout")) {
loadModConf->readTimeout = (int) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "timeoutgranularity")) {

View File

@ -1,28 +0,0 @@
diff -up rsyslog-8.2412.0/plugins/imfile/imfile.c.orig rsyslog-8.2412.0/plugins/imfile/imfile.c
--- rsyslog-8.2412.0/plugins/imfile/imfile.c.orig 2024-12-06 13:42:53.855126447 +0100
+++ rsyslog-8.2412.0/plugins/imfile/imfile.c 2024-12-06 13:44:43.990211090 +0100
@@ -264,6 +264,7 @@ struct modConfData_s {
Must be manually reset to 0 if desired. Helper for
polling mode.
*/
+ sbool deleteStateOnFileMove;
};
static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */
static modConfData_t *runModConf = NULL;/* modConf ptr to use for run process */
@@ -2094,6 +2095,7 @@ CODESTARTbeginCnfLoad
loadModConf->timeoutGranularity = 1000; /* default: 1 second */
loadModConf->haveReadTimeouts = 0; /* default: no timeout */
loadModConf->normalizePath = 1;
+ loadModConf->deleteStateOnFileMove = 0;
loadModConf->sortFiles = GLOB_NOSORT;
loadModConf->stateFileDirectory = NULL;
loadModConf->conf_tree = calloc(1, sizeof(fs_node_t));
@@ -2153,6 +2155,8 @@ CODESTARTsetModCnf
loadModConf->stateFileDirectory = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(modpblk.descr[i].name, "normalizepath")) {
loadModConf->normalizePath = (sbool) pvals[i].val.d.n;
+ } else if(!strcmp(modpblk.descr[i].name, "deletestateonfilemove")) {
+ loadModConf->deleteStateOnFileMove = (sbool) pvals[i].val.d.n;
} else if(!strcmp(modpblk.descr[i].name, "mode")) {
if(!es_strconstcmp(pvals[i].val.d.estr, "polling"))
loadModConf->opMode = OPMODE_POLLING;

View File

@ -0,0 +1,62 @@
diff --git a/plugins/imdtls/imdtls.c b/plugins/imdtls/imdtls.c
index f90e8ad61c..bfb63452c7 100644
--- a/plugins/imdtls/imdtls.c
+++ b/plugins/imdtls/imdtls.c
@@ -41,7 +41,9 @@
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
# include <openssl/bioerr.h>
#endif
-#include <openssl/engine.h>
+#ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
// ---
#include "rsyslog.h"
diff --git a/plugins/omdtls/omdtls.c b/plugins/omdtls/omdtls.c
index 2b28908030..693ff99c77 100644
--- a/plugins/omdtls/omdtls.c
+++ b/plugins/omdtls/omdtls.c
@@ -52,7 +52,9 @@
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
# include <openssl/bioerr.h>
#endif
-#include <openssl/engine.h>
+#ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
// ---
// Include rsyslog headers
diff --git a/runtime/net_ossl.h b/runtime/net_ossl.h
index af36ffe488..d66a422d4d 100644
--- a/runtime/net_ossl.h
+++ b/runtime/net_ossl.h
@@ -31,7 +31,9 @@
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
# include <openssl/bioerr.h>
#endif
-#include <openssl/engine.h>
+#ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
#include <openssl/rand.h>
#include <openssl/evp.h>
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index 4b2d98b2c8..7322aeb135 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -129,8 +129,10 @@
#ifdef ENABLE_OPENSSL
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
- #include <openssl/err.h>
- #include <openssl/engine.h>
+ #include <openssl/err.h>
+# ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+# endif
/* OpenSSL API differences */
#if OPENSSL_VERSION_NUMBER >= 0x10100000L

View File

@ -0,0 +1 @@
d /var/lib/rsyslog 0700 root root - -

View File

@ -1,12 +1,13 @@
%define rsyslog_statedir %{_sharedstatedir}/rsyslog
%define rsyslog_pkidir %{_sysconfdir}/pki/rsyslog
%define rsyslog_docdir %{_docdir}/rsyslog
%define qpid_proton_v 0.39.0
Summary: Enhanced system logging and kernel message trapping daemon
Name: rsyslog
Version: 8.2412.0
Release: 1%{?dist}
License: (GPLv3+ and ASL 2.0)
Version: 8.2506.0
Release: 2%{?dist}
License: GPL-3.0-or-later AND Apache-2.0
URL: http://www.rsyslog.com/
Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz
Source1: http://www.rsyslog.com/files/download/rsyslog/%{name}-doc-%{version}.tar.gz
@ -16,9 +17,11 @@ Source4: rsyslog.log
Source5: rsyslog.service
# Add qpid-proton as another source, enable omamqp1 module in a
# separatae sub-package with it statically linked(see rhbz#1713427)
Source6: qpid-proton-0.39.0.tar.gz
Source6: https://archive.apache.org/dist/qpid/proton/%{qpid_proton_v}/qpid-proton-%{qpid_proton_v}.tar.gz
Source7: rsyslog-tmpfiles.conf
Patch0: imfile-deleteStateOnFileMove.patch
Patch0: openssl-disable-engines.patch
Patch1: imfile-delete-state-on-file-move.patch
BuildRequires: make
BuildRequires: gcc
@ -253,6 +256,7 @@ mv build doc
# set up rsyslog sources
%setup -q -D
%patch -P 0 -p1
%patch -P 1 -p1
# Unpack qpid-proton for rhel
%setup -q -D -T -b 6
@ -273,19 +277,18 @@ export CFLAGS="$RPM_OPT_FLAGS -fpic"
%endif
# build the proton first
(
cd %{_builddir}/qpid-proton-0.39.0
cd %{_builddir}/qpid-proton-%{qpid_proton_v}
mkdir bld
cd bld
# Need ENABLE_FUZZ_TESTING=NO to avoid a link failure
# Find python include dir and python library from
# https://stackoverflow.com/questions/24174394/cmake-is-not-able-to-find-python-libraries
# Modern approach for Python discovery in CMake
cmake .. \
-DBUILD_BINDINGS="" \
-DBUILD_STATIC_LIBS=YES \
-DENABLE_FUZZ_TESTING=NO \
-DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \
-DPython_FIND_STRATEGY=LOCATION \
-DPython_ROOT_DIR=/usr \
-DCMAKE_AR="/usr/bin/gcc-ar" -DCMAKE_NM="/usr/bin/gcc-nm" -DCMAKE_RANLIB="/usr/bin/gcc-ranlib"
make -j8
)
@ -305,7 +308,7 @@ autoreconf -if
--prefix=/usr \
--disable-static \
--disable-testbench \
--enable-omamqp1 PROTON_LIBS="%{_builddir}/qpid-proton-0.39.0/bld/c/libqpid-proton-core-static.a %{_builddir}/qpid-proton-0.39.0/bld/c/libqpid-proton-proactor-static.a %{_builddir}/qpid-proton-0.39.0/bld/c/libqpid-proton-static.a -lssl -lsasl2 -lcrypto" PROTON_CFLAGS="-I%{_builddir}/qpid-proton-0.39.0/bld/c/include" \
--enable-omamqp1 PROTON_PROACTOR_LIBS="%{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/libqpid-proton-core-static.a %{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/libqpid-proton-proactor-static.a %{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/libqpid-proton-static.a -lssl -lsasl2 -lcrypto" PROTON_PROACTOR_CFLAGS="-I%{_builddir}/qpid-proton-%{qpid_proton_v}/c/include -I%{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/include" PROTON_LIBS="%{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/libqpid-proton-core-static.a %{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/libqpid-proton-proactor-static.a %{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/libqpid-proton-static.a -lssl -lsasl2 -lcrypto" PROTON_CFLAGS="-I%{_builddir}/qpid-proton-%{qpid_proton_v}/c/include -I%{_builddir}/qpid-proton-%{qpid_proton_v}/bld/c/include" \
--enable-elasticsearch \
--enable-generate-man-pages \
--enable-gnutls \
@ -361,11 +364,13 @@ install -d -m 700 %{buildroot}%{rsyslog_statedir}
install -d -m 700 %{buildroot}%{rsyslog_pkidir}
install -d -m 755 %{buildroot}%{rsyslog_docdir}/html
install -d -m 755 %{buildroot}%{_libexecdir}/%{name}
install -d -m 755 %{buildroot}%{_tmpfilesdir}
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/rsyslog.conf
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/rsyslog
install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/rsyslog
install -p -m 644 %{SOURCE5} %{buildroot}%{_unitdir}/rsyslog.service
install -p -m 644 %{SOURCE7} %{buildroot}%{_tmpfilesdir}/rsyslog.conf
install -p -m 644 plugins/ommysql/createDB.sql %{buildroot}%{rsyslog_docdir}/mysql-createDB.sql
install -p -m 644 plugins/ompgsql/createDB.sql %{buildroot}%{rsyslog_docdir}/pgsql-createDB.sql
dos2unix tools/recover_qi.pl
@ -410,6 +415,7 @@ done
%{_mandir}/man5/rsyslog.conf.5.gz
%{_mandir}/man8/rsyslogd.8.gz
%{_unitdir}/rsyslog.service
%{_tmpfilesdir}/rsyslog.conf
%config(noreplace) %{_sysconfdir}/rsyslog.conf
%config(noreplace) %{_sysconfdir}/sysconfig/rsyslog
# plugins
@ -519,6 +525,23 @@ done
%changelog
* Tue Jul 29 2025 Attila Lakatos <alakatos@redhat.com> 8.2506.0-2
- imfile: reintroduce deleteStateOnFileMove parameter
Resolves: RHEL-92262
* Thu Jun 12 2025 Attila Lakatos <alakatos@redhat.com> - 8.2506.0-1
- Rebase to 8.2506.0
- imuxsock: track dropped messages by ratelimiting
Resolves: RHEL-66274
- man page version update
Resolves: RHEL-78220
- omfwd: do not hang forever in case of broken TLS handshake
Resolves: RHEL-67639
* Wed May 07 2025 Attila Lakatos <alakatos@redhat.com> - 8.2412.0-2
- Add tmpfiles.d configuration
Resolves: RHEL-89982
* Fri Dec 06 2024 Attila Lakatos <alakatos@redhat.com> - 8.2412.0-1
- Rebase to 8.2412.0
Resolves: RHEL-65177