Skip to content

Commit

Permalink
spawn/Mount: apply TMPFS_DIRS_READABLE to tmpfs mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Feb 4, 2025
1 parent 49407df commit d55affb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/spawn/Mount.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Mount::ApplyTmpfs(VfsBuilder &vfs_builder) const
auto fs = FSOpen("tmpfs");
FSConfig(fs, FSCONFIG_SET_STRING, "size", "16M");
FSConfig(fs, FSCONFIG_SET_STRING, "nr_inodes", "256");
FSConfig(fs, FSCONFIG_SET_STRING, "mode", "711");
FSConfig(fs, FSCONFIG_SET_STRING, "mode", FmtBuffer<8>("{:o}", vfs_builder.GetDirMode()));

if (writable) {
FSConfig(fs, FSCONFIG_SET_STRING, "uid",
Expand Down
4 changes: 4 additions & 0 deletions src/spawn/VfsBuilder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public:

~VfsBuilder() noexcept;

uint_least16_t GetDirMode() const noexcept {
return dir_mode;
}

void AddWritableRoot(const char *path);

/**
Expand Down

0 comments on commit d55affb

Please sign in to comment.