From fd266166a861066c91764e35228bbece3e7144ac Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 1 Jun 2026 19:21:33 +0200 Subject: [PATCH] Add Nova_InitializeLeech2 init hook for cf-agent and cf-serverd Ticket: ENT-14099 Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Lars Erik Wik --- cf-agent/cf-agent.c | 1 + cf-serverd/cf-serverd.c | 2 ++ libpromises/enterprise_stubs.c | 4 ++++ libpromises/prototypes3.h | 1 + 4 files changed, 8 insertions(+) diff --git a/cf-agent/cf-agent.c b/cf-agent/cf-agent.c index b8b0b80c8a..035da48af0 100644 --- a/cf-agent/cf-agent.c +++ b/cf-agent/cf-agent.c @@ -1430,6 +1430,7 @@ static void KeepControlPromises(EvalContext *ctx, const Policy *policy, GenericA } } Nova_Initialize(ctx); + Nova_InitializeLeech2(); // If not have been enabled above then should be disabled. // By default it's enabled to catch all set classes on startup stage diff --git a/cf-serverd/cf-serverd.c b/cf-serverd/cf-serverd.c index ca173d8195..23cc7fdcc1 100644 --- a/cf-serverd/cf-serverd.c +++ b/cf-serverd/cf-serverd.c @@ -62,6 +62,8 @@ int main(int argc, char *argv[]) const char *program_name = (last_dir_sep != NULL ? last_dir_sep + 1 : program_invocation_name); GenericAgentDiscoverContext(ctx, config, program_name); + Nova_InitializeLeech2(); + Policy *policy = SelectAndLoadPolicy(config, ctx, false, false); if (!policy) diff --git a/libpromises/enterprise_stubs.c b/libpromises/enterprise_stubs.c index 8cd8374952..aed0bd4bfe 100644 --- a/libpromises/enterprise_stubs.c +++ b/libpromises/enterprise_stubs.c @@ -55,6 +55,10 @@ ENTERPRISE_VOID_FUNC_1ARG_DEFINE_STUB(void, Nova_Initialize, EvalContext *, ctx) { } +ENTERPRISE_VOID_FUNC_0ARG_DEFINE_STUB(void, Nova_InitializeLeech2) +{ +} + /* all agents: generic_agent.c */ ENTERPRISE_FUNC_0ARG_DEFINE_STUB(const char *, GetConsolePrefix) diff --git a/libpromises/prototypes3.h b/libpromises/prototypes3.h index 8a5334a730..20e8e0f420 100644 --- a/libpromises/prototypes3.h +++ b/libpromises/prototypes3.h @@ -59,6 +59,7 @@ void SetSkipIdentify(bool enabled); /* enterprise_stubs.c */ ENTERPRISE_VOID_FUNC_1ARG_DECLARE(void, Nova_Initialize, EvalContext *, ctx); +ENTERPRISE_VOID_FUNC_0ARG_DECLARE(void, Nova_InitializeLeech2); ENTERPRISE_FUNC_1ARG_DECLARE(int, CfSessionKeySize, char, c); ENTERPRISE_FUNC_0ARG_DECLARE(char, CfEnterpriseOptions); ENTERPRISE_FUNC_1ARG_DECLARE(const EVP_CIPHER *, CfengineCipher, char, type);