Bug #6 ยป 0001-added-display-sig-on-fail-long-opt-to-show-sigstr.patch
oisf.yaml | ||
---|---|---|
# Defaults to empty (no filter).
|
||
default-output-filter:
|
||
# Display sigs on parse failure
|
||
display-sig-on-fail: false
|
||
# Configure the outputs. If no outputs are specified the engine
|
||
# will log to the console with an error log level.
|
||
output:
|
src/detect-parse.c | ||
---|---|---|
#include "util-unittest.h"
|
||
#include "util-debug.h"
|
||
#include "conf.h"
|
||
static pcre *config_pcre = NULL;
|
||
static pcre *option_pcre = NULL;
|
||
... | ... | |
*/
|
||
Signature *SigInit(DetectEngineCtx *de_ctx, char *sigstr) {
|
||
Signature *sig = SigAlloc();
|
||
int val;
|
||
if (sig == NULL)
|
||
goto error;
|
||
... | ... | |
return sig;
|
||
error:
|
||
if(ConfGetBool("logging.display-sig-on-fail", &val) == 1)
|
||
SCLogInfo("SigInit: %s",sigstr);
|
||
SigFree(sig);
|
||
return NULL;
|
||
src/eidps.c | ||
---|---|---|
char *conf_filename = NULL;
|
||
char *regex_arg = NULL;
|
||
int dump_config = 0;
|
||
int display_sig_on_fail = 0;
|
||
/* initialize the logging subsys */
|
||
SCLogInitLogModule(NULL);
|
||
... | ... | |
{"pfring-int", required_argument, 0, 0},
|
||
{"pfring-clusterid", required_argument, 0, 0},
|
||
{"unittest-filter", required_argument, 0, 'U'},
|
||
{"display-sig-on-fail", 0, &display_sig_on_fail, 1},
|
||
{NULL, 0, NULL, 0}
|
||
};
|
||
... | ... | |
exit(EXIT_SUCCESS);
|
||
}
|
||
if(display_sig_on_fail) {
|
||
if (ConfSet("logging.display-sig-on-fail", "true", 0) != 1) {
|
||
fprintf(stderr, "ERROR: Failed to enable printing sigs on parse failure.\n");
|
||
exit(EXIT_FAILURE);
|
||
}
|
||
}
|
||
if (mode == MODE_UNKNOWN) {
|
||
usage(argv[0]);
|
||
exit(EXIT_FAILURE);
|