Bug 409915 - Logins stored by extensions could be converted to site logins by 2E upgrade. r=gavin, a=blocking-ff3+
git-svn-id: svn://10.0.0.236/trunk@243331 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -582,6 +582,14 @@ LoginManagerStorage_legacy.prototype = {
|
||||
if (aLogin.hostname.indexOf("://") == -1) {
|
||||
var oldHost = aLogin.hostname;
|
||||
|
||||
// Check for a trailing port number, EG "site.com:80". If there's
|
||||
// no port, it wasn't saved by the browser and is probably some
|
||||
// arbitrary string picked by an extension.
|
||||
if (!/:\d+$/.test(aLogin.hostname)) {
|
||||
this.log("2E upgrade: no port, skipping " + aLogin.hostname);
|
||||
return upgradedLogins;
|
||||
}
|
||||
|
||||
// Parse out "host:port".
|
||||
try {
|
||||
// Small hack: Need a scheme for nsIURI, so just prepend http.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#2d
|
||||
.
|
||||
eBay.companion.paypal.guard
|
||||
|
||||
MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECNePtPzgmj5LBAhTfGF4EdqA/A==
|
||||
*
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECGqjM6mOKO/5BBCj4F1AP8q3uRv+nZBEo2UT
|
||||
|
||||
.
|
||||
eBay.companion.ebay.guard
|
||||
|
||||
MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECPt4wsEg6r7qBAiJSTMiFBk7dw==
|
||||
*
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECNWeFfM4ZZ+ZBBD/lkgrrRXLM7kLfg4fPAn1
|
||||
|
||||
.
|
||||
@@ -374,6 +374,20 @@ LoginTest.initStorage(storage, INDIR, "signons-2d-09.txt");
|
||||
LoginTest.checkStorageData(storage, [], [testuser1, testuser2]);
|
||||
|
||||
|
||||
/* ========== 20 ========== */
|
||||
testnum++;
|
||||
testdesc = "Initialize with signons-2d-10.txt";
|
||||
// Extensions like the eBay Companion just use an arbitrary string for the
|
||||
// hostname. We don't want to change the format of these logins.
|
||||
|
||||
testuser1.init("eBay.companion.paypal.guard", "", null,
|
||||
"p", "paypalpass", "", "");
|
||||
testuser2.init("eBay.companion.ebay.guard", "", null,
|
||||
"p", "ebaypass", "", "");
|
||||
LoginTest.initStorage(storage, INDIR, "signons-2d-10.txt");
|
||||
LoginTest.checkStorageData(storage, [], [testuser1, testuser2]);
|
||||
|
||||
|
||||
} catch (e) {
|
||||
throw "FAILED in test #" + testnum + " -- " + testdesc + ": " + e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user