Closed Bug 483582 Opened 15 years ago Closed 15 years ago

Multiple requests for master password on startup of Sunbird

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: mozilla)

Details

(Keywords: regression)

Attachments

(1 file)

As bug 349641 was just duped to a Lightning-only bug, I open this one for the same issue on Sunbird. This is a regression of current Sunbird trunk compared to Sunbird 0.9.

On startup of Sunbird one gets one master password request for each (remote) calendar that needs a saved password to load the data.

Workaround:
- Start Sunbird.
- Type master password into first box, making sure that one does not
  accidentally type into another box that might be late to appear.
- Dismiss all other master password and other dialogs.
- Reload remote calendars.
- If the password was typed correctly, now all calendars should indeed
  load.
Flags: blocking-calendar1.0?
I agree this is annoying, but from what I've heard, its nearly impossible to
fix this from calendar side without very evil hacks. Therefore we shouldn't
block the release on it.

It would be very nice to find out the exact reasoning though and find out if
maybe we can fix this in toolkit/core.
Flags: wanted-calendar1.0+
Flags: blocking-calendar1.0?
Flags: blocking-calendar1.0-
Bug 348997 and its depending/blocking bugs are the reason for this behavior.
The code is in Core:Security, and at the moment there is no workaround
available for Sunbird.
And I thought this would be because of the broken (or only half done) implementation of nsIThreadManager that you have picked up with Gecko 1.9. (bug 326273 and bug 381699).

I was thinking that a workaround similar to the one used for TB (http://hg.mozilla.org/comm-central/rev/4c6563dcabef) would work for Sunbird, too. I just cannot seem to find time to try that.
(In reply to comment #3)
> And I thought this would be because of the broken (or only half done)
> implementation of nsIThreadManager that you have picked up with Gecko 1.9. (bug
> 326273 and bug 381699).

Afaik there is a connection to bug 348997.


> I was thinking that a workaround similar to the one used for TB
> (http://hg.mozilla.org/comm-central/rev/4c6563dcabef) would work for Sunbird,
> too. I just cannot seem to find time to try that.

This looks promising!
I think Daniel has already tried this, but until he replies, go ahead and give it a whirl :-)
Yes, I've tried similar stuff by blocking calendar auth until mail startup has passed (keeping to process events), but without success (but deadlocks).
You seem to be forgetting that this bug is specifically about Sunbird (where there is no mail startup). :-) That's why I also don't see the relation to bug 348997 (there are no tabs in Sunbird that I have seen).

I fiddled around in calAuthUtils.jsm but the functions in there are already called multiple times, so it's too late to do any changes in there.
Attached patch fix v0.1 — — Splinter Review
OK, so this works. It asks for the master password once, during startup of Sunbird. I used the current code from TB as in attachment 386414 [details] [diff] [review] of bug 501212.

I guess the most important question is where to put it. It works when added to the startup code of calCalendarManager as in this patch. I don't think it would confuse lightning, but I don't have that around to test. But maybe you have a better idea where I can add this to Sunbird-only code. (Looking at calendar/sunbird/base/content/ I don't really see anything suitable.)
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Attachment #386473 - Flags: review?(dbo.moz)
Attachment #386473 - Flags: review?(dbo.moz) → review+
Comment on attachment 386473 [details] [diff] [review]
fix v0.1

Since this fix does not work for Lightning, please enclose it into

if (cal.isSunbird()) {
>+        this.loginMasterPassword();
}

>+        try {
>+            if (!token.checkPassword(""))
>+                token.login(false);
please use curly braces

r=dbo
Pushed with the requested style corrections:
http://hg.mozilla.org/comm-central/rev/3089b7703d6a

I guess Sunbird will still have problems when the master password is set to time out after a while, but the startup problems should be fixed with this.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.0
(In reply to comment #9)
> (From update of attachment 386473 [details] [diff] [review])
> Since this fix does not work for Lightning, please enclose it into
> 
> if (cal.isSunbird()) {
> >+        this.loginMasterPassword();
> }
Please mind this. Thanks.
Damn, I thought I had moved it from the function to the function call. Will push the followup fix in a minute.
Pushed followup:
http://hg.mozilla.org/comm-central/rev/d63cdec41f66

Sorry for the confusion.
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: