Bug 1275424 - Allow `map` in the moz.configure sandbox. r?glandium draft
authorRalph Giles <giles@mozilla.com>
Mon, 04 Jul 2016 14:10:49 -0700
changeset 383694 3ad518149b76cae3498cf652158f5067e36e2fdf
parent 383613 f378a56b25ce2a2997b263c1857629f3f18d7400
child 383695 8e51617b8e9c1307f89bf0567aca942c3e7edf66
push id22085
push userbmo:giles@thaumas.net
push dateMon, 04 Jul 2016 21:17:09 +0000
reviewersglandium
bugs1275424
milestone50.0a1
Bug 1275424 - Allow `map` in the moz.configure sandbox. r?glandium This is useful for parsing semi-machinable command output into dicts. MozReview-Commit-ID: 8bPTsOVBNyO
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -92,17 +92,17 @@ class ConfigureSandbox(dict):
     """
 
     # The default set of builtins. We expose unicode as str to make sandboxed
     # files more python3-ready.
     BUILTINS = ReadOnlyDict({
         b: __builtins__[b]
         for b in ('None', 'False', 'True', 'int', 'bool', 'any', 'all', 'len',
                   'list', 'tuple', 'set', 'dict', 'isinstance', 'getattr',
-                  'hasattr', 'enumerate', 'range', 'zip')
+                  'hasattr', 'enumerate', 'range', 'map', 'zip')
     }, __import__=forbidden_import, str=unicode)
 
     # Expose a limited set of functions from os.path
     OS = ReadOnlyNamespace(path=ReadOnlyNamespace(**{
         k: getattr(mozpath, k, getattr(os.path, k))
         for k in ('abspath', 'basename', 'dirname', 'exists', 'isabs', 'isdir',
                   'isfile', 'join', 'normcase', 'normpath', 'realpath',
                   'relpath')