Skip to content

Commit 7aba3c9

Browse files
committed
Added sys.policy_version
Ticket: ENT-4664 Signed-off-by: Victor Moene <[email protected]>
1 parent 0338b4d commit 7aba3c9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cf-agent/cf-agent.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,15 @@ static PromiseResult DefaultVarPromiseWrapper(EvalContext *ctx, const Promise *p
269269

270270
/*******************************************************************/
271271

272+
static void SysPolicyVersion(EvalContext *ctx)
273+
{
274+
const char *version = EvalContextVariableControlCommonGet(ctx, COMMON_CONTROL_VERSION);
275+
if (version != NULL)
276+
{
277+
EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_SYS, "policy_version", version, CF_DATA_TYPE_STRING, "source=agent");
278+
}
279+
}
280+
272281
int main(int argc, char *argv[])
273282
{
274283
SetupSignalsForAgent();
@@ -298,6 +307,7 @@ int main(int argc, char *argv[])
298307
/* FIXME: (CFE-2709) ALWAYS_VALIDATE will always be false here, since it can
299308
* only change in KeepPromises(), five lines later on. */
300309
Policy *policy = SelectAndLoadPolicy(config, ctx, ALWAYS_VALIDATE, true);
310+
SysPolicyVersion(ctx);
301311

302312
if (!policy)
303313
{

0 commit comments

Comments
 (0)