static void KeepHardClasses(EvalContext *ctx) { char name[CF_BUFSIZE]; if (name != NULL) { char *existing_policy_server = PolicyServerReadFile(GetWorkDir()); if (existing_policy_server) { free(existing_policy_server); if (GetAmPolicyHub()) { MarkAsPolicyServer(ctx); } } } /* FIXME: why is it not in generic_agent?! */ GenericAgentAddEditionClasses(ctx); }
/** * @brief Reads the policy_server.dat and sets the internal variables. * @param[in] ctx EvalContext used by EvalContextSetPolicyServer() * @param[in] workdir the directory of policy_server.dat usually GetWorkDir() */ void EvalContextSetPolicyServerFromFile(EvalContext *ctx, const char *workdir) { char *contents = PolicyServerReadFile(workdir); EvalContextSetPolicyServer(ctx, contents); free(contents); }
AgentDiagnosticsResult AgentDiagnosticsCheckIsBootstrapped(const char *workdir) { char *policy_server = PolicyServerReadFile(workdir); return AgentDiagnosticsResultNew(policy_server != NULL, policy_server != NULL ? policy_server : xstrdup("Not bootstrapped")); }