Skip to content

Commit

Permalink
fix: Close stdin before exec in sandbox mode
Browse files Browse the repository at this point in the history
Bug: N/A
Change-Id: Ia46ca71a515b5863a3cc5610338d742a91201c9b
GitOrigin-RevId: 9e5a6ffe0bf182692ea99895b5c9be8619b340b3
  • Loading branch information
Privacy Sandbox Team authored and copybara-github committed Oct 2, 2024
1 parent d96a938 commit f8632cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/roma/byob/interface/roma_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ByobHandle::ByobHandle(int pid, std::string_view mounts,
: std::move(container_name)) {
// The following block does not run in the parent process.
if (pid_ == 0) {
PCHECK(::close(STDIN_FILENO) == 0);
nlohmann::json config;
{
std::ifstream ifs(std::filesystem::path(CONTAINER_PATH) / "config.json");
Expand Down

0 comments on commit f8632cf

Please sign in to comment.