Closed Bug 412743 Opened 17 years ago Closed 16 years ago

nsScriptSecurityManager::Init shouldn't treat failure of InitPrefs as fatal

Categories

(Core :: Security: CAPS, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: timeless, Assigned: timeless)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch make InitPrefs non fatal (obsolete) — Splinter Review
I'm playing around with an xpcshell and I would like to be able to initialize xpcshell, and then create my own prefservice in js *from inside the shell*.

Unfortunately, i can't do that because nsScriptSecurityManager::Init treats that as fatal.

with these changes, caps should initialize and then someone could get caps and send it a security pref changed notice once they have prefs initialized. note that this is designed only to affect standalone worlds. in normal xulrunner applications, preferences will always be present.
Attachment #297514 - Flags: review?(mrbkap)
Assignee: dveditz → timeless
Comment on attachment 297514 [details] [diff] [review]
make InitPrefs non fatal

I guess this is all right. dveditz should have the final word here, though.
Attachment #297514 - Flags: superreview?(dveditz)
Attachment #297514 - Flags: review?(mrbkap)
Attachment #297514 - Flags: review+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 297514 [details] [diff] [review]
make InitPrefs non fatal

SavePrincipal uses mSecurityPref without checking, could be a null deref crash if it's possible to get there without InitPrefs() succeeding. Could we get as far as an enablePrivilege() call without LookupPolicy() succeeding?

>+#ifdef XPC_IDISPATCH_SUPPORT
>+    // Granting XPC Priveleges defaults to disabled in failure cases.

As long as you're moving this line please fix the spelling of privilege.

sr=dveditz
Attachment #297514 - Flags: superreview?(dveditz) → superreview+
timeless: you waited too long, the world has changed under you and this is beyond just unrotting.
OS: Windows XP → All
Hardware: x86 → All
Whiteboard: [timeless: need new patch]
Attachment #297514 - Attachment is obsolete: true
Attached patch updated (obsolete) — Splinter Review
Attachment #355266 - Flags: superreview+
Attachment #355266 - Flags: review+
Attachment #355266 - Attachment is obsolete: true
Comment on attachment 355266 [details] [diff] [review]
updated

Well, not quite, since that reenables checking the mailnews pref.
Attached patch to pushSplinter Review
Now if people would just stop playing with matches...
Whiteboard: [timeless: need new patch]
http://hg.mozilla.org/mozilla-central/rev/aefbb338fdc2
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: