From dadf55f647a2b97afd4b62940a4f3bca8f572b69 Mon Sep 17 00:00:00 2001 From: Kevin Hamacher Date: Mon, 23 Mar 2020 08:44:01 -0700 Subject: [PATCH] Show a warning when tmpfs size is not specified PiperOrigin-RevId: 302441519 Change-Id: Ia4130c9067f00ed48065ea3b4854c844e7b88f85 --- sandboxed_api/sandbox2/policybuilder.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sandboxed_api/sandbox2/policybuilder.h b/sandboxed_api/sandbox2/policybuilder.h index 8c1604b..d3bf6d6 100644 --- a/sandboxed_api/sandbox2/policybuilder.h +++ b/sandboxed_api/sandbox2/policybuilder.h @@ -432,8 +432,14 @@ class PolicyBuilder final { // directories inside the namespace if needed. // // Calling this function will enable use of namespaces. - PolicyBuilder& AddTmpfs(absl::string_view inside, - size_t sz = 4 << 20 /* 4MiB */); + ABSL_DEPRECATED( + "Explicitly specify tmpfs size by using AddTmpfs(inside, sz) instead") + PolicyBuilder& AddTmpfs(absl::string_view inside) { + LOG(WARNING) << "Tmpfs size not specified, defaulting to 4 MiB"; + return AddTmpfs(inside, 4 << 20 /* 4 MiB */); + } + + PolicyBuilder& AddTmpfs(absl::string_view inside, size_t sz); // Allows unrestricted access to the network by *not* creating a network // namespace. Note that this only disables the network namespace. To actually