Skip to content

ENT-10961, CFE-1840: Files promise can now modify immutable bit in file system attributes#5833

Merged
larsewi merged 27 commits into
cfengine:masterfrom
larsewi:immut
Jul 4, 2025
Merged

ENT-10961, CFE-1840: Files promise can now modify immutable bit in file system attributes#5833
larsewi merged 27 commits into
cfengine:masterfrom
larsewi:immut

Conversation

@larsewi

@larsewi larsewi commented Jul 1, 2025

Copy link
Copy Markdown
Contributor
  • Added utility functions to override immutable bit
  • Added body syntax for controlling file system attributes
  • Files promise can now modify immutable bit in file system attributes
  • Store override_immutable variable in EvalContext
  • content attribute can now override immutable bit
  • copy_from attribute can now override immutable bit
  • delete attribute can now override immutable bit
  • edit_line and edit_xml attributes can now override immutable bit
  • touch attribute can now override immutable bit
  • transformer attribute can now override immutable bit
  • rename attribute can now override immutable bit
  • perms attribute can now override immutable bit
  • acl attribute can now override immutable bit
  • evalfunction.c: Removed trailing whitespace
  • Added acceptance test to set immutable bit
  • Added acceptance test to clear immutable bit
  • Added acceptance test for immutable with content
  • Added acceptance test for immutable with copy_from
  • Added acceptance test for immutable with delete
  • Added acceptance test for immutable with edit_line
  • Added acceptance test for immutable with edit_xml
  • Added acceptance test for immutable with perms
  • Added acceptance test for immutable with touch
  • Added acceptance test for immutable with edit_template
  • Added acceptance test for immutable with acl
  • Added acceptance test for immutable with transformer
  • Added acceptance test for immutable with rename

@larsewi

larsewi commented Jul 1, 2025

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins with exotics please :)

@cf-bottom

Copy link
Copy Markdown

@vpodzime vpodzime 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.

➕ there's an inconsistency in the commit messages regarding attribute names being capitalized or not. Looks good to me otherwise. Good job!

Comment thread libpromises/override_fsattrs.c Outdated
Comment thread libpromises/override_fsattrs.c
Comment thread libpromises/override_fsattrs.h Outdated
Comment thread libpromises/override_fsattrs.h Outdated
Comment thread libpromises/eval_context.c Outdated
Comment thread cf-agent/verify_files_utils.c
@larsewi

larsewi commented Jul 2, 2025

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins with exotics please :)

@cf-bottom

cf-bottom commented Jul 2, 2025

Copy link
Copy Markdown

Comment thread cf-agent/cf-agent.c Outdated
larsewi added 18 commits July 3, 2025 11:05
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Added syntax for `body fsattrs` with a boolean constraint `immutable`.
It currently does nothing, but this will change in following commits.

Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
This way we don't have to explicitly pass it to a gazillion functions.

Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The content attribute of the files promise can now override the
immutable bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The copy_from attribute of the files promise can now override the
immutable bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The delete attribute of the files promise can now override the immutable
bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The edit_line and edit_xml attributes of the files promise can now
override the immutable bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The touch attribute of the files promise can now override the
immutable bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The transformer attribute of the files promise can now override the
immutable bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The rename attribute of the files promise can now override the immutable
bit. The disabled file will inherit the immutable trait of the original
file.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The perms attribute of the files promise can now override the immutable
bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The acl attribute of the files promise can now override the immutable
bit.

Ticket: ENT-10961, CFE-1840
Changelog: Commit
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
larsewi added 9 commits July 3, 2025 11:05
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-10961, CFE-1840
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi

larsewi commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins with exotics please :)

@larsewi larsewi requested a review from vpodzime July 3, 2025 09:07
@cf-bottom

cf-bottom commented Jul 3, 2025

Copy link
Copy Markdown

@vpodzime vpodzime 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.

Looks good to me.

@larsewi larsewi merged commit 8d55063 into cfengine:master Jul 4, 2025
39 of 42 checks passed
@larsewi larsewi deleted the immut branch July 25, 2025 10:54
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.

3 participants