2017-12-19 00:04:06 +00:00
|
|
|
/**
|
2016-02-11 19:48:58 +00:00
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
2015-12-11 17:58:50 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2017-12-19 00:04:06 +00:00
|
|
|
* This source code is licensed under both the Apache 2.0 license (found in the
|
|
|
|
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
|
|
* in the COPYING file in the root directory of this source tree).
|
|
|
|
* You may select, at your option, one of the above-listed licenses.
|
2015-12-11 17:58:50 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-26 18:58:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-02-04 02:13:44 +00:00
|
|
|
#include <set>
|
2015-12-11 17:58:50 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <osquery/tables.h>
|
|
|
|
|
|
|
|
namespace osquery {
|
|
|
|
|
2016-02-04 02:13:44 +00:00
|
|
|
/// List of columns decorated for file events.
|
|
|
|
extern const std::set<std::string> kCommonFileColumns;
|
|
|
|
|
2015-12-11 17:58:50 +00:00
|
|
|
/**
|
|
|
|
* @brief A helper function for each platform's implementation of file_events.
|
|
|
|
*
|
|
|
|
* Given an action and path, this Row decorator assures a common implementation
|
|
|
|
* of hashing and common columns from the `file` table.
|
|
|
|
*
|
|
|
|
* @param path The target path from the file event.
|
|
|
|
* @param hash Should the target path be read and hashed.
|
|
|
|
* @param r The output parameter row structure.
|
|
|
|
*/
|
|
|
|
void decorateFileEvent(const std::string& path, bool hash, Row& r);
|
|
|
|
}
|