Bug 1233904 - Make sync use the correct principal origin attributes when accessing sync logs. r=sicking
authorDave Huseby <dhuseby@mozilla.com>
Mon, 21 Mar 2016 16:44:00 -0400
changeset 289612 3587b25bae302c1eed72968dbd7cef883e715948
parent 289611 9e8a703809578d524c4f102b710bc72624bc0929
child 289749 ea6298e1b4f7e22ce2311b2b6a918822f0adb112
child 289750 034378ebabfcfd219f5671209cbd2d83b87e7831
push id30107
push usercbook@mozilla.com
push dateTue, 22 Mar 2016 10:00:23 +0000
treeherdermozilla-central@3587b25bae30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1233904
milestone48.0a1
first release with
nightly linux32
3587b25bae30 / 48.0a1 / 20160322030417 / files
nightly linux64
3587b25bae30 / 48.0a1 / 20160322030417 / files
nightly mac
3587b25bae30 / 48.0a1 / 20160322030417 / files
nightly win32
3587b25bae30 / 48.0a1 / 20160322030417 / files
nightly win64
3587b25bae30 / 48.0a1 / 20160322030417 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1233904 - Make sync use the correct principal origin attributes when accessing sync logs. r=sicking
services/sync/Weave.js
--- a/services/sync/Weave.js
+++ b/services/sync/Weave.js
@@ -180,20 +180,22 @@ AboutWeaveLog.prototype = {
   newChannel: function(aURI, aLoadInfo) {
     let dir = FileUtils.getDir("ProfD", ["weave", "logs"], true);
     let uri = Services.io.newFileURI(dir);
     let channel = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
 
     channel.originalURI = aURI;
 
     // Ensure that the about page has the same privileges as a regular directory
-    // view. That way links to files can be opened.
+    // view. That way links to files can be opened. make sure we use the correct
+    // origin attributes when creating the principal for accessing the
+    // about:sync-log data.
     let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
                 .getService(Ci.nsIScriptSecurityManager);
-    let principal = ssm.createCodebasePrincipal(uri, {});
+    let principal = ssm.createCodebasePrincipal(uri, aLoadInfo.originAttributes);
 
     channel.owner = principal;
     return channel;
   }
 };
 
 const components = [WeaveService, AboutWeaveLog];
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);