Skip to content

Commit 0db247f

Browse files
author
Felipe Zimmerle
committed
Replicates CREATEMODE patch to the secondary auditlog file
At patch 45805be, @littlecho changed the behaviour to set the audit log index/serial file permission. Before, it was using the default permission now it is respecting the permission configured via SecAuditLogFileMode. This patch replicates @littlecho's work to the secundary auditlog file.
1 parent b175c5c commit 0db247f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apache2/apache2_config.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,9 +1234,12 @@ static const char *cmd_audit_log2(cmd_parms *cmd, void *_dcfg, const char *p1)
12341234
const char *file_name = ap_server_root_relative(cmd->pool, dcfg->auditlog2_name);
12351235
apr_status_t rc;
12361236

1237+
if (dcfg->auditlog_fileperms == NOT_SET) {
1238+
dcfg->auditlog_fileperms = CREATEMODE;
1239+
}
12371240
rc = apr_file_open(&dcfg->auditlog2_fd, file_name,
12381241
APR_WRITE | APR_APPEND | APR_CREATE | APR_BINARY,
1239-
CREATEMODE, cmd->pool);
1242+
dcfg->auditlog_fileperms, cmd->pool);
12401243

12411244
if (rc != APR_SUCCESS) {
12421245
return apr_psprintf(cmd->pool, "ModSecurity: Failed to open the secondary audit log file: %s",

0 commit comments

Comments
 (0)