Bug 774585: Fix xpc-sandbox creation code to create the correct principals. r=mrbkap
authorJonas Sicking <jonas@sicking.cc>
Sat, 21 Jul 2012 00:29:40 -0700
changeset 100022 224e9f2148b217f5657ec4c17570cf167679d681
parent 100021 24d60aa478bb6cfbe4048f64228d0f17f553fd29
child 100023 c3972de3f4a56b467a31a843a3be7c3670de25a0
push id12302
push usersicking@mozilla.com
push dateSat, 21 Jul 2012 07:29:34 +0000
treeherdermozilla-inbound@c5cd832d82ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs774585
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 774585: Fix xpc-sandbox creation code to create the correct principals. r=mrbkap
js/xpconnect/src/XPCComponents.cpp
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -3393,17 +3393,20 @@ GetPrincipalFromString(JSContext *cx, JS
     NS_ENSURE_TRUE(codebaseStr.init(cx, codebase), NS_ERROR_FAILURE);
     nsresult rv = NS_NewURI(getter_AddRefs(uri), codebaseStr);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIScriptSecurityManager> secman =
         do_GetService(kScriptSecurityManagerContractID);
     NS_ENSURE_TRUE(secman, NS_ERROR_FAILURE);
 
-    rv = secman->GetCodebasePrincipal(uri, principal);
+    // We could allow passing in the app-id and browser-element info to the
+    // sandbox constructor. But creating a sandbox based on a string is a
+    // deprecated API so no need to add features to it.
+    rv = secman->GetNoAppCodebasePrincipal(uri, principal);
     NS_ENSURE_SUCCESS(rv, rv);
     NS_ENSURE_TRUE(*principal, NS_ERROR_FAILURE);
 
     return NS_OK;
 }
 
 // for sandbox constructor  the first argument can be a principal object or
 // a script object principal (Document, Window)