Closed
Bug 519901
Opened 15 years ago
Closed 15 years ago
delete node.prop; gives "Security Manager vetoed action" (XPCNativeWrapper)
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: johnjbarton, Assigned: mrbkap)
Details
(Keywords: dev-doc-complete, Whiteboard: [doc-waiting-1.9.3])
Attachments
(1 file)
941 bytes,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
On 9/30/09 12:55 AM, John J. Barton wrote:
> I hit a problem, I get an error message "Security Manager vetoed action"
> with the line number point to:
> delete node.__walkingAnonymousChildren; // unmark looping
> Here node is in an nsIDOMDocumentXBL document loaded in a content
> browser.
I assume |node| is just something that looks like a DOM node to you (as in, you didn't do wrappedJSObject on it or anything?
If so, looks like the issue is that XPC_NW_DelProperty will throw NS_ERROR_XPC_SECURITY_MANAGER_VETO, in general, when touching content from chrome. Not sure why that code is as it is; this was part of the initial XPCNativeWrapper landing. Looks wrong to me; worth filing a bug on and ccing ":jst" and "brendan@moz" and probably "mrbkap" and ":bz". Minimal-ish testcase:
javascript: var foo = new XPCNativeWrapper(document.body); foo.bar = 'x'; delete foo.bar;
Of course I'm not quite sure why you need the __walkingAnonymousChildren thing at all... Why do you need it?
-Boris
Reporter | ||
Comment 1•15 years ago
|
||
This code was probably working when the js was running in extensions space on extension nodes, but fails when the js is in extension space but the node is content.
Blocks nothing, I wrote different code.
![]() |
||
Comment 2•15 years ago
|
||
I was talking about this with Blake, and we see no reason to forbid deletes on an XPCNativeWrapper from deleting own properties. Brendan, jst, can you think of any such reasons?
Assignee | ||
Comment 3•15 years ago
|
||
Note that unlike the other wrappers, XPCNativeWrapper doesn't forward the delete to its underlying object. If you delete an IDL-declared property, we'll simply re-resolve it the next time you ask for it. Expandos get nuked until you recreate them.
![]() |
||
Comment 4•15 years ago
|
||
Comment on attachment 405965 [details] [diff] [review]
Proposed fix
r=bzbarsky
Attachment #405965 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 6•15 years ago
|
||
Flags: in-testsuite+
Comment 7•15 years ago
|
||
So is this a fix for this limitation:
https://developer.mozilla.org/en/XPCNativeWrapper#Limitations_of_XPCNativeWrapper
"16. Using the delete operator on "expando" properties of an XPCNativeWrapper throws a security exception."
?
Keywords: dev-doc-needed
Summary: delete node.prop; gives "Security Manager vetoed action" → delete node.prop; gives "Security Manager vetoed action" (XPCNativeWrapper)
Target Milestone: --- → mozilla1.9.3a1
![]() |
||
Comment 8•15 years ago
|
||
Yes, it is.
Updated•15 years ago
|
Whiteboard: [doc-waiting-1.9.3]
Comment 9•15 years ago
|
||
Updated:
https://developer.mozilla.org/en/XPCNativeWrapper
Mentioned here:
https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•