Skip to content

Commit

Permalink
udpate(cmake): bump libs to 68a96aa5b7e34d7893563ded8c3d95bb3e77785f
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Dec 1, 2023
1 parent bca9a6f commit c3dbae6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/driver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ else()
# In case you want to test against another driver version (or branch, or commit) just pass the variable -
# ie., `cmake -DDRIVER_VERSION=dev ..`
if(NOT DRIVER_VERSION)
set(DRIVER_VERSION "ace53901af1aae25365b1302c0fa7c7ed69821ea")
set(DRIVER_CHECKSUM "SHA256=80e04cc3400b3b8e22bddad6b663adff311ab51a19b04baee1e49b06d3860c00")
set(DRIVER_VERSION "68a96aa5b7e34d7893563ded8c3d95bb3e77785f")
set(DRIVER_CHECKSUM "SHA256=74261bce85954bc1d86fef00710c8bb7cb0d7b2b7a074815e38c7517c21a1207")
endif()

# cd /path/to/build && cmake /path/to/source
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/falcosecurity-libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ else()
# In case you want to test against another falcosecurity/libs version (or branch, or commit) just pass the variable -
# ie., `cmake -DFALCOSECURITY_LIBS_VERSION=dev ..`
if(NOT FALCOSECURITY_LIBS_VERSION)
set(FALCOSECURITY_LIBS_VERSION "ace53901af1aae25365b1302c0fa7c7ed69821ea")
set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=80e04cc3400b3b8e22bddad6b663adff311ab51a19b04baee1e49b06d3860c00")
set(FALCOSECURITY_LIBS_VERSION "68a96aa5b7e34d7893563ded8c3d95bb3e77785f")
set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=74261bce85954bc1d86fef00710c8bb7cb0d7b2b7a074815e38c7517c21a1207")
endif()

# cd /path/to/build && cmake /path/to/source
Expand Down
2 changes: 1 addition & 1 deletion userspace/sinspui/cursescomponents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const char* spy_text_renderer::process_event_spy(sinsp_evt* evt, int64_t* len)
//
// Get and validate the length
//
sinsp_evt_param* parinfo = evt->get_param(0);
const sinsp_evt_param* parinfo = evt->get_param(0);
ASSERT(parinfo->m_len == sizeof(int64_t));
*len = *(int64_t*)parinfo->m_val;
if(*len <= 0)
Expand Down
4 changes: 2 additions & 2 deletions userspace/sysdig/sysdig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,13 +866,13 @@ captureinfo do_inspect(sinsp* inspector,

if(etype == PPME_GENERIC_E)
{
sinsp_evt_param *parinfo = ev->get_param(0);
const sinsp_evt_param *parinfo = ev->get_param(0);
uint16_t id = *(int16_t *)parinfo->m_val;
summary_table[PPM_EVENT_MAX + id * 2].m_ncalls++;
}
else if(etype == PPME_GENERIC_X)
{
sinsp_evt_param *parinfo = ev->get_param(0);
const sinsp_evt_param *parinfo = ev->get_param(0);
uint16_t id = *(int16_t *)parinfo->m_val;
summary_table[PPM_EVENT_MAX + id * 2 + 1].m_ncalls++;
}
Expand Down
68 changes: 34 additions & 34 deletions userspace/sysdig/utils/plugin_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
#include <unordered_set>

#include <utility>
#include <tinydir.h>
#include <filesystem>
#include <yaml-cpp/yaml.h>
#include <nlohmann/json.hpp>

Expand Down Expand Up @@ -96,38 +96,31 @@ namespace YAML {

static bool iterate_plugins_dirs(
const std::vector<std::string>& dirs,
const std::function<bool(const tinydir_file &)>& predicate)
const std::function<bool(const std::filesystem::path &)>& predicate)
{
bool breakout = false;
for (const auto & plugin_dir : dirs)
{
if (plugin_dir.empty())
std::filesystem::path dir = plugin_dir;

if (!std::filesystem::exists(dir) || !std::filesystem::is_directory(dir))
{
continue;
}

tinydir_dir dir = {};

for (tinydir_open(&dir, plugin_dir.c_str()); dir.has_next && !breakout; tinydir_next(&dir))
{
tinydir_file file;
tinydir_readfile(&dir, &file);

auto namelen = strlen(file.name);
auto extlen = strlen(SHAREDOBJ_EXT);
if (file.is_dir
|| strcmp(file.name, ".") == 0
|| strcmp(file.name, "..") == 0
|| (namelen > extlen
&& strcmp(file.name + namelen -extlen, SHAREDOBJ_EXT) != 0))
{
continue;
}

breakout = predicate(file);
}
for (const auto &file : std::filesystem::directory_iterator(dir))
{
if (!std::filesystem::is_directory(file)
&& file.path().extension() == SHAREDOBJ_EXT)
{
breakout = predicate(file);
}
else
{
continue;
}
}

tinydir_close(&dir);
if (breakout)
{
break;
Expand Down Expand Up @@ -308,16 +301,20 @@ void plugin_utils::load_plugin(sinsp *inspector, const std::string& name)
soname = SHAREDOBJ_PREFIX + name + SHAREDOBJ_EXT;
}
auto& plugins = m_plugins;
bool found = iterate_plugins_dirs(m_dirs, [&inspector, &name, &soname, &plugins] (const tinydir_file file) -> bool {
if (file.name == name || file.name == soname)
bool found = iterate_plugins_dirs(m_dirs, [&inspector, &name, &soname, &plugins] (const std::filesystem::path file) -> bool {

auto filename = file.filename();
auto filepath = std::filesystem::absolute(file);

if (filename == name || filename == soname)
{
plugin_entry p;
p.used = true;
p.inited = false;
p.libpath = file.path;
p.libpath = filepath;
p.names.insert(soname);
p.names.insert(file.path);
p.names.insert(file.name);
p.names.insert(filepath);
p.names.insert(filename);
p.names.insert(p.get_plugin(inspector)->name());
plugins.push_back(p);
return true; // break-out
Expand All @@ -334,17 +331,20 @@ void plugin_utils::read_plugins_from_dirs(sinsp *inspector)
{
auto& plugins = m_plugins;
auto tmpinsp = std::unique_ptr<sinsp>(new sinsp());
iterate_plugins_dirs(m_dirs, [&inspector, &plugins, &tmpinsp] (const tinydir_file file) -> bool {
iterate_plugins_dirs(m_dirs, [&inspector, &plugins, &tmpinsp] (const std::filesystem::path file) -> bool {

auto filepath = std::filesystem::absolute(file);

// we temporarily load the plugin just to read its info,
// but we don't actually load it in our inspector
auto plugin = tmpinsp->register_plugin(file.path);
auto plugin = tmpinsp->register_plugin(filepath);

plugin_entry p;
p.used = false;
p.inited = false;
p.libpath = file.path;
p.names.insert(file.path);
p.names.insert(file.name);
p.libpath = filepath;
p.names.insert(filepath);
p.names.insert(file.filename());
p.names.insert(plugin->name());
plugins.push_back(p);
return false;
Expand Down

0 comments on commit c3dbae6

Please sign in to comment.