From: Victor Julien Date: Thu, 22 Dec 2016 11:48:59 +0000 (+0100) Subject: ssh: remove single logger limit X-Git-Tag: suricata-4.0.0-beta1~351 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c412352474e64b6e5ea4eb3d9d413ab54e44ae26;p=thirdparty%2Fsuricata.git ssh: remove single logger limit --- diff --git a/src/output-json-ssh.c b/src/output-json-ssh.c index 6d356a0024..db3c8ed028 100644 --- a/src/output-json-ssh.c +++ b/src/output-json-ssh.c @@ -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; diff --git a/src/output.c b/src/output.c index befdc58d2a..7c8c5aaca0 100644 --- a/src/output.c +++ b/src/output.c @@ -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. * diff --git a/src/output.h b/src/output.h index 32004a6969..59469f4ae6 100644 --- a/src/output.h +++ b/src/output.h @@ -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);