Skip to content

CFE-1982: Made an unrecognized action_policy fatal instead of defaulting to fix - #6275

Open
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-1982/master
Open

CFE-1982: Made an unrecognized action_policy fatal instead of defaulting to fix#6275
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-1982/master

Conversation

@nickanderson

@nickanderson nickanderson commented Aug 5, 2026

Copy link
Copy Markdown
Member

An action_policy value that arrives through a variable skips the parser's
option-list check and was silently treated as fix, so a typo made changes on a
host where the policy asked only to warn. It is now a fatal error, which is what
a literal typo already does at policy check time.

Verified in both directions: with the fix the agent aborts and the promise is not
actuated, and with the fix reverted the report is emitted as before.

Comment thread libpromises/attributes.c Fixed
The parser only checks the option list for literal values, so a value
that arrives through a variable reaches the runtime unchecked. It was
silently treated as 'fix', which means a typo like

  action_policy => "$(warn_only)"

made changes on a host where the policy asked only to warn. A literal
typo is already fatal at policy check time, so the expanded case now
behaves the same way instead of guessing.

Ticket: CFE-1982
Changelog: Title
@nickanderson

Copy link
Copy Markdown
Member Author

@larsewi Seems that custom promise types are similarly affected, should I do separate for mod_custom.c or roll it into this one?

@nickanderson
nickanderson requested a review from larsewi August 5, 2026 21:33
@nickanderson nickanderson changed the title CFE-1982: Warned about an unrecognized action_policy instead of defaulting silently Made an unrecognized action_policy fatal instead of defaulting to fix Aug 5, 2026
@nickanderson nickanderson changed the title Made an unrecognized action_policy fatal instead of defaulting to fix CFE-1982: Made an unrecognized action_policy fatal instead of defaulting to fix Aug 5, 2026

@larsewi larsewi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way is fine by me 🚀

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

7 similar comments
@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

jenkins, please

@nickanderson

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins, please

@cf-bottom

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants