Blame SOURCES/audit-2.8.4-close.patch
|
|
cae892 |
diff -urp audit-2.8.4.orig/src/auditd-event.c audit-2.8.4/src/auditd-event.c
|
|
|
cae892 |
--- audit-2.8.4.orig/src/auditd-event.c 2018-05-21 13:38:08.000000000 -0400
|
|
|
cae892 |
+++ audit-2.8.4/src/auditd-event.c 2018-06-26 09:13:40.898668045 -0400
|
|
|
cae892 |
@@ -119,7 +119,8 @@ void shutdown_events(void)
|
|
|
cae892 |
pthread_join(flush_thread, NULL);
|
|
|
cae892 |
|
|
|
cae892 |
free((void *)format_buf);
|
|
|
cae892 |
- fclose(log_file);
|
|
|
cae892 |
+ if (log_file)
|
|
|
cae892 |
+ fclose(log_file);
|
|
|
cae892 |
auparse_destroy_ext(NULL, AUPARSE_DESTROY_ALL);
|
|
|
cae892 |
}
|
|
|
cae892 |
|
|
|
cae892 |
@@ -156,6 +157,7 @@ int init_event(struct daemon_conf *conf)
|
|
|
cae892 |
if (format_buf == NULL) {
|
|
|
cae892 |
audit_msg(LOG_ERR, "No memory for formatting, exiting");
|
|
|
cae892 |
fclose(log_file);
|
|
|
cae892 |
+ log_file = NULL;
|
|
|
cae892 |
return 1;
|
|
|
cae892 |
}
|
|
|
cae892 |
init_flush_thread();
|
|
|
cae892 |
@@ -1003,6 +1005,7 @@ static void rotate_logs(unsigned int num
|
|
|
cae892 |
"rotating log file (%s)", strerror(errno));
|
|
|
cae892 |
}
|
|
|
cae892 |
fclose(log_file);
|
|
|
cae892 |
+ log_file = NULL;
|
|
|
cae892 |
|
|
|
cae892 |
/* Rotate */
|
|
|
cae892 |
len = strlen(config->log_file) + 16;
|
|
|
cae892 |
@@ -1455,6 +1458,7 @@ static void reconfigure(struct auditd_ev
|
|
|
cae892 |
|
|
|
cae892 |
if (need_reopen) {
|
|
|
cae892 |
fclose(log_file);
|
|
|
cae892 |
+ log_file = NULL;
|
|
|
cae892 |
fix_disk_permissions();
|
|
|
cae892 |
if (open_audit_log()) {
|
|
|
cae892 |
int saved_errno = errno;
|