Skip to content

Commit

Permalink
Replicates CREATEMODE patch to the secondary auditlog file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Felipe Zimmerle committed Jan 26, 2016
1 parent b175c5c commit 0db247f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apache2/apache2_config.c
Expand Up @@ -1234,9 +1234,12 @@ static const char *cmd_audit_log2(cmd_parms *cmd, void *_dcfg, const char *p1)
const char *file_name = ap_server_root_relative(cmd->pool, dcfg->auditlog2_name);
apr_status_t rc;

if (dcfg->auditlog_fileperms == NOT_SET) {
dcfg->auditlog_fileperms = CREATEMODE;
}
rc = apr_file_open(&dcfg->auditlog2_fd, file_name,
APR_WRITE | APR_APPEND | APR_CREATE | APR_BINARY,
CREATEMODE, cmd->pool);
dcfg->auditlog_fileperms, cmd->pool);

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

0 comments on commit 0db247f

Please sign in to comment.