[Fix #2630] Remove 'definition' TablePlugin action (#2633)

This commit is contained in:
Teddy Reed 2016-10-18 00:15:38 -07:00 committed by GitHub
parent 0003e72c63
commit ab57130178
2 changed files with 8 additions and 10 deletions

View File

@ -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"));
}

View File

@ -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());
}
}
}