summaryrefslogtreecommitdiff
path: root/src/partition
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-11-23 10:26:33 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-11-28 10:46:00 +0100
commit8a050905a30ff3a5108a8591130e27a1cb17b90c (patch)
treee4c2ab7cc2480c7a85a087fadf339e27e328b0ef /src/partition
parent31853609809c67a2f8a8beb0436378e9bfb9a54d (diff)
downloadsystemd-8a050905a30ff3a5108a8591130e27a1cb17b90c.tar.gz
repart: Move comment
Diffstat (limited to 'src/partition')
-rw-r--r--src/partition/repart.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index f6b8c9be65..04cf66ec13 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -3721,6 +3721,10 @@ static int do_copy_files(Partition *p, const char *root, const Set *denylist) {
if (pfd < 0)
return log_error_errno(pfd, "Failed to open parent directory of target: %m");
+ /* Make sure everything is owned by the user running repart so that
+ * make_filesystem() can map the user running repart to "root" in a user
+ * namespace to have the files owned by root in the final image. */
+
r = copy_tree_at(
sfd, ".",
pfd, fn,
@@ -3813,10 +3817,6 @@ static int partition_populate_directory(Partition *p, const Set *denylist, char
if (fchmod(rfd, 0755) < 0)
return log_error_errno(errno, "Failed to change mode of temporary directory: %m");
- /* Make sure everything is owned by the user running repart so that make_filesystem() can map the
- * user running repart to "root" in a user namespace to have the files owned by root in the final
- * image. */
-
r = do_copy_files(p, root, denylist);
if (r < 0)
return r;