mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
setenv is not available in Windows build, replaced with _putenv_s
This commit is contained in:
parent
abbd7b2f42
commit
35949179a4
@ -37,7 +37,11 @@ bool SetENV::evaluate(RuleWithActions *rule, Transaction *t) {
|
|||||||
auto pair = utils::string::ssplit_pair(colNameExpanded, '=');
|
auto pair = utils::string::ssplit_pair(colNameExpanded, '=');
|
||||||
ms_dbg_a(t, 8, "Setting environment variable: "
|
ms_dbg_a(t, 8, "Setting environment variable: "
|
||||||
+ pair.first + " to " + pair.second);
|
+ pair.first + " to " + pair.second);
|
||||||
|
#ifndef WIN32
|
||||||
setenv(pair.first.c_str(), pair.second.c_str(), /*overwrite*/ 1);
|
setenv(pair.first.c_str(), pair.second.c_str(), /*overwrite*/ 1);
|
||||||
|
#else
|
||||||
|
_putenv_s(pair.first.c_str(), pair.second.c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user