Skip to content

Commit b175c5c

Browse files
littlechoFelipe Zimmerle
authored andcommitted
Update apache2_config.c
Change third parameter(which is the apr file permission flag) from CREATEMODE to dcfg->auditlog_fileperms. Due to the user can specify the desired file permission setting for the audit log files with setting the value of SecAuditLogFileMode, we should follow the file permission setting from the config file. Therefore, as the dcfg->auditlog_fileperms will be modified in cmd_audit_log_dirmode function, we can use the value while calling apr_file_open to meet the file permission that specified in modsecurity.conf.
1 parent 35fbc76 commit b175c5c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apache2/apache2_config.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,10 +1192,13 @@ static const char *cmd_audit_log(cmd_parms *cmd, void *_dcfg, const char *p1)
11921192
else {
11931193
const char *file_name = ap_server_root_relative(cmd->pool, dcfg->auditlog_name);
11941194
apr_status_t rc;
1195-
1195+
1196+
if (dcfg->auditlog_fileperms == NOT_SET) {
1197+
dcfg->auditlog_fileperms = CREATEMODE;
1198+
}
11961199
rc = apr_file_open(&dcfg->auditlog_fd, file_name,
11971200
APR_WRITE | APR_APPEND | APR_CREATE | APR_BINARY,
1198-
CREATEMODE, cmd->pool);
1201+
dcfg->auditlog_fileperms, cmd->pool);
11991202

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

0 commit comments

Comments
 (0)