Add an internal getenv wrapper function: zeekenv

It maps newer environment variable names starting with ZEEK to the
legacy names starting with BRO.
This commit is contained in:
Jon Siwek 2019-05-23 20:40:03 -07:00
parent 580822a32c
commit 7f0fb49612
14 changed files with 82 additions and 81 deletions

View file

@ -16,7 +16,7 @@ export {
## Default address on which to listen.
##
## .. zeek:see:: Broker::listen
const default_listen_address = getenv("ZEEK_DEFAULT_LISTEN_ADDRESS") != "" ? getenv("ZEEK_DEFAULT_LISTEN_ADDRESS") : getenv("BRO_DEFAULT_LISTEN_ADDRESS") &redef;
const default_listen_address = getenv("ZEEK_DEFAULT_LISTEN_ADDRESS") &redef;
## Default interval to retry connecting to a peer if it cannot be made to
## work initially, or if it ever becomes disconnected. Use of the
@ -380,8 +380,6 @@ function listen(a: string, p: port, retry: interval): port
if ( bound == 0/tcp )
{
local e = getenv("ZEEK_DEFAULT_LISTEN_RETRY");
if ( e == "" )
e = getenv("BRO_DEFAULT_LISTEN_RETRY");
if ( e != "" )
retry = double_to_interval(to_double(e));

View file

@ -84,11 +84,7 @@ function default_rotation_postprocessor_func(info: Log::RotationInfo) : bool
local bls = getenv("ZEEK_LOG_SUFFIX");
if ( bls == "" )
{
bls = getenv("BRO_LOG_SUFFIX");
if ( bls == "" )
bls = "log";
}
bls = "log";
# Move file to name including both opening and closing time.
local dst = fmt("%s.%s.%s%s", info$path,