Bug #125 » 0001-Fix-bug-125.patch
| src/conf-yaml-loader.c | ||
|---|---|---|
|
while (!done) {
|
||
|
if (!yaml_parser_parse(parser, &event)) {
|
||
|
fprintf(stderr, "Failed to parse configuration file: %s\n",
|
||
|
parser->problem);
|
||
|
fprintf(stderr,
|
||
|
"Failed to parse configuration file at line %zu: %s\n",
|
||
|
parser->problem_mark.line, parser->problem);
|
||
|
return -1;
|
||
|
}
|
||
| ... | ... | |
|
seq_node->name = SCCalloc(1, DEFAULT_NAME_LEN);
|
||
|
snprintf(seq_node->name, DEFAULT_NAME_LEN, "%d", seq_idx++);
|
||
|
TAILQ_INSERT_TAIL(&node->head, seq_node, next);
|
||
|
ConfYamlParse(parser, seq_node, 0);
|
||
|
if (ConfYamlParse(parser, seq_node, 0) != 0)
|
||
|
goto fail;
|
||
|
}
|
||
|
else {
|
||
|
ConfYamlParse(parser, node, inseq);
|
||
|
if (ConfYamlParse(parser, node, inseq) != 0)
|
||
|
goto fail;
|
||
|
}
|
||
|
state = CONF_KEY;
|
||
|
}
|
||
| src/suricata.c | ||
|---|---|---|
|
/* Load yaml configuration file if provided. */
|
||
|
if (conf_filename != NULL) {
|
||
|
ConfYamlLoadFile(conf_filename);
|
||
|
if (ConfYamlLoadFile(conf_filename) != 0) {
|
||
|
/* Error already displayed. */
|
||
|
exit(EXIT_FAILURE);
|
||
|
}
|
||
|
} else if (run_mode != MODE_UNITTEST){
|
||
|
SCLogError(SC_ERR_OPENING_FILE, "Configuration file has not been provided");
|
||
|
usage(argv[0]);
|
||
- « Previous
- 1
- 2
- Next »