From 4c0050fc15e35cb0285060611fddd4c05e4b61a9 Mon Sep 17 00:00:00 2001 From: Paul O'Shannessy Date: Fri, 8 Aug 2008 16:04:27 -0700 Subject: [PATCH] =?UTF-8?q?Bug=20449810=20=E2=80=93=20legacy=20storage=20m?= =?UTF-8?q?odule=20should=20throw=20on=20canceled=20master=20password=20en?= =?UTF-8?q?try=20in=20getAllLogins.=20r=3Ddolske?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passwordmgr/content/passwordManager.js | 15 ++++++++++++--- .../components/passwordmgr/src/storage-Legacy.js | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index 843f0cad344d..a577a719a22c 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -97,7 +97,11 @@ var signonsTreeView = { function LoadSignons() { // loads signons into table - signons = passwordmanager.getAllLogins({}); + try { + signons = passwordmanager.getAllLogins({}); + } catch (e) { + signons = []; + } signonsTreeView.rowCount = signons.length; // sort and display the table @@ -204,8 +208,13 @@ function FinalizeSignonDeletions(syncNeeded) { } // If the deletion has been performed in a filtered view, reflect the deletion in the unfiltered table. // See bug 405389. - if (syncNeeded) - signons = passwordmanager.getAllLogins({}); + if (syncNeeded) { + try { + signons = passwordmanager.getAllLogins({}); + } catch (e) { + signons = []; + } + } deletedSignons.length = 0; } diff --git a/toolkit/components/passwordmgr/src/storage-Legacy.js b/toolkit/components/passwordmgr/src/storage-Legacy.js index 0932335a7834..3d756701855a 100644 --- a/toolkit/components/passwordmgr/src/storage-Legacy.js +++ b/toolkit/components/passwordmgr/src/storage-Legacy.js @@ -316,6 +316,9 @@ LoginManagerStorage_legacy.prototype = { // decrypt entries for caller. [result, userCanceled] = this._decryptLogins(result); + if (userCanceled) + throw "User canceled Master Password entry"; + count.value = result.length; // needed for XPCOM return result; },