Skip to content

Commit 91189d5

Browse files
Privacy Sandbox Teamcopybara-github
Privacy Sandbox Team
authored andcommitted
fix: File system permissions for prog_dir
Bug: N/A Change-Id: Icd095562f7ddee2a534459890ad92fe8eec85a9a GitOrigin-RevId: 15f11b99e0094385af2c63cde7ce0b79737ade20
1 parent 3799d1f commit 91189d5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/roma/byob/container/run_workers.cc

+15
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,14 @@ class WorkerRunner final : public WorkerRunnerService::Service {
428428
return absl::InternalError(absl::StrCat(
429429
"Failed to create ", binary_dir.native(), ": ", ec.message()));
430430
}
431+
std::error_code ec;
432+
if (std::filesystem::permissions(binary_dir,
433+
std::filesystem::perms::owner_all, ec);
434+
ec) {
435+
return absl::InternalError(
436+
absl::StrCat("Failed to modify permissions for ", binary_dir.native(),
437+
": ", ec.message()));
438+
}
431439
std::filesystem::path binary_path = binary_dir / *kBinaryExe;
432440
if (request.has_binary_content()) {
433441
PS_RETURN_IF_ERROR(SaveNewBinary(binary_path, request.binary_content()));
@@ -561,6 +569,13 @@ int main(int argc, char** argv) {
561569
LOG(ERROR) << "Failed to create " << prog_dir << ": " << ec;
562570
return -1;
563571
}
572+
std::error_code ec;
573+
if (std::filesystem::permissions(prog_dir, std::filesystem::perms::owner_all,
574+
ec);
575+
ec) {
576+
LOG(ERROR) << "Failed to modify permission for " << prog_dir << ": " << ec;
577+
return -1;
578+
}
564579
absl::Cleanup progdir_cleanup = [&prog_dir] {
565580
if (absl::Status status =
566581
::privacy_sandbox::server_common::byob::RemoveDirectories(prog_dir);

0 commit comments

Comments
 (0)