From f617f21cc0661a74e452d61d299742b4634eef99 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 13 Jul 2016 09:37:30 +0200 Subject: [PATCH] guardian.cgi: Prevent from using "syslog" and "debug". When using syslog as log facility and debug as log mode, syslog does not log anything. Signed-off-by: Stefan Schantl --- html/cgi-bin/guardian.cgi | 40 +++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/html/cgi-bin/guardian.cgi b/html/cgi-bin/guardian.cgi index b85691ba61..cbacdb5f58 100644 --- a/html/cgi-bin/guardian.cgi +++ b/html/cgi-bin/guardian.cgi @@ -421,23 +421,43 @@ sub showMainBox() { ### Java Script ### print< - var update_logfacility = function() { + var update_options = function() { var logfacility = \$("#GUARDIAN_LOG_FACILITY").val(); + var loglevel = \$("#GUARDIAN_LOGLEVEL").val(); if (logfacility === undefined) return; + if (loglevel === undefined) + return; + + // Show / Hide input for specifying the path to the logfile. if (logfacility === "file") { \$(".GUARDIAN_LOGFILE").show(); } else { \$(".GUARDIAN_LOGFILE").hide(); } + + // Show / Hide loglevel debug if the facility is set to syslog. + if (logfacility === "syslog") { + \$("#loglevel_debug").hide(); + } else { + \$("#loglevel_debug").show(); + } + + // Show / Hide logfacility syslog if the loglevel is set to debug. + if (loglevel === "debug") { + \$("#logfacility_syslog").hide(); + } else { + \$("#logfacility_syslog").show(); + } }; \$(document).ready(function() { - \$("#GUARDIAN_LOG_FACILITY").change(update_logfacility); - update_logfacility(); + \$("#GUARDIAN_LOG_FACILITY").change(update_options); + \$("#GUARDIAN_LOGLEVEL").change(update_options); + update_options(); // Show / Hide snort priority level option, based if // snort is enabled / disabled. @@ -552,9 +572,9 @@ END $Lang::tr{'guardian logfacility'}: @@ -562,10 +582,10 @@ END $Lang::tr{'guardian loglevel'}: - + + + -- 2.39.5