From b0615b30c06879c7e2dd12970d1c96f5a5b3f00a Mon Sep 17 00:00:00 2001 From: "caillon%returnzero.com" Date: Wed, 25 Jun 2003 22:40:58 +0000 Subject: [PATCH] Bug 210601 - XSLT should check whether the subject principal is the system principal. r=axel@pike.org sr=jst@netscape.com git-svn-id: svn://10.0.0.236/trunk@144160 18797224-902f-48f8-a5cc-f745e15eee43 --- .../transformiix/source/base/txURIUtils.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mozilla/extensions/transformiix/source/base/txURIUtils.cpp b/mozilla/extensions/transformiix/source/base/txURIUtils.cpp index d8cbf1e8ec2..495353fb944 100644 --- a/mozilla/extensions/transformiix/source/base/txURIUtils.cpp +++ b/mozilla/extensions/transformiix/source/base/txURIUtils.cpp @@ -215,6 +215,20 @@ PRBool URIUtils::CanCallerAccess(nsIDOMNode *aNode) return PR_TRUE; } + // Check whether the subject principal is the system principal. + // For performance, we will avoid calling SubjectPrincipalIsChrome() + // since it calls GetSubjectPrincipal() which causes us to walk + // the JS frame stack. We already did that above, so just get the + // system principal from the security manager, and do a raw comparison. + nsCOMPtr systemPrincipal; + gTxSecurityManager->GetSystemPrincipal(getter_AddRefs(systemPrincipal)); + + if (subjectPrincipal == systemPrincipal) { + // we're running as system, grant access to the node. + + 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