Use signal safe write function in signal handler
(cherry picked from commit 04a2a6776325267cee52c37f8ccc8f2e6e3a75e7)
This commit is contained in:
parent
e052d991c5
commit
1fea9ef8e2
@ -2,7 +2,7 @@
|
||||
|
||||
Name: aide
|
||||
Version: 0.17.4
|
||||
Release: 4
|
||||
Release: 5
|
||||
Summary: Advanced Intrusion Detection Environment
|
||||
License: GPLv2+
|
||||
URL: http://sourceforge.net/projects/aide
|
||||
@ -26,6 +26,7 @@ Patch1: backport-Handle-malformed-database-lines.patch
|
||||
Patch2: backport-Fix-handling-of-duplicate-database-entries.patch
|
||||
Patch3: backport-Switch-from-PCRE-to-PCRE2-closes-116.patch
|
||||
Patch4: backport-Fix-condition-for-error-message-of-failing-to-open-g.patch
|
||||
Patch5: backport-Use-signal-safe-write-function-in-signal-handler.patch
|
||||
|
||||
%description
|
||||
AIDE (Advanced Intrusion Detection Environment, [eyd]) is a file and directory integrity checker.
|
||||
@ -81,6 +82,12 @@ make check
|
||||
%{_mandir}/*/*
|
||||
|
||||
%changelog
|
||||
* Thu Jan 9 2025 yixiangzhike <yixiangzhike007@163.com> - 0.17.4-5
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: backport upstream patch to use signal safe write function in signal handler
|
||||
|
||||
* Thu Jul 4 2024 yixiangzhike <yixiangzhike007@163.com> - 0.17.4-4
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
From f1728dc97c981d76fd913102a822c71c35c58946 Mon Sep 17 00:00:00 2001
|
||||
From: Hannes von Haugwitz <hannes@vonhaugwitz.com>
|
||||
Date: Sat, 9 Jul 2022 23:06:36 +0200
|
||||
Subject: [PATCH] Use signal-safe write function in signal handler
|
||||
|
||||
* closes: #100
|
||||
---
|
||||
src/aide.c | 20 +++---
|
||||
1 files changed, 12 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/aide.c b/src/aide.c
|
||||
index 30e2942..e935794 100644
|
||||
--- a/src/aide.c
|
||||
+++ b/src/aide.c
|
||||
@@ -103,33 +103,37 @@ static void init_sighandler()
|
||||
|
||||
static void sig_handler(int signum)
|
||||
{
|
||||
+ char *str;
|
||||
switch(signum){
|
||||
case SIGBUS : {
|
||||
if(conf->catch_mmap==1){
|
||||
- log_msg(LOG_LEVEL_NOTICE, "Caught SIGBUS while mmapping. File was truncated while aide was running?");
|
||||
+ str = "Caught SIGBUS while mmapping. File was truncated while aide was running?\n";
|
||||
+ write(STDERR_FILENO ,str, strlen(str));
|
||||
conf->catch_mmap=0;
|
||||
} else {
|
||||
- log_msg(LOG_LEVEL_ERROR, "Caught SIGBUS. Exiting");
|
||||
+ str = "Caught SIGBUS. Exiting\n";
|
||||
+ write(STDERR_FILENO ,str, strlen(str));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SIGHUP : {
|
||||
- log_msg(LOG_LEVEL_INFO, "Caught SIGHUP");
|
||||
+ str = "Caught SIGHUP. Ignoring\n";
|
||||
+ write(STDERR_FILENO ,str, strlen(str));
|
||||
break;
|
||||
}
|
||||
case SIGTERM : {
|
||||
- log_msg(LOG_LEVEL_INFO, "Caught SIGTERM. Use SIGKILL to terminate");
|
||||
+ str = "Caught SIGTERM. Use SIGKILL to terminate\n";
|
||||
+ write(STDERR_FILENO ,str, strlen(str));
|
||||
break;
|
||||
}
|
||||
case SIGUSR1 : {
|
||||
- log_msg(LOG_LEVEL_INFO, "Caught SIGUSR1, toggle debug level: set log level to %s", get_log_level_name(toogle_log_level(LOG_LEVEL_DEBUG)));
|
||||
+ str = "Caught SIGUSR1, toggle debug level\n";
|
||||
+ write(STDERR_FILENO ,str, strlen(str));
|
||||
+ toogle_log_level(LOG_LEVEL_DEBUG);
|
||||
break;
|
||||
}
|
||||
}
|
||||
- init_sighandler();
|
||||
-
|
||||
- return;
|
||||
}
|
||||
|
||||
static void print_version(void)
|
||||
--
|
||||
2.33.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user