bug 211485, check for UniversalBrowserRead for xpath/xslt security checks, r=sicking, sr=jst

git-svn-id: svn://10.0.0.236/trunk@144916 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
axel%pike.org
2003-07-17 10:13:24 +00:00
parent f4a722eefd
commit 39adfbce56

View File

@@ -229,6 +229,16 @@ PRBool URIUtils::CanCallerAccess(nsIDOMNode *aNode)
return PR_TRUE;
}
// Ask the securitymanager if we have "UniversalBrowserRead"
PRBool caps = PR_FALSE;
nsresult rv =
gTxSecurityManager->IsCapabilityEnabled("UniversalBrowserRead",
&caps);
NS_ENSURE_SUCCESS(rv, PR_FALSE);
if (caps) {
return PR_TRUE;
}
// Make sure that this is a real node. We do this by first QI'ing to
// nsIContent (which is important performance wise) and if that QI
// fails we QI to nsIDocument. If both those QI's fail we won't let
@@ -299,8 +309,8 @@ PRBool URIUtils::CanCallerAccess(nsIDOMNode *aNode)
return PR_TRUE;
}
nsresult rv = gTxSecurityManager->CheckSameOriginPrincipal(subjectPrincipal,
principal);
rv = gTxSecurityManager->CheckSameOriginPrincipal(subjectPrincipal,
principal);
return NS_SUCCEEDED(rv);
}