Projects
Mega:24.03
audit
_service:tar_scm:bugfix-audit-reload-coredump.p...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:bugfix-audit-reload-coredump.patch of Package audit
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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2