chore: typos and miscellanea

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato
2019-09-16 21:26:59 +00:00
committed by Leo Di Donato
parent c96f096821
commit 836094b28e
6 changed files with 7 additions and 15 deletions

View File

@@ -267,7 +267,6 @@ int falco_formats::format_event (lua_State *ls)
} }
int falco_formats::resolve_tokens(lua_State *ls) int falco_formats::resolve_tokens(lua_State *ls)
{ {
if (!lua_isstring(ls, -1) || if (!lua_isstring(ls, -1) ||
@@ -275,12 +274,10 @@ int falco_formats::resolve_tokens(lua_State *ls)
lua_pushstring(ls, "Invalid arguments passed to resolve_tokens()"); lua_pushstring(ls, "Invalid arguments passed to resolve_tokens()");
lua_error(ls); lua_error(ls);
} }
gen_event* evt = (gen_event*)lua_topointer(ls, 1); gen_event* evt = (gen_event*) lua_topointer(ls, 1);
const char *source = (char *) lua_tostring(ls, 2); // TODO(fntlnz, leodido): do we need this one? const char *format = (char *) lua_tostring(ls, 2);
const char *format = (char *) lua_tostring(ls, 3);
string sformat = format; string sformat = format;
map<string,string> values; map<string,string> values;
s_formatters->resolve_tokens((sinsp_evt *)evt, sformat, values); s_formatters->resolve_tokens((sinsp_evt *)evt, sformat, values);

View File

@@ -34,7 +34,6 @@ limitations under the License.
#include <unistd.h> #include <unistd.h>
#include <getopt.h> #include <getopt.h>
#include <sinsp.h> #include <sinsp.h>
#include "logger.h" #include "logger.h"
@@ -279,7 +278,7 @@ uint64_t do_inspect(falco_engine *engine,
} }
else if (g_restart) else if (g_restart)
{ {
falco_logger::log(LOG_INFO, "SIGHUP Received, restarting...\n"); falco_logger::log(LOG_INFO, "SIGHUP received, restarting...\n");
break; break;
} }
else if(rc == SCAP_TIMEOUT) else if(rc == SCAP_TIMEOUT)
@@ -1239,7 +1238,8 @@ int falco_init(int argc, char **argv)
result = EXIT_FAILURE; result = EXIT_FAILURE;
webserver.stop(); webserver.stop();
if (grpc_server_thread.joinable()) { if(grpc_server_thread.joinable())
{
grpc_server.shutdown(); grpc_server.shutdown();
grpc_server_thread.join(); grpc_server_thread.join();
} }

View File

@@ -60,5 +60,3 @@ message response {
string output = 5; string output = 5;
map<string, string> output_fields = 6; map<string, string> output_fields = 6;
} }
// todo: investigate outputting tags

View File

@@ -303,7 +303,6 @@ int falco_outputs::handle_http(lua_State *ls)
return 1; return 1;
} }
// TODO(fntlnz, leodido): verify if this works with k8s_audit as source
int falco_outputs::handle_grpc(lua_State *ls) int falco_outputs::handle_grpc(lua_State *ls)
{ {
// check parameters // check parameters

View File

@@ -39,8 +39,6 @@ protected:
void subscribe(const stream_context& ctx, const request& req, response& res); void subscribe(const stream_context& ctx, const request& req, response& res);
private: private:
std::atomic<bool> m_stop{false}; std::atomic<bool> m_stop{false};
}; };

View File

@@ -170,7 +170,7 @@ function mod.http_reopen()
end end
function mod.grpc(event, rule, source, priority, priority_num, msg, format, options) function mod.grpc(event, rule, source, priority, priority_num, msg, format, options)
fields = formats.resolve_tokens(event, source, format) fields = formats.resolve_tokens(event, format)
c_outputs.handle_grpc(event, rule, source, priority, msg, fields, options) c_outputs.handle_grpc(event, rule, source, priority, msg, fields, options)
end end