Closed Bug 1258619 Opened 4 years ago Closed 4 years ago
Properly sandbox functions inside a template
58 bytes, text/x-review-board-request
No description provided.
The way functions are being sandboxed in moz.configure land is that their global namespace is being replaced with a limited and identifiable dict. And we avoid re-wrapping a function that already received this treatment. The problem is that template functions have their global namespace replaced, and any function that is defined within the template inherits that global namespace. So when it comes time to wrap those functions defined in templates with e.g. depends, we detect that they're already wrapped although they are not, because we look if their global namespace is of the recognizable type we use when replacing it. So instead of looking at the global namespace type, keep track of all functions that are wrapped. Review commit: https://reviewboard.mozilla.org/r/41671/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/41671/
Comment on attachment 8733238 [details] MozReview Request: Bug 1258619 - Properly sandbox functions inside a template https://reviewboard.mozilla.org/r/41671/#review38345 ::: python/mozbuild/mozbuild/configure/__init__.py:137 (Diff revision 1) > + # Store all results from _prepare_function > + self.__prepared_functions = set() Nit: Single leading underscore seems to be the style in this file.
Attachment #8733238 - Flags: review+
You need to log in before you can comment on or make changes to this bug.