Merge pull request #2958 from marcstern/v2/mst/rc_check

Check return code of apr_procattr_io_set()
This commit is contained in:
martinhsv
2023-09-11 11:01:10 -04:00
committed by GitHub

View File

@@ -99,7 +99,12 @@ int apache2_exec(modsec_rec *msr, const char *command, const char **argv, char *
return -1; return -1;
} }
apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE); rc = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_FULL_BLOCK, APR_NO_PIPE);
if (rc != APR_SUCCESS) {
msr_log(msr, 1, "Exec: apr_procattr_io_set failed: %d (%s)", rc, get_apr_error(r->pool, rc));
return -1;
}
apr_procattr_cmdtype_set(procattr, APR_SHELLCMD); apr_procattr_cmdtype_set(procattr, APR_SHELLCMD);
if (msr->txcfg->debuglog_level >= 9) { if (msr->txcfg->debuglog_level >= 9) {