代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/audit 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2a7404291e431757bc417c9c3250f2ca84a82d89 Mon Sep 17 00:00:00 2001
From: Leo Fang <leofang_94@163.com>
Date: Mon, 24 May 2021 19:16:02 +0800
Subject: [PATCH] bugfix-audit-reload-coredump
---
src/auditd-reconfig.c | 2 ++
src/auditd.c | 26 ++++++++++++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/auditd-reconfig.c b/src/auditd-reconfig.c
index 37e0adc..66ded38 100644
--- a/src/auditd-reconfig.c
+++ b/src/auditd-reconfig.c
@@ -35,6 +35,7 @@
/* externs we need to know about */
extern void reconfig_ready(void);
+extern void reconfig_pthread_failed(void);
/* This is the configuration manager code */
static pthread_t config_thread;
@@ -122,6 +123,7 @@ static void *config_thread_main(void *arg)
//send_audit_event(AUDIT_DAEMON_CONFIG, txt);
free_config(&new_config);
free(e);
+ reconfig_pthread_failed();
}
pthread_mutex_unlock(&config_lock);
diff --git a/src/auditd.c b/src/auditd.c
index 5933703..53f4803 100644
--- a/src/auditd.c
+++ b/src/auditd.c
@@ -76,6 +76,7 @@ static int hup_info_requested = 0;
static int usr1_info_requested = 0, usr2_info_requested = 0;
static char subj[SUBJ_LEN];
static uint32_t session;
+static int hup_flag = 0;
/* Local function prototypes */
int send_audit_event(int type, const char *str);
@@ -525,8 +526,23 @@ static void netlink_handler(struct ev_loop *loop, struct ev_io *io,
char hup[MAX_AUDIT_MESSAGE_LENGTH];
audit_msg(LOG_DEBUG,
"HUP detected, starting config manager");
- reconfig_ev = cur_event;
- if (start_config_manager(cur_event)) {
+ if(hup_flag == 0)
+ {
+ hup_flag = 1;
+ reconfig_ev = cur_event;
+ if (start_config_manager(cur_event)) {
+ audit_format_signal_info(hup,
+ sizeof(hup),
+ "reconfigure state=no-change",
+ &cur_event->reply,
+ "failed");
+ send_audit_event(AUDIT_DAEMON_CONFIG,
+ hup);
+ hup_flag = 0;
+ }
+ }
+ else
+ {
audit_format_signal_info(hup,
sizeof(hup),
"reconfigure state=no-change",
@@ -576,9 +592,15 @@ static void pipe_handler(struct ev_loop *loop, struct ev_io *io,
// Drain the pipe - won't block because libev sets non-blocking mode
read(pipefds[0], buf, sizeof(buf));
enqueue_event(reconfig_ev);
+ hup_flag = 0;
reconfig_ev = NULL;
}
+void reconfig_pthread_failed(void)
+{
+ hup_flag = 0;
+}
+
void reconfig_ready(void)
{
const char *msg = "ready\n";
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。