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 289671 3587b25bae302c1eed72968dbd7cef883e715948
parent 289670 9e8a703809578d524c4f102b710bc72624bc0929
child 289808 ea6298e1b4f7e22ce2311b2b6a918822f0adb112
child 289809 034378ebabfcfd219f5671209cbd2d83b87e7831
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1233904
milestone48.0a1
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);