Closed Bug 339822 Opened 19 years ago Closed 18 years ago

[FIX]A principal's URIs should be immutable

Categories

(Core :: Security: CAPS, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

Right now, the URIs of a principal are not guaranteed immutable. They should be.
Attached patch Patch (obsolete) (deleted) — Splinter Review
Attachment #223934 - Flags: superreview?(darin)
Attachment #223934 - Flags: review?(dveditz)
This uses an API I'm adding in bug 336699
Depends on: 336699
Comment on attachment 223934 [details] [diff] [review] Patch i wonder if we should be worried about the additional perf overhead of the NS_EnsureSafeToReturn calls. if we can make mURI immutable, then we shouldn't need to anything more than just AddRef it, but here we are adding a call to check if it is immutable each time we try to get it.
Attachment #223934 - Flags: superreview?(darin) → superreview+
I _think_ getting the URI from a principal is not on any too-critical paths. But yeah, if it turns out it's a problem we may have to store a local boolean as to whether NS_TryToSetImmutable succeeded or something. Other than that, the only way faster than what we do now (QI plus call) would be to store some out-of-band state in a member, or store some object that's an "nsIURI plus whether we set it immutable" or something. :(
Attachment #223934 - Attachment is obsolete: true
Attachment #223948 - Flags: review?(dveditz)
Attachment #223934 - Flags: review?(dveditz)
Comment on attachment 223948 [details] [diff] [review] Updated to final patch from bug 336699 r=dveditz
Attachment #223948 - Flags: review?(dveditz) → review+
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Depends on: 380475
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: