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:
committed by
Facebook Github Bot 5
parent
1ce14cd097
commit
597354a43b
@@ -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')
|
||||
|
||||
|
Reference in New Issue
Block a user