Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #17121: Make agents preserve perm on copy to keep previous behavior #2230

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,15 @@
diff --git a/cf-agent/verify_files_utils.c b/cf-agent/verify_files_utils.c
index 7046026..383c69b 100644
--- a/cf-agent/verify_files_utils.c
+++ b/cf-agent/verify_files_utils.c
@@ -1366,7 +1366,9 @@ bool CopyRegularFile(EvalContext *ctx, const char *source, const char *dest, str
else
{
// If preserve is true, retain permissions of source file
- if (attr.copy.preserve)
+ //if (attr.copy.preserve)
+ // Keep previous behavior to stay compatible
+ if (true)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we allow someone to put false here ?
this doesn't look like the default value, but every value

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed,but that was the previous behavior. There is no way to know if it is an explicit false or a default false.

{
if (!CopyRegularFileDisk(source, new))
{