mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
parent
0003e72c63
commit
ab57130178
@ -125,10 +125,6 @@ Status TablePlugin::call(const PluginRequest& request,
|
||||
// The "columns" action returns a PluginRequest filled with column
|
||||
// information such as name and type.
|
||||
response = routeInfo();
|
||||
} else if (request.at("action") == "definition") {
|
||||
response.push_back({
|
||||
{"definition", columnDefinition()},
|
||||
});
|
||||
} else {
|
||||
return Status(1, "Unknown table plugin action: " + request.at("action"));
|
||||
}
|
||||
|
@ -1074,13 +1074,15 @@ inline void meta_schema(int nArg, char** azArg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
osquery::PluginRequest request = {{"action", "definition"}};
|
||||
osquery::PluginResponse response;
|
||||
osquery::Registry::call("table", table_name, request, response);
|
||||
fprintf(stdout,
|
||||
"CREATE TABLE %s%s;\n",
|
||||
table_name.c_str(),
|
||||
response[0].at("definition").c_str());
|
||||
auto status = osquery::Registry::call(
|
||||
"table", table_name, {{"action", "columns"}}, response);
|
||||
if (status.ok()) {
|
||||
fprintf(stdout,
|
||||
"CREATE TABLE %s%s;\n",
|
||||
table_name.c_str(),
|
||||
osquery::columnDefinition(response, true).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user