Make it possible to disable checkloaduri on a per-site basis instead of

disabling it globally.  Bug 233108, r=caillon, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2004-11-03 15:45:52 +00:00
parent a786894a90
commit 1f629aef08

View File

@ -1296,6 +1296,21 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
sourceScheme.EqualsLiteral("resource"))
return NS_OK;
// Now check capability policies
static const char loadURIPrefGroup[] = "checkloaduri";
SecurityLevel secLevel;
rv = LookupPolicy(aPrincipal,
(char*)loadURIPrefGroup,
sEnabledID,
nsIXPCSecurityManager::ACCESS_GET_PROPERTY,
nsnull, &secLevel);
if (NS_SUCCEEDED(rv) && secLevel.level == SCRIPT_SECURITY_ALL_ACCESS)
{
// OK for this site!
return NS_OK;
}
ReportError(nsnull, errorTag, sourceURI, aTargetURI);
return NS_ERROR_DOM_BAD_URI;
}