Skip to content

Conversation

nickanderson
Copy link
Member

This introduces a new fsattrs immutable body for use with the files promise
type. When applied, it ensures that the promised file has the immutable (i)
attribute set. The agent will transparently manage the attribute, removing it
before any necessary file modifications and restoring it afterwards.

Ticket: CFE-4582
Changelog: Title

immutable => "$(CF_BOOL)"; # The i attribute supported by chattr
}

body fsattrs is_immutable
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this should rather be

body fsattrs is_immutable
{
  inherit_from => immutable("true");
}

To avoid a bunch of repetition of examples, etc here.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, I had considered that but instead preferred for the others to be more stand alone.

immutable => "true"; # The i attribute supported by chattr
}

body fsattrs is_not_immutable
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe

body fsattrs is_not_immutable
{
  inherit_from => immutable("false");
}

This introduces a new fsattrs immutable body for use with the files promise type. When applied, it ensures that the promised file has the immutable (i) attribute set. The agent will transparently manage the attribute, removing it before any necessary file modifications and restoring it afterwards. To simplify usage, is_immutable and is_not_immutable bodies were introduced as direct aliases for the parameterized immutable with "true" and "false" arguments, respectively.

Ticket: CFE-4582
Changelog: Title
@nickanderson nickanderson changed the title CFE-4582 Added immutable option to fsattrs body CFE-4582: Added fsattrs bodies for the immutable bit Aug 29, 2025
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.

2 participants