eve: improve error handling for Rust loggers

Give useful warning message if Rust is not compiled in.
pull/3517/head
Victor Julien 7 years ago
parent 24b18e47bd
commit 57921d95d6

@ -662,6 +662,22 @@ static void RunModeInitializeEveOutput(ConfNode *conf, OutputCtx *parent_ctx)
/* Error is no registered loggers with this name
* were found .*/
if (!sub_count) {
#ifndef HAVE_RUST
const char *rust_types[] = { "eve-log.smb", "eve-log.nfs",
"eve-log.dhcp", "eve-log.krb5", "eve-log.ikev2",
"eve-log.tftp", NULL, };
const char **iter = rust_types;
bool is_rust = false;
while (*iter) {
is_rust |= (strcmp(*iter, subname) == 0);
iter++;
}
if (is_rust) {
SCLogWarning(SC_WARN_RUST_NOT_AVAILABLE, "output "
"module '%s' depends on Rust support", subname);
continue;
}
#endif
FatalErrorOnInit(SC_ERR_INVALID_ARGUMENT,
"No output module named %s", subname);
continue;

@ -356,6 +356,7 @@ const char * SCErrorToString(SCError err)
CASE_CODE (SC_ERR_WINDIVERT_NOSUPPORT);
CASE_CODE (SC_ERR_WINDIVERT_INVALID_FILTER);
CASE_CODE (SC_ERR_WINDIVERT_TOOLONG_FILTER);
CASE_CODE (SC_WARN_RUST_NOT_AVAILABLE);
CASE_CODE (SC_ERR_MAX);
}

@ -346,6 +346,7 @@ typedef enum {
SC_ERR_WINDIVERT_NOSUPPORT,
SC_ERR_WINDIVERT_INVALID_FILTER,
SC_ERR_WINDIVERT_TOOLONG_FILTER,
SC_WARN_RUST_NOT_AVAILABLE,
SC_ERR_MAX,
} SCError;

Loading…
Cancel
Save