Allow a signed jar to load scripts which are at least as privileged as the jar. Bug 428873, r+sr=jst, a=beltzner

This commit is contained in:
bzbarsky@mit.edu 2008-04-16 09:03:23 -07:00
parent d6732d2103
commit de3cfbb932

View File

@ -891,9 +891,9 @@ nsScriptLoader::ShouldExecuteScript(nsIDocument* aDocument,
NS_ASSERTION(channelPrincipal, "Gotta have a principal here!");
// If the document principal is a cert principal and is not the same
// as the channel principal, then we don't execute the script.
PRBool equal;
rv = docPrincipal->Equals(channelPrincipal, &equal);
return NS_SUCCEEDED(rv) && equal;
// If the channel principal isn't at least as powerful as the
// document principal, then we don't execute the script.
PRBool subsumes;
rv = channelPrincipal->Subsumes(docPrincipal, &subsumes);
return NS_SUCCEEDED(rv) && subsumes;
}