Skip to content

Commit 2a3f7a1

Browse files
cblichmanncopybara-github
authored andcommitted
(Mostly) internal change
Use chained setters for sandbox limits and group syscalls in default policy PiperOrigin-RevId: 910016868 Change-Id: Ie9d50c49f2f00fac441f724825e2e924b268c457
1 parent d22b369 commit 2a3f7a1

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

sandboxed_api/sandbox_config.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ sandbox2::PolicyBuilder Sandbox2Config::DefaultPolicyBuilder() {
5454
__NR_kill,
5555
__NR_tgkill,
5656
__NR_tkill,
57-
});
58-
5957
#ifdef __NR_arch_prctl // x86-64 only
60-
builder.AllowSyscall(__NR_arch_prctl);
58+
__NR_arch_prctl,
6159
#endif
60+
});
6261

6362
if constexpr (sanitizers::IsAny()) {
6463
LOG(WARNING) << "Allowing additional calls to support the LLVM "
@@ -72,10 +71,9 @@ sandbox2::PolicyBuilder Sandbox2Config::DefaultPolicyBuilder() {
7271
}
7372

7473
sandbox2::Limits Sandbox2Config::DefaultLimits() {
75-
sandbox2::Limits limits;
76-
limits.set_rlimit_cpu(RLIM64_INFINITY);
77-
limits.set_walltime_limit(absl::ZeroDuration());
78-
return limits;
74+
return sandbox2::Limits()
75+
.set_rlimit_cpu(RLIM64_INFINITY)
76+
.set_walltime_limit(absl::ZeroDuration());
7977
}
8078

8179
} // namespace sapi

0 commit comments

Comments
 (0)