mac: Remove explicit (allow sysctl-read) for kern.proc.pid.$pid
Use the (allow process-info) capability to permit this instead. This
lets the (param current-pid) be removed.
Bug: 1315988
Change-Id: I04e60b172182b047077ca612de964a342fbd94c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4072724
Reviewed-by: Mark Mentovai <[email protected]>
Commit-Queue: Robert Sesek <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1078611}
diff --git a/content/renderer/sandbox_mac_v2_unittest.mm b/content/renderer/sandbox_mac_v2_unittest.mm
index 977153f5..ff81fbc 100644
--- a/content/renderer/sandbox_mac_v2_unittest.mm
+++ b/content/renderer/sandbox_mac_v2_unittest.mm
@@ -70,8 +70,6 @@
logging_path.value()));
// Parameters normally set by the main executable.
- CHECK(compiler->InsertStringParam(sandbox::policy::kParamCurrentPid,
- std::to_string(getpid())));
CHECK(compiler->InsertStringParam(sandbox::policy::kParamExecutablePath,
executable_path.value()));
@@ -167,6 +165,8 @@
CHECK_EQ(0,
sysctlbyname("hw.ncpu", sysctl_data.data(), &data_size, nullptr, 0));
+ CHECK(!base::Process::Current().CreationTime().is_null());
+
return 0;
}