mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
c7355b19aa
Summary: Pull Request resolved: https://github.com/facebook/osquery/pull/5452 As suggested in another diff, this diff updates the language we use to describe the osquery licensing terms. We are changing all instances of //This source code is licensed as defined on the LICENSE file found in the root directory of this source tree.// to //This source code is licensed in accordance with the terms specified in the LICENSE file found in the root directory of this source tree.// We accomplish this with a codemod: $ codemod -md xplat/osquery/oss --extensions cpp,h,in,py,sh,mm,ps1 "(.\s+)This source code is licensed as defined on the LICENSE file found in the(.*)root directory of this source tree\." "\1This source code is licensed in accordance with the terms specified in\2the LICENSE file found in the root directory of this source tree." Reviewed By: fmanco Differential Revision: D14131290 fbshipit-source-id: 52c90da342263e2a80f5a678ecd760c19cf7513e
39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
/**
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed in accordance with the terms specified in
|
|
* the LICENSE file found in the root directory of this source tree.
|
|
*/
|
|
|
|
#include <osquery/config/config.h>
|
|
#include <osquery/registry_factory.h>
|
|
|
|
namespace osquery {
|
|
|
|
/**
|
|
* @brief A special config plugin that updates an osquery core's config.
|
|
*
|
|
* Config plugins may asynchronously change config data for the core osquery
|
|
* process. This is a rare instance where a plugin acts to change core state.
|
|
* Plugins normally act on behalf of a registry or extension call.
|
|
* To achieve plugin-initiated calls, Config plugins chain calls to plugins
|
|
* using the UpdateConfigPlugin named 'update'.
|
|
*
|
|
* Plugins do not need to implement call-chaining explicitly. If an extension
|
|
* plugin implements an asynchronous feature it should call `Config::update`
|
|
* directly. The osquery config will check if the registry is external, meaning
|
|
* the config instance is running as an extension. If external, config will
|
|
* route the update request and the registry will send missing (in this case
|
|
* "config/update" is missing) requests to core.
|
|
*/
|
|
class UpdateConfigPlugin : public ConfigPlugin {
|
|
public:
|
|
Status genConfig(std::map<std::string, std::string>& config) {
|
|
return Status(0, "Unused");
|
|
}
|
|
};
|
|
|
|
REGISTER(UpdateConfigPlugin, "config", "update");
|
|
}
|