mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fixed issue where the exec action may not be able to execute shell scripts. See #475.
This commit is contained in:
parent
c50e5b0b38
commit
563a8e0f0c
4
CHANGES
4
CHANGES
@ -1,10 +1,12 @@
|
|||||||
02 Apr 2008 - trunk
|
11 Apr 2008 - trunk
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
* Allow HTTP_* targets as an alias for REQUEST_HEADERS:*.
|
* Allow HTTP_* targets as an alias for REQUEST_HEADERS:*.
|
||||||
|
|
||||||
* Make sure temporary filehandles are closed after a transaction.
|
* Make sure temporary filehandles are closed after a transaction.
|
||||||
|
|
||||||
|
* Fixed issue where the exec action may not be able to execute shell scripts.
|
||||||
|
|
||||||
|
|
||||||
14 Mar 2008 - 2.5.1
|
14 Mar 2008 - 2.5.1
|
||||||
-------------------
|
-------------------
|
||||||
|
@ -103,7 +103,9 @@ int apache2_exec(modsec_rec *msr, const char *command, const char **argv, char *
|
|||||||
}
|
}
|
||||||
|
|
||||||
apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE);
|
apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE);
|
||||||
|
apr_procattr_cmdtype_set(procattr, APR_SHELLCMD);
|
||||||
|
|
||||||
|
msr_log(msr, 9, "Exec: %s", log_escape_nq(r->pool, command));
|
||||||
rc = apr_proc_create(procnew, command, argv, env, procattr, r->pool);
|
rc = apr_proc_create(procnew, command, argv, env, procattr, r->pool);
|
||||||
if (rc != APR_SUCCESS) {
|
if (rc != APR_SUCCESS) {
|
||||||
msr_log(msr, 1, "Exec: Execution failed: %s (%s)", log_escape_nq(r->pool, command),
|
msr_log(msr, 1, "Exec: Execution failed: %s (%s)", log_escape_nq(r->pool, command),
|
||||||
@ -147,7 +149,8 @@ int apache2_exec(modsec_rec *msr, const char *command, const char **argv, char *
|
|||||||
nbytes = 255;
|
nbytes = 255;
|
||||||
while(apr_file_read(script_out, buf, &nbytes) == APR_SUCCESS) nbytes = 255;
|
while(apr_file_read(script_out, buf, &nbytes) == APR_SUCCESS) nbytes = 255;
|
||||||
} else {
|
} else {
|
||||||
msr_log(msr, 1, "Exec: Execution failed: %s (%s)", log_escape_nq(r->pool, command),
|
msr_log(msr, 1, "Exec: Execution failed while reading output: %s (%s)",
|
||||||
|
log_escape_nq(r->pool, command),
|
||||||
get_apr_error(r->pool, rc2));
|
get_apr_error(r->pool, rc2));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user