Closed
Bug 1233904
Opened 9 years ago
Closed 9 years ago
firefox sync needs to use the default user context origin attributes
Categories
(Firefox :: Sync, defect)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
Firefox 48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: huseby, Assigned: huseby)
References
Details
(Whiteboard: [userContextId][OA])
Attachments
(1 file, 6 obsolete files)
(deleted),
patch
|
huseby
:
review+
|
Details | Diff | Splinter Review |
In services/sync/Weave.js there is a call to createCodebasePrincipal that needs to be aware of originAttributes.
> services/sync/Weave.js
> line 189
> let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
> .getService(Ci.nsIScriptSecurityManager);
> let principal = ssm.createCodebasePrincipal(uri, {});
I'm not sure if we want to use the default user context or if it is more complicated than that. If we're sync'ing cookies, we want isolation but if we're sync'ing bookmarks maybe we don't?
Comment 1•9 years ago
|
||
IIUC, that code is simply trying to make a new channel to gain access to files in the profile directory for about:sync-log - it's not used to actual syncing at all. I don't know enough about channels, but I suspect that code was cargo-culted and will have an easy fix - all we need is for about:sync-log to work.
Comment 2•9 years ago
|
||
(In reply to Mark Hammond [:markh] from comment #1)
> IIUC, that code is simply trying to make a new channel to gain access to
> files in the profile directory for about:sync-log
What are the files used for? What does about:sync-log have on it (I don't see anything when I access it on my browser).
My guess is that a default origin attributes could be used here, but a little more info would help to confirm that.
Comment 3•9 years ago
|
||
(In reply to Tanvi Vyas [:tanvi] from comment #2)
> What are the files used for? What does about:sync-log have on it (I don't
> see anything when I access it on my browser).
It has a typical "index" view of a directory in your profile, containing log files written by Sync via Log.jsm. It should appear on any profile where Sync is configured.
> My guess is that a default origin attributes could be used here, but a
> little more info would help to confirm that.
I'd guess that too, although there always seems to be funkiness with file:// URIs.
Assignee | ||
Updated•9 years ago
|
Component: Sync → DOM
Product: Firefox → Core
Assignee | ||
Updated•9 years ago
|
Component: DOM → Sync
Product: Core → Firefox
Assignee | ||
Updated•9 years ago
|
Whiteboard: [userContextId]
Assignee | ||
Comment 4•9 years ago
|
||
this makes sure the origin attributes used to create the principal for the channel that accesses the sync log files is set to the default user context. we don't want any user context isolation for this (ATM).
Comment 5•9 years ago
|
||
Comment on attachment 8709215 [details] [diff] [review]
Bug_1233904.patch
rs+=me if all you want is "gee, I dunno what this does but the people in bug 1218479 seem smart". But I'll bounce this to markh in case he wants to say more than he already has. :)
Attachment #8709215 -
Flags: review?(dolske) → review?(markh)
Comment 6•9 years ago
|
||
Comment on attachment 8709215 [details] [diff] [review]
Bug_1233904.patch
Review of attachment 8709215 [details] [diff] [review]:
-----------------------------------------------------------------
Looks fine to me.
Attachment #8709215 -
Flags: review?(markh) → review+
Assignee | ||
Comment 7•9 years ago
|
||
This is a rebased and updated patch to match the changes in Bug 1229222. This cannot land until 1229222 does.
Attachment #8709215 -
Attachment is obsolete: true
Attachment #8713826 -
Flags: review+
Assignee | ||
Comment 8•9 years ago
|
||
BTW, Weave/Sync is going to need a much more thorough audit to make sure that in all cases, the principals it uses all have the default user context id origin attribute set. We have decided that we are not going to isolate bookmarks, usernames/passwords, etc based on user context id in the first version of the feature. That means sync needs to always be working in the default user context id.
I am especially concerned with the sync tabs part of this feature. We need to make sure that the serialization of tabs includes the full origin attributes so that upon restoration, it can recreate tabs in contexts.
Assignee | ||
Comment 9•9 years ago
|
||
This patch cleans up the previous patch to use the new API defined in bug 1229222. The goal here is to make the about:sync-log page to use the default user context id.
Attachment #8713826 -
Attachment is obsolete: true
Attachment #8715012 -
Flags: review?(jonas)
Assignee | ||
Updated•9 years ago
|
Depends on: bz-bugwrite
Assignee | ||
Updated•9 years ago
|
Comment on attachment 8715012 [details] [diff] [review]
Bug_1233904.patch
Review of attachment 8715012 [details] [diff] [review]:
-----------------------------------------------------------------
::: services/sync/Weave.js
@@ +191,3 @@
> let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
> .getService(Ci.nsIScriptSecurityManager);
> + let attrs = ChromeUtils.setDefaultUserContextId(aLoadInfo.originAttributes);
Why can't this just do:
let attrs = aLoadInfo.originAttributes;
attrs.userContextId = 0;
?
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #10)
> Comment on attachment 8715012 [details] [diff] [review]
> Bug_1233904.patch
>
> Review of attachment 8715012 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: services/sync/Weave.js
> @@ +191,3 @@
> > let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
> > .getService(Ci.nsIScriptSecurityManager);
> > + let attrs = ChromeUtils.setDefaultUserContextId(aLoadInfo.originAttributes);
>
> Why can't this just do:
>
> let attrs = aLoadInfo.originAttributes;
> attrs.userContextId = 0;
>
> ?
Again, we don't want to have manual assignments. I originally submitted some patches like that to Bobby and he rejected it for maintenance reasons. I think he was right, plus there's the JS -> C++ -> JS transition that forces all members to be defined and initialized with default values.
Assignee | ||
Updated•9 years ago
|
Attachment #8715012 -
Flags: review?(jonas)
Assignee | ||
Comment 12•9 years ago
|
||
updated for new API.
Attachment #8715012 -
Attachment is obsolete: true
Attachment #8722051 -
Flags: review?(jonas)
Comment on attachment 8722051 [details] [diff] [review]
Bug_1233904.patch
Review of attachment 8722051 [details] [diff] [review]:
-----------------------------------------------------------------
::: services/sync/Weave.js
@@ +191,4 @@
> let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
> .getService(Ci.nsIScriptSecurityManager);
> + let attrs = ChromeUtils.originAttributesFromDict(aLoadInfo.originAttributes);
> + attrs.userContextId = 0;
Change this to assert that userContextId is already 0. If it isn't, something very fishy is going on.
Attachment #8722051 -
Flags: review?(jonas) → review-
Assignee | ||
Comment 14•9 years ago
|
||
removed assignment per review feedback.
Attachment #8722051 -
Attachment is obsolete: true
Attachment #8722088 -
Flags: review?(jonas)
Comment on attachment 8722088 [details] [diff] [review]
Bug_1233904.patch
Review of attachment 8722088 [details] [diff] [review]:
-----------------------------------------------------------------
::: services/sync/Weave.js
@@ +191,4 @@
> let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
> .getService(Ci.nsIScriptSecurityManager);
> + let attrs = ChromeUtils.originAttributesFromDict(aLoadInfo.originAttributes);
> + let principal = ssm.createCodebasePrincipal(uri, attrs);
No need to call originAttributesFromDict here. Both because aLoadInfo.oA will already return a real OA, and because createCodebasePrincipal would accept a dict.
So just call ssm.createCodebasePrincipal(uri, aLoadInfo.oA)
Attachment #8722088 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 16•9 years ago
|
||
already r+ by :sicking. I'm incorporating the last change he requested.
Attachment #8722088 -
Attachment is obsolete: true
Attachment #8726355 -
Flags: review+
Assignee | ||
Comment 17•9 years ago
|
||
Assignee | ||
Comment 18•9 years ago
|
||
lot's of reds in windows 7. let's try this one more time with newer code: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ee1f410e061c
Assignee | ||
Comment 19•9 years ago
|
||
Assignee | ||
Comment 21•9 years ago
|
||
+r by :sicking, updating the commit message to be more verbose.
Attachment #8726355 -
Attachment is obsolete: true
Attachment #8733136 -
Flags: review+
Comment 22•9 years ago
|
||
Keywords: checkin-needed
Comment 23•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Assignee | ||
Updated•9 years ago
|
Whiteboard: [userContextId] → [userContextId][OA]
You need to log in
before you can comment on or make changes to this bug.
Description
•