Fix regression in calling core only plugins from extensions (#5875)

PR osquery/osquery#5464 makes it impossible to call plugins
which are only registered in the core, as its happening with osquery/osquery#5839.

What happens when this is working is that the filesystem plugin is not present
in the extension registry, so when Registry::call tries to search for a plugin
that provides the "config" feature, it won't find one and the resulting plugin name,
and later item_name, will be empty.

This results in the RegistryInterface::call reroute the call to the core,
through Thrift, which will end up in the plugin correctly answering.
This commit is contained in:
Stefano Bonicatti 2019-10-12 02:15:19 +02:00 committed by Teddy Reed
parent 7d1d486c1e
commit e1dca49663

View File

@ -126,9 +126,6 @@ RegistryRoutes RegistryInterface::getRoutes() const {
Status RegistryInterface::call(const std::string& item_name,
const PluginRequest& request,
PluginResponse& response) {
if (item_name.empty()) {
return Status::failure("No registry item name specified");
}
PluginRef plugin;
{
ReadLock lock(mutex_);