copy: optionally apply source inode's stat() when doing a merge copy
This commit is contained in:
+1
-1
@@ -1257,7 +1257,7 @@ static int fd_copy_directory(
|
||||
}
|
||||
|
||||
finish:
|
||||
if (!exists) {
|
||||
if (FLAGS_SET(copy_flags, COPY_MERGE_APPLY_STAT) || !exists) {
|
||||
if (fchown(fdt,
|
||||
uid_is_valid(override_uid) ? override_uid : st->st_uid,
|
||||
gid_is_valid(override_gid) ? override_gid : st->st_gid) < 0)
|
||||
|
||||
@@ -33,6 +33,7 @@ typedef enum CopyFlags {
|
||||
*/
|
||||
COPY_NOCOW_AFTER = 1 << 20,
|
||||
COPY_PRESERVE_FS_VERITY = 1 << 21, /* Preserve fs-verity when copying. */
|
||||
COPY_MERGE_APPLY_STAT = 1 << 22, /* When we reuse an existing directory inode, apply source ownership/mode/xattrs/timestamps */
|
||||
} CopyFlags;
|
||||
|
||||
typedef enum DenyType {
|
||||
|
||||
Reference in New Issue
Block a user