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
This commit is contained in:
Michal Lowicki
2016-08-12 09:34:57 -07:00
committed by Facebook Github Bot 5
parent 1ce14cd097
commit 597354a43b

View File

@@ -5,6 +5,7 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
with allow_unsafe_import():
import os import os
import urllib2 import urllib2
import zipfile import zipfile