Skip to content

Conversation

nickanderson
Copy link
Member

Added test for copy_from which already respects move_obstructions. Foundation for testing other files promise behavior with move_obstructions and symlinks.

Ticket: CFE-4591

This test also serves as the basis for checking additional types of files
promises.

Ticket: CFE-4591
Changelog: None
@nickanderson
Copy link
Member Author

 ./10_files/move_obstructions-promiser-is-symlink.cf Pass

…ions

This is failing. It shows that when move_obstructions is used when the promiser
is targeting a symlink that the symlink is not replaced with a plain file.
Instead the content of the symlinked file is modified.
@nickanderson
Copy link
Member Author

nickanderson commented Sep 28, 2025

As expected:

./10_files/move_obstructions-promiser-is-symlink.cf FAIL (UNEXPECTED FAILURE)

@nickanderson
Copy link
Member Author

./10_files/move_obstructions-promiser-is-symlink.cf Pass

return false;
}

const mode_t st_mode = sb->st_mode;

Check notice

Code scanning / CodeQL

Pointer argument is dereferenced without checking for NULL Note

Parameter sb in HandleFileObstruction() is dereferenced without an explicit null-check
Copy link
Member Author

Choose a reason for hiding this comment

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

@larsewi i had done that safe_attr and safe_sb to avoid this check

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought so. But it should not be an issue anymore with the assert's.

Assigning them to a local variable does not really solve the issue. Although, you had some if-statements that in fact does solve it. However, these variables should not be NULL, so an assert be sufficient.

…nt attribute

Ticket: CFE-4591
Changelog: Title

Co-authored-by: Qwen Code <[email protected]>
Co-authored-by: Gemini <[email protected]>
nickanderson and others added 8 commits September 28, 2025 00:47
edit_template_string is only used with template_method inline_mustache.
An `assert` should be sufficient to let the static analysis tools know
that these pointers are not `NULL`.

Please squash this one with e9a8f71.

Signed-off-by: Lars Erik Wik <[email protected]>
Handle the edge case where obstruction filepath is too long to fit in
`backup` buffer.

Please squash with e9a8f71.

Signed-off-by: Lars Erik Wik <[email protected]>
Please squash with e9a8f71.

Signed-off-by: Lars Erik Wik <[email protected]>
Please squash with e9a8f71

Signed-off-by: Lars Erik Wik <[email protected]>
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

Looks good. Would be ready to go after squashing a few commits and passing tests.

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