From 40bbf96f22ef4edb81cc613fa5db43335ad2701d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 20 Nov 2012 15:40:15 +0100 Subject: [PATCH] reputation: don't give error if config is missing/commented out --- src/reputation.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/reputation.c b/src/reputation.c index 5941ae8274..02e41b14a0 100644 --- a/src/reputation.c +++ b/src/reputation.c @@ -419,20 +419,25 @@ int SRepInit(DetectEngineCtx *de_ctx) { init = 1; } - if (init) { - if (ConfGet("reputation-categories-file", &filename) != 1) { - SCLogError(SC_ERR_NO_REPUTATION, "\"reputation-categories-file\" not set"); - return -1; - } + /* if both settings are missing, we assume the user doesn't want ip rep */ + (void)ConfGet("reputation-categories-file", &filename); + files = ConfGetNode("reputation-files"); + if (filename == NULL && files == NULL) { + SCLogInfo("IP reputation disabled"); + return 0; } - files = ConfGetNode("reputation-files"); if (files == NULL) { SCLogError(SC_ERR_NO_REPUTATION, "\"reputation-files\" not set"); return -1; } 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 * have a live reload, we have inited the cats */ if (SRepLoadCatFile(filename) < 0) {