Add option to change supervised node's working directory

This commit is contained in:
Jon Siwek 2020-01-06 18:39:14 -08:00
parent 8aa77436f9
commit aaa702fb4d
4 changed files with 36 additions and 4 deletions

View file

@ -800,6 +800,18 @@ int main(int argc, char** argv)
exit(1);
}
}
if ( zeek::supervised_node->directory )
{
if ( chdir(zeek::supervised_node->directory->data()) )
{
fprintf(stderr, "supervised node %s failed to chdir to %s: %s\n",
node_name.data(),
zeek::supervised_node->directory->data(),
strerror(errno));
exit(1);
}
}
}
std::set_new_handler(bro_new_handler);