From 597354a43b3c7d69326e24b853bb3de886b09e41 Mon Sep 17 00:00:00 2001 From: Michal Lowicki Date: Fri, 12 Aug 2016 09:34:57 -0700 Subject: [PATCH] Enable build file sandboxing in fbandroid Summary: Enable build file sandboxing in fbandroid. Importing modules in build files that are not whitelisted will be blocked, this can be overriden by using with allow_unsafe_import(): import foo `import os` and `import os.path` will not be blocked and will import a safe version of `os` module instead (functions not accessing the file system like `os.path.join()` will be accessible), full `os` module can be imported using `allow_unsafe_import()` Reviewed By: plamenko Differential Revision: D3649817 fbshipit-source-id: 3e6a3ab9c4c6a56a99ca7adf599323143a5844f4 --- lib/gtest/BUCK | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/gtest/BUCK b/lib/gtest/BUCK index 9d94fa72..16b5331b 100644 --- a/lib/gtest/BUCK +++ b/lib/gtest/BUCK @@ -5,9 +5,10 @@ # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. -import os -import urllib2 -import zipfile +with allow_unsafe_import(): + import os + import urllib2 + import zipfile include_defs('//CSSLAYOUT_DEFS')