reputation: don't give error if config is missing/commented out

pull/217/head
Victor Julien 13 years ago
parent 0f42f0e890
commit 40bbf96f22

@ -419,20 +419,25 @@ int SRepInit(DetectEngineCtx *de_ctx) {
init = 1; init = 1;
} }
if (init) { /* if both settings are missing, we assume the user doesn't want ip rep */
if (ConfGet("reputation-categories-file", &filename) != 1) { (void)ConfGet("reputation-categories-file", &filename);
SCLogError(SC_ERR_NO_REPUTATION, "\"reputation-categories-file\" not set"); files = ConfGetNode("reputation-files");
return -1; if (filename == NULL && files == NULL) {
} SCLogInfo("IP reputation disabled");
return 0;
} }
files = ConfGetNode("reputation-files");
if (files == NULL) { if (files == NULL) {
SCLogError(SC_ERR_NO_REPUTATION, "\"reputation-files\" not set"); SCLogError(SC_ERR_NO_REPUTATION, "\"reputation-files\" not set");
return -1; return -1;
} }
if (init) { if (init) {
if (filename == NULL) {
SCLogError(SC_ERR_NO_REPUTATION, "\"reputation-categories-file\" not set");
return -1;
}
/* init even if we have reputation files, so that when we /* init even if we have reputation files, so that when we
* have a live reload, we have inited the cats */ * have a live reload, we have inited the cats */
if (SRepLoadCatFile(filename) < 0) { if (SRepLoadCatFile(filename) < 0) {

Loading…
Cancel
Save