1 Star 0 Fork 38

pengyi37/rsyslog

forked from src-openEuler/rsyslog 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-omprog-bugfix-invalid-status-handling-at-called-prog.patch 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
From 1128d320750fb6cfe57b8ad53ef1d5ddf80c81cf Mon Sep 17 00:00:00 2001
From: Rainer Gerhards <rgerhards@adiscon.com>
Date: Sun, 4 Dec 2022 16:05:22 +0100
Subject: [PATCH] omprog bugfix: invalid status handling at called program
There is a bug when external program *startup* does not return "OK". This
can also lead to a misadressing with potentially a segfault (very unlikely).
Note that no problem exists once the initializiation phase of the external
program is finished and regular message transfer runs.
The problem basically is that for a startup failure, the control data for
that external program instance is freed on error. Unfortunately, that state
data is needed later on to detect a suspended instance. We now keep the control
data even on init failure (as we then need to do normal control options).
closes https://github.com/rsyslog/rsyslog/issues/4967
---
Conflict:NA
Reference:https://github.com/rsyslog/rsyslog/commit/1128d320750fb6cfe57b8ad53ef1d5ddf80c81cf
---
plugins/omprog/omprog.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/plugins/omprog/omprog.c b/plugins/omprog/omprog.c
index 4f46f92..dd83e93 100644
--- a/plugins/omprog/omprog.c
+++ b/plugins/omprog/omprog.c
@@ -379,6 +379,7 @@ cleanupChild(instanceData *pData, childProcessCtx_t *pChildCtx)
static void
terminateChild(instanceData *pData, childProcessCtx_t *pChildCtx)
{
+ DBGPRINTF("terminateChild called\n");
assert(pChildCtx->bIsRunning);
if (pData->bSignalOnClose) {
@@ -927,9 +928,6 @@ CODESTARTcreateWrkrInstance
}
finalize_it:
- if(iRet != RS_RET_OK && !pWrkrData->pData->bForceSingleInst) {
- free(pWrkrData->pChildCtx);
- }
ENDcreateWrkrInstance
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pengyi37/rsyslog.git
git@gitee.com:pengyi37/rsyslog.git
pengyi37
rsyslog
rsyslog
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385