]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Move comment
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Nov 2022 09:26:33 +0000 (10:26 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 28 Nov 2022 09:46:00 +0000 (10:46 +0100)
src/partition/repart.c

index f6b8c9be65f9040cc0a53fbd75bc1c0a84046e2f..04cf66ec1396e8e99dd98c9c82c7fb7cc17e5edb 100644 (file)
@@ -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;