]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Change mode of temporary root to 755
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 10 Nov 2022 13:32:15 +0000 (14:32 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 15 Nov 2022 19:23:51 +0000 (20:23 +0100)
Let's make sure regular users can access read/execute files when
we're populating from a temporary root.

src/partition/repart.c

index 4e309ab214e4a7efba9ce5924fc560854ad5eab2..b786678557d74fcefa2c3876cce49e9f48a54fda 100644 (file)
@@ -3640,6 +3640,9 @@ static int partition_populate_directory(Partition *p, const Set *denylist, char
         if (r < 0)
                 return log_error_errno(r, "Failed to create temporary directory: %m");
 
+        if (chmod(root, 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. */