mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Fix mount entries listing for tmpfs
PiperOrigin-RevId: 276447076 Change-Id: Ia5873e34327c281e5c9fb66f5f58a0dd49ba10b0
This commit is contained in:
parent
282f2d65e7
commit
a1b291d44a
|
@ -589,6 +589,7 @@ void RecursivelyListMountsImpl(const MountTree& tree,
|
||||||
inside_entries->emplace_back(absl::StrCat(rw_str, tree_path));
|
inside_entries->emplace_back(absl::StrCat(rw_str, tree_path));
|
||||||
outside_entries->emplace_back(absl::StrCat(node.file_node().outside()));
|
outside_entries->emplace_back(absl::StrCat(node.file_node().outside()));
|
||||||
} else if (node.has_tmpfs_node()) {
|
} else if (node.has_tmpfs_node()) {
|
||||||
|
inside_entries->emplace_back(tree_path);
|
||||||
outside_entries->emplace_back(
|
outside_entries->emplace_back(
|
||||||
absl::StrCat("tmpfs: ", node.tmpfs_node().tmpfs_options()));
|
absl::StrCat("tmpfs: ", node.tmpfs_node().tmpfs_options()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,6 +205,8 @@ TEST(MountTreeTest, TestList) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT_THAT(mounts.AddTmpfs(file::CleanPath("/d"), 1024 * 1024), IsOk());
|
||||||
|
|
||||||
std::vector<std::string> outside_entries;
|
std::vector<std::string> outside_entries;
|
||||||
std::vector<std::string> inside_entries;
|
std::vector<std::string> inside_entries;
|
||||||
mounts.RecursivelyListMounts(&outside_entries, &inside_entries);
|
mounts.RecursivelyListMounts(&outside_entries, &inside_entries);
|
||||||
|
@ -219,6 +221,7 @@ TEST(MountTreeTest, TestList) {
|
||||||
"R /h",
|
"R /h",
|
||||||
"W /i/j/k",
|
"W /i/j/k",
|
||||||
"W /i/l/",
|
"W /i/l/",
|
||||||
|
"/d",
|
||||||
}));
|
}));
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
outside_entries,
|
outside_entries,
|
||||||
|
@ -229,6 +232,7 @@ TEST(MountTreeTest, TestList) {
|
||||||
absl::StrCat("/some/dir/", "h"),
|
absl::StrCat("/some/dir/", "h"),
|
||||||
absl::StrCat("/some/dir/", "i/j/k"),
|
absl::StrCat("/some/dir/", "i/j/k"),
|
||||||
absl::StrCat("/some/dir/", "i/l/"),
|
absl::StrCat("/some/dir/", "i/l/"),
|
||||||
|
absl::StrCat("tmpfs: size=", 1024*1024),
|
||||||
}));
|
}));
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user