diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-11-10 14:32:15 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-11-15 20:23:51 +0100 |
commit | 0b34f351d17332d2e5b2c2fbb0124d33fd080a31 (patch) | |
tree | 88c901eccaa5126bd20c47d59056a905c5e70bac /src/partition | |
parent | repart: Fail early if no sources are provided for a read-only filesystem (diff) | |
download | systemd-0b34f351d17332d2e5b2c2fbb0124d33fd080a31.tar.xz systemd-0b34f351d17332d2e5b2c2fbb0124d33fd080a31.zip |
repart: Change mode of temporary root to 755
Let's make sure regular users can access read/execute files when
we're populating from a temporary root.
Diffstat (limited to 'src/partition')
-rw-r--r-- | src/partition/repart.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c index 4e309ab214..b786678557 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -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. */ |