From 2eb14e83db00037a52d1407e9587d75da5e76117 Mon Sep 17 00:00:00 2001 From: Leonardo Grasso Date: Tue, 20 Oct 2020 15:41:57 +0200 Subject: [PATCH] chore(userspace/falco): output class does not need to inherit from falco_common Signed-off-by: Leonardo Grasso --- userspace/falco/event_drops.cpp | 5 +++-- userspace/falco/falco.cpp | 1 - userspace/falco/falco_outputs.cpp | 6 ------ userspace/falco/falco_outputs.h | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/userspace/falco/event_drops.cpp b/userspace/falco/event_drops.cpp index 262d493e980..4b6d9c8606e 100644 --- a/userspace/falco/event_drops.cpp +++ b/userspace/falco/event_drops.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 2019 The Falco Authors. +Copyright (C) 2020 The Falco Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ limitations under the License. */ #include "event_drops.h" +#include "falco_common.h" #include "banned.h" // This raises a compilation error when certain functions are used syscall_evt_drop_mgr::syscall_evt_drop_mgr(): @@ -137,7 +138,7 @@ bool syscall_evt_drop_mgr::perform_actions(uint64_t now, scap_stats &delta, bool case ACT_ALERT: m_outputs->handle_msg(now, - falco_outputs::PRIORITY_CRITICAL, + falco_common::PRIORITY_CRITICAL, msg, rule, output_fields); diff --git a/userspace/falco/falco.cpp b/userspace/falco/falco.cpp index fb1b5ddf0f9..3dccd7728d0 100644 --- a/userspace/falco/falco.cpp +++ b/userspace/falco/falco.cpp @@ -763,7 +763,6 @@ int falco_init(int argc, char **argv) } outputs = new falco_outputs(); - outputs->set_inspector(inspector); // Some combinations of arguments are not allowed. if (daemon && pidfilename == "") { diff --git a/userspace/falco/falco_outputs.cpp b/userspace/falco/falco_outputs.cpp index 0828f4309f8..3f02cbbcfae 100644 --- a/userspace/falco/falco_outputs.cpp +++ b/userspace/falco/falco_outputs.cpp @@ -63,12 +63,6 @@ void falco_outputs::init(bool json_output, uint32_t rate, uint32_t max_burst, bool buffered, bool time_format_iso_8601, string hostname) { - // The engine must have been given an inspector by now. - if(!m_inspector) - { - throw falco_exception("No inspector provided"); - } - m_json_output = json_output; // Note that falco_formats is already initialized by the engine, diff --git a/userspace/falco/falco_outputs.h b/userspace/falco/falco_outputs.h index 1587299112b..222a8fbd7ba 100644 --- a/userspace/falco/falco_outputs.h +++ b/userspace/falco/falco_outputs.h @@ -31,7 +31,7 @@ limitations under the License. // falco output engine. The falco rules engine is implemented by a // separate class falco_engine. // -class falco_outputs : public falco_common +class falco_outputs { public: falco_outputs();