From cc5477e87b7a08a5f00b8fd88af63cdc26a273f3 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 23 Apr 2009 13:01:43 +0000 Subject: [PATCH] Bug 479943. Pass in the right owner for link clicks and form submissions and stop inheriting from the document. r=dveditz, sr=jst, a=dveditz git-svn-id: svn://10.0.0.236/trunk@257026 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 4 ++-- mozilla/docshell/base/nsWebShell.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index a67bc694d89..250c77c503a 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -6782,8 +6782,8 @@ nsDocShell::InternalLoad(nsIURI * aURI, // One more twist: Don't inherit the owner for external loads. if (aLoadType != LOAD_NORMAL_EXTERNAL && !owner && (aFlags & INTERNAL_LOAD_FLAGS_INHERIT_OWNER) && - ((NS_SUCCEEDED(URIInheritsSecurityContext(aURI, &inherits)) && - inherits) || URIIsLocalFile(aURI))) { + NS_SUCCEEDED(URIInheritsSecurityContext(aURI, &inherits)) && + inherits) { // Don't allow loads that would inherit our security context // if this document came from an unsafe channel. diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index bfac64a8483..a14616c36f2 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -876,8 +876,8 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent, rv = InternalLoad(aURI, // New URI referer, // Referer URI - nsnull, // No onwer - INTERNAL_LOAD_FLAGS_INHERIT_OWNER, // Inherit owner from document + aContent->NodePrincipal(), // Owner is our node's principal + INTERNAL_LOAD_FLAGS_NONE, target.get(), // Window target NS_LossyConvertUTF16toASCII(typeHint).get(), aPostDataStream, // Post data stream