Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cf-agent/verify_files_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include <unix.h> /* GetGroupName(), GetUserName() */

#include <cf-windows-functions.h>
#include "cf3.defs.h"

#define CF_RECURSION_LIMIT 100

Expand Down Expand Up @@ -1569,6 +1570,13 @@ bool CopyRegularFile(EvalContext *ctx, const char *source, const char *dest, con
}
mode &= 0777; /* Never preserve SUID bit */

/* If perms are promised for this file, use those instead */
if ((attr->perms.plus != CF_SAMEMODE) && (attr->perms.minus != CF_SAMEMODE))
{
mode |= attr->perms.plus;
mode &= ~(attr->perms.minus);
}

if (!CopyRegularFileNet(source, ToChangesPath(new),
sstat->st_size, attr->copy.encrypt, conn, mode))
{
Expand Down
Loading