Bug 545701 - explicitly exclude Weave password/passphrase from pw sync

Don't include weave passwords when getting all ids and ignore their changes.
This commit is contained in:
Edward Lee 2010-02-11 15:05:22 -08:00
Родитель 97e3689b91
Коммит c3a6abad27
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -41,6 +41,7 @@ const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
Cu.import("resource://weave/constants.js");
Cu.import("resource://weave/util.js");
Cu.import("resource://weave/engines.js");
Cu.import("resource://weave/stores.js");
@ -124,7 +125,11 @@ PasswordStore.prototype = {
let logins = Svc.Login.getAllLogins({});
for (let i = 0; i < logins.length; i++) {
// Skip over Weave password/passphrase entries
let metaInfo = logins[i].QueryInterface(Ci.nsILoginMetaInfo);
if (metaInfo.hostname == PWDMGR_HOST)
continue;
items[metaInfo.guid] = metaInfo;
}
@ -236,7 +241,12 @@ PasswordTracker.prototype = {
queryElementAt(1, Ci.nsILoginMetaInfo);
case 'addLogin':
case 'removeLogin':
aSubject.QueryInterface(Ci.nsILoginMetaInfo);
// Skip over Weave password/passphrase changes
aSubject.QueryInterface(Ci.nsILoginMetaInfo).
QueryInterface(Ci.nsILoginInfo);
if (aSubject.hostname == PWDMGR_HOST)
break;
this.score += 15;
this._log.trace(aData + ": " + aSubject.guid);
this.addChangedID(aSubject.guid);