Closed Bug 1258619 Opened 8 years ago Closed 8 years ago

Properly sandbox functions inside a template

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

      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/
Attachment #8733238 - Flags: review?(gps)
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+
https://hg.mozilla.org/mozilla-central/rev/bbfbdaa25c6c
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Attachment #8733238 - Flags: review?(gps)
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: