Bug 552835: Use the system principal to construct bootstrap sandboxes. r=robstrong
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 05 Apr 2010 10:31:00 -0700
changeset 41562 b6865cbb9fb3a809c9c849028f778daea1c5a947
parent 41561 06bbf246305222fb18c0347edf57e1c6f98bd65f
child 41563 73c83aa9cdfb564a6c538e98bba261a9085d006c
push idunknown
push userunknown
push dateunknown
reviewersrobstrong
bugs552835
milestone1.9.3a5pre
Bug 552835: Use the system principal to construct bootstrap sandboxes. r=robstrong
toolkit/mozapps/extensions/XPIProvider.jsm
--- a/toolkit/mozapps/extensions/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/XPIProvider.jsm
@@ -1795,17 +1795,19 @@ var XPIProvider = {
     if (startup)
       methods.unshift("startup");
     if (install)
       methods.unshift("install");
     let bootstrap = dir.clone();
     bootstrap.append("bootstrap.js");
     if (bootstrap.exists()) {
       let uri = Services.io.newFileURI(bootstrap);
-      let scope = new Components.utils.Sandbox("chrome://mozapps/content/extensions");
+      let principal = Cc["@mozilla.org/systemprincipal;1"].
+                      createInstance(Ci.nsIPrincipal);
+      let scope = new Components.utils.Sandbox(principal);
       let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
                    createInstance(Ci.mozIJSSubScriptLoader);
 
       try {
         loader.loadSubScript(uri.spec, scope);
       }
       catch (e) {
         WARN("Error loading bootstrap.js for " + id + ": " + e);