]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ssh: remove single logger limit
authorVictor Julien <victor@inliniac.net>
Thu, 22 Dec 2016 11:48:59 +0000 (12:48 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:42 +0000 (10:35 +0100)
src/output-json-ssh.c
src/output.c
src/output.h

index 6d356a0024b39f6540544f5581e5948ab029c385..db3c8ed0283e4f40549084361532459a50e83fa6 100644 (file)
@@ -173,8 +173,6 @@ static TmEcode JsonSshLogThreadDeinit(ThreadVars *t, void *data)
 
 static void OutputSshLogDeinit(OutputCtx *output_ctx)
 {
-    OutputSshLoggerDisable();
-
     OutputSshCtx *ssh_ctx = output_ctx->data;
     LogFileCtx *logfile_ctx = ssh_ctx->file_ctx;
     LogFileFreeCtx(logfile_ctx);
@@ -185,12 +183,6 @@ static void OutputSshLogDeinit(OutputCtx *output_ctx)
 #define DEFAULT_LOG_FILENAME "ssh.json"
 OutputCtx *OutputSshLogInit(ConfNode *conf)
 {
-    if (OutputSshLoggerEnable() != 0) {
-        SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'ssh' logger "
-            "can be enabled");
-        return NULL;
-    }
-
     LogFileCtx *file_ctx = LogFileNewCtx();
     if(file_ctx == NULL) {
         SCLogError(SC_ERR_SSH_LOG_GENERIC, "couldn't create new file_ctx");
@@ -226,8 +218,6 @@ OutputCtx *OutputSshLogInit(ConfNode *conf)
 
 static void OutputSshLogDeinitSub(OutputCtx *output_ctx)
 {
-    OutputSshLoggerDisable();
-
     OutputSshCtx *ssh_ctx = output_ctx->data;
     SCFree(ssh_ctx);
     SCFree(output_ctx);
@@ -237,12 +227,6 @@ OutputCtx *OutputSshLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
 {
     OutputJsonCtx *ojc = parent_ctx->data;
 
-    if (OutputSshLoggerEnable() != 0) {
-        SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'ssh' logger "
-            "can be enabled");
-        return NULL;
-    }
-
     OutputSshCtx *ssh_ctx = SCMalloc(sizeof(OutputSshCtx));
     if (unlikely(ssh_ctx == NULL))
         return NULL;
index befdc58d2a37b87000075ff4cf893bd43b35e6d7..7c8c5aaca0e73fb0893eba310193c3d6800c5612 100644 (file)
@@ -849,22 +849,6 @@ void OutputDropLoggerDisable(void)
         drop_loggers--;
 }
 
-static int ssh_loggers = 0;
-
-int OutputSshLoggerEnable(void)
-{
-    if (ssh_loggers)
-        return -1;
-    ssh_loggers++;
-    return 0;
-}
-
-void OutputSshLoggerDisable(void)
-{
-    if (ssh_loggers)
-        ssh_loggers--;
-}
-
 /**
  * \brief Register a flag for file rotation notification.
  *
index 32004a69691d1ada36932fcfc8d97f76de986ff0..59469f4ae653dbf1d3f088606f0fdc21bdcf9e3b 100644 (file)
@@ -184,9 +184,6 @@ void OutputDeregisterAll(void);
 int OutputDropLoggerEnable(void);
 void OutputDropLoggerDisable(void);
 
-int OutputSshLoggerEnable(void);
-void OutputSshLoggerDisable(void);
-
 void OutputRegisterFileRotationFlag(int *flag);
 void OutputUnregisterFileRotationFlag(int *flag);
 void OutputNotifyFileRotation(void);