summaryrefslogtreecommitdiffstats
path: root/src/partition/repart.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-08-29 22:59:48 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-08-30 16:20:40 +0200
commitd850a544bc1f895decb452160c97a884a20b12b7 (patch)
treeafcba3e4628a628205eb441858171f23ca035b03 /src/partition/repart.c
parentUse correct error code in log message in pkcs11_token_find_x509_certificate (... (diff)
downloadsystemd-d850a544bc1f895decb452160c97a884a20b12b7.tar.xz
systemd-d850a544bc1f895decb452160c97a884a20b12b7.zip
repart: Keep existing directory timestamps intact when copying
Otherwise, when merging multiple directory trees, the output becomes unreproducible as the directory timestamps will be changed to the current time when copying identical directories from the second tree. We introduce a new copy flag to achieve this behavior.
Diffstat (limited to 'src/partition/repart.c')
-rw-r--r--src/partition/repart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index bca9f28372..e14c9a4750 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -4961,14 +4961,14 @@ static int do_copy_files(Context *context, Partition *p, const char *root) {
sfd, ".",
pfd, fn,
UID_INVALID, GID_INVALID,
- COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS|COPY_GRACEFUL_WARN|COPY_TRUNCATE,
+ COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS|COPY_GRACEFUL_WARN|COPY_TRUNCATE|COPY_RESTORE_DIRECTORY_TIMESTAMPS,
denylist, subvolumes_by_source_inode);
} else
r = copy_tree_at(
sfd, ".",
tfd, ".",
UID_INVALID, GID_INVALID,
- COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS|COPY_GRACEFUL_WARN|COPY_TRUNCATE,
+ COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS|COPY_GRACEFUL_WARN|COPY_TRUNCATE|COPY_RESTORE_DIRECTORY_TIMESTAMPS,
denylist, subvolumes_by_source_inode);
if (r < 0)
return log_error_errno(r, "Failed to copy '%s%s' to '%s%s': %m",