Closed Bug 501212 Opened 14 years ago Closed 14 years ago

Master password always must be entered multiple times.

Categories

(Thunderbird :: Security, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: standard8, Assigned: Bienvenu)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #437635 +++

The master password is starting to come up multiple times again. This was originally fixed in bug 437635, but (probably) bug 474701 has regressed it.

Passing to bienvenu initially as he probably has more time than me.
Flags: blocking-thunderbird3+
I went back to the machine that had a profile that exhibited this bug, did a full pull and rebuild, and did not see this problem. So this doesn't seem to have fully regressed. Standard8, have you seen this problem?
I see this bug.  At launch time I see one dialog box, and then another slides on top of it.  

I have an SSL/IMAP account, one plain IMAP, and one POP account. 

My TB:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1pre) Gecko/20090630 Shredder/3.0b3pre
For me I see 1 dialog box per accounts that has email certificate signing enabled.
If I disable email signing in 1 account, I see 1 dialog box less.

I am using IMAP on all my accounts.

Using: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090629 Shredder/3.1a1pre ID:20090629045558
My workaround for this bug is to
a) disable "Check for new messages at startup" on all accounts, and 
b) Do not click "Get Messages for Account" as the first action on an IMAP 
account after starting TB.  Always click on one of IMAP folders as the 
first act of using any IMAP server.  Then you get ONE master password dialog, 
after which you're in business and can do whatever you like.
Is the e-mail cert signing attribute set for other people seeing this problem?
I think the problem is that restoring the tabs, which we do at the very start of msgMail3PaneWindow's loadStartFolder(initialUri), can cause us to run updateFolder before we get to the code that preemptively tries to cause a master password prompt. I think we need to move the tab restoring code to after that...
Status: NEW → ASSIGNED
(In reply to comment #4)
> My workaround for this bug is to
> a) disable "Check for new messages at startup" on all accounts, and 
> b) Do not click "Get Messages for Account" as the first action on an IMAP 
> account after starting TB.  Always click on one of IMAP folders as the 
> first act of using any IMAP server.  Then you get ONE master password dialog, 
> after which you're in business and can do whatever you like.

While I am sure this works fine for email, I'd just like to point out that this problem is also tripped over with TB extensions like Lightning (where a workaround like this does not apply).

When I start TB, I get a master password prompt for each email account being checked at startup as well as each networked calendar.  On my home computer, that means 5 prompts while on my work computer, it is more like 9.

Note that the same issue actually happens with Firefox 3.5 as well.  If you have Firefox reopen tabs from the last session and have at least one tab set to a page where you have saved login/password information, you can get in a situation where more than one master password dialog opens.  I have Weave installed (always asks for a master password at startup) and ended up with two master password dialog windows this morning when I started up FF (one for Weave and the other for the tab being restored with saved login/password info).

It seems to me that the master password needs to be requested earlier in the startup process and be more aware if has already been asked for (and wait for the result instead of popping up yet another box!)
(In reply to comment #7)
> Note that the same issue actually happens with Firefox 3.5 as well.  If you
> have Firefox reopen tabs from the last session and have at least one tab set to
> a page where you have saved login/password information, you can get in a
> situation where more than one master password dialog opens.

This is exactly my situation. I have no mail accounts set up, I'm only using the browser. I have a nagios plug-in which needs a master password, and depending on which tabs get restored, I get more than one master password dialog box -- almost always two, sometimes more.
(In reply to comment #7)
> Note that the same issue actually happens with Firefox 3.5 as well.  If you
> have Firefox reopen tabs from the last session and have at least one tab set to
> a page where you have saved login/password information, you can get in a
> situation where more than one master password dialog opens.

We know about that - it is tracked in Firefox specific bugs.

(In reply to comment #7)
> While I am sure this works fine for email, I'd just like to point out that this
> problem is also tripped over with TB extensions like Lightning (where a
> workaround like this does not apply).

We know, we're working around this the best way we can. For beta 3 (coming soon) we're just re-instating what broke recently. Post beta 3 I'm hoping I can come up with a better fix for TB 3 which I'll be working on in bug 338549.

Post TB 3 I'm hoping that we can get some ways to fix this properly in the core code.
Attached patch proposed fix (obsolete) — Splinter Review
move up the prompting for the master password to before we restore the tabs. There is a slight change in the behavior in that we'll prompt for the master password even if we're not set to login at startup to the default server, but with tab restore, it's not worth figuring out if any of the tabs is going to cause a password prompt...especially if a more general solution might come in b4.
Attachment #386345 - Flags: review?(bugzilla)
this seems to break mozmill tests, though I think that's a problem with mozmill tests...

JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPK11T
oken.checkPassword]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://messenger/content/msgMail3PaneWindow.j
s :: loadStartFolder :: line 530"  data: no]
mozmill.startRunner :: True

I'll try adding a try...catch.
this gets around the mozmill issue as well (and in general, it's better not to let exceptions breaking loading the 3-pane ui).
Attachment #386345 - Attachment is obsolete: true
Attachment #386414 - Flags: review?(bugzilla)
Attachment #386345 - Flags: review?(bugzilla)
Comment on attachment 386414 [details] [diff] [review]
fix mozmill tests

r=Standard8. It is a little bit strange where we hook this in but if we can fix bug 338549 for final, then this is good enough for b3.
Attachment #386414 - Flags: review?(bugzilla) → review+
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
I am still seeing this bug with build id Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1pre) Gecko/20090705 Lightning/1.0pre Shredder/3.0b3pre ID:20090705031558

I get 5 master password prompts at startup.  I am thinking it is probably one master password for TB and four more for the four Lightning calendars I have.

If I am the only one seeing this with Lightning and the latest TB build, I'll fiddle some more but I'm guessing the master password prompt isn't being asked before extensions fire up.
(In reply to comment #16)
> If I am the only one seeing this with Lightning and the latest TB build, I'll
> fiddle some more but I'm guessing the master password prompt isn't being asked
> before extensions fire up.

The fixes I'm thinking about for bug 338549 should make the situation for extension better. However you comment is actually bug 349641.
Well, I don't run Lightning. So fortunately my problem is resolved again. Thanks!
You need to log in before you can comment on or make changes to this bug.