mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
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.
This commit is contained in:
parent
35fbc76ecc
commit
b175c5cf60
@ -1192,10 +1192,13 @@ static const char *cmd_audit_log(cmd_parms *cmd, void *_dcfg, const char *p1)
|
||||
else {
|
||||
const char *file_name = ap_server_root_relative(cmd->pool, dcfg->auditlog_name);
|
||||
apr_status_t rc;
|
||||
|
||||
|
||||
if (dcfg->auditlog_fileperms == NOT_SET) {
|
||||
dcfg->auditlog_fileperms = CREATEMODE;
|
||||
}
|
||||
rc = apr_file_open(&dcfg->auditlog_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 audit log file: %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user