From ac8100aefb2faf90d0b5fcf64784dd05eb88733b Mon Sep 17 00:00:00 2001 From: Evgeny Kolesnikov Date: Fri, 1 Sep 2023 12:30:36 +0200 Subject: [PATCH] Test SCE load (remove) --- src/SCE/CMakeLists.txt | 2 +- src/XCCDF_POLICY/check_engine_plugin.c | 6 +++++- tests/sce/test_sce.sh | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SCE/CMakeLists.txt b/src/SCE/CMakeLists.txt index f704b91883..2704a4c09d 100644 --- a/src/SCE/CMakeLists.txt +++ b/src/SCE/CMakeLists.txt @@ -8,7 +8,7 @@ add_library(openscap_sce SHARED "${CMAKE_SOURCE_DIR}/src/common/list.c" "${CMAKE_SOURCE_DIR}/src/common/oscap_string.c" "${CMAKE_SOURCE_DIR}/src/common/oscap_buffer.c" - "${CMAKE_SOURCE_DIR}/src/common/oscap_pcre.c" +# "${CMAKE_SOURCE_DIR}/src/common/oscap_pcre.c" "${CMAKE_SOURCE_DIR}/src/common/util.c" ) target_include_directories(openscap_sce PUBLIC public) diff --git a/src/XCCDF_POLICY/check_engine_plugin.c b/src/XCCDF_POLICY/check_engine_plugin.c index 7483d1cd13..4d3046d7b7 100644 --- a/src/XCCDF_POLICY/check_engine_plugin.c +++ b/src/XCCDF_POLICY/check_engine_plugin.c @@ -28,6 +28,8 @@ #include "oscap_helpers.h" #include "common/_error.h" +#include "debug_priv.h" + #ifndef OS_WINDOWS #include #endif @@ -56,6 +58,7 @@ struct check_engine_plugin_def *check_engine_plugin_load2(const char* path, bool const char *path_prefix = getenv("OSCAP_CHECK_ENGINE_PLUGIN_DIR"); char *full_path = path_prefix ? oscap_sprintf("%s/%s", path_prefix, path) : oscap_strdup(path); + dD("SCE plugin path: %s", full_path); // NB: valgrind reports a leak on the next line, I have confirmed this to be a false positive ret->module_handle = dlopen(full_path, RTLD_LAZY); free(full_path); @@ -63,7 +66,7 @@ struct check_engine_plugin_def *check_engine_plugin_load2(const char* path, bool char *error = NULL; if (!ret->module_handle) { error = dlerror(); - + dD("SCE plugin load error (dlopen): %s", error); if (!quiet) oscap_seterr(OSCAP_EFAMILY_GLIBC, "Failed to load extra check engine from '%s'. Details: '%s'.", @@ -77,6 +80,7 @@ struct check_engine_plugin_def *check_engine_plugin_load2(const char* path, bool *(void **)(&entry_fn) = dlsym(ret->module_handle, STRINGIZE(OPENSCAP_CHECK_ENGINE_PLUGIN_ENTRY)); if ((error = dlerror()) != NULL) { + dD("SCE plugin load error (dlsym): %s", error); if (!quiet) oscap_seterr(OSCAP_EFAMILY_GLIBC, "Failed to retrieve module entry '%s' from loaded extra check engine '%s'. Details: '%s'.", diff --git a/tests/sce/test_sce.sh b/tests/sce/test_sce.sh index 836020041f..8fc132477a 100755 --- a/tests/sce/test_sce.sh +++ b/tests/sce/test_sce.sh @@ -6,7 +6,7 @@ . $builddir/tests/test_common.sh set -x -$OSCAP --version +LD_DEBUG=bindings $OSCAP --verbose=DEVEL --version set -e -o pipefail