mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset c86a7dad496a (bug 967047) - only had f+, not r+
This commit is contained in:
parent
1941576303
commit
56febfb79d
@ -237,7 +237,8 @@ this.BrowserIDManager.prototype = {
|
||||
* username is derived from account.
|
||||
*
|
||||
* Changing the account name has the side-effect of wiping out stored
|
||||
* credentials.
|
||||
* credentials. Keep in mind that persistCredentials() will need to be called
|
||||
* to flush the changes to disk.
|
||||
*
|
||||
* Set this value to null to clear out identity information.
|
||||
*/
|
||||
|
@ -40,31 +40,18 @@ PasswordEngine.prototype = {
|
||||
SyncEngine.prototype._syncFinish.call(this);
|
||||
|
||||
// Delete the weave credentials from the server once
|
||||
if (!Svc.Prefs.get("deletePwdFxA", false)) {
|
||||
if (!Svc.Prefs.get("deletePwd", false)) {
|
||||
try {
|
||||
let ids = [];
|
||||
for (let host of Utils.getSyncCredentialsHosts()) {
|
||||
for (let info of Services.logins.findLogins({}, host, "", "")) {
|
||||
ids.push(info.QueryInterface(Components.interfaces.nsILoginMetaInfo).guid);
|
||||
}
|
||||
}
|
||||
let clearPref;
|
||||
if (ids.length) {
|
||||
let coll = new Collection(this.engineURL, null, this.service);
|
||||
coll.ids = ids;
|
||||
let ret = coll.delete();
|
||||
this._log.debug("Delete result: " + ret);
|
||||
// Anything other than success or 400 means we'll try again later.
|
||||
clearPref = ret.success || ret.status == 400;
|
||||
} else {
|
||||
this._log.debug("Didn't find any passwords to delete");
|
||||
clearPref = true;
|
||||
}
|
||||
if (clearPref) {
|
||||
Svc.Prefs.set("deletePwdFxA", true);
|
||||
// And delete the old prefname we previously used.
|
||||
Svc.Prefs.reset("deletePwd");
|
||||
}
|
||||
let ids = Services.logins.findLogins({}, PWDMGR_HOST, "", "")
|
||||
.map(function(info) {
|
||||
return info.QueryInterface(Components.interfaces.nsILoginMetaInfo).guid;
|
||||
});
|
||||
let coll = new Collection(this.engineURL, null, this.service);
|
||||
coll.ids = ids;
|
||||
let ret = coll.delete();
|
||||
this._log.debug("Delete result: " + ret);
|
||||
|
||||
Svc.Prefs.set("deletePwd", true);
|
||||
}
|
||||
catch(ex) {
|
||||
this._log.debug("Password deletes failed: " + Utils.exceptionStr(ex));
|
||||
@ -163,9 +150,8 @@ PasswordStore.prototype = {
|
||||
for (let i = 0; i < logins.length; i++) {
|
||||
// Skip over Weave password/passphrase entries
|
||||
let metaInfo = logins[i].QueryInterface(Ci.nsILoginMetaInfo);
|
||||
if (Utils.getSyncCredentialsHosts().has(metaInfo.hostname)) {
|
||||
if (metaInfo.hostname == PWDMGR_HOST)
|
||||
continue;
|
||||
}
|
||||
|
||||
items[metaInfo.guid] = metaInfo;
|
||||
}
|
||||
@ -302,7 +288,7 @@ PasswordTracker.prototype = {
|
||||
case "removeLogin":
|
||||
// Skip over Weave password/passphrase changes.
|
||||
subject.QueryInterface(Ci.nsILoginMetaInfo).QueryInterface(Ci.nsILoginInfo);
|
||||
if (Utils.getSyncCredentialsHosts().has(subject.hostname)) {
|
||||
if (subject.hostname == PWDMGR_HOST) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -448,11 +448,9 @@ IdentityManager.prototype = {
|
||||
* Deletes Sync credentials from the password manager.
|
||||
*/
|
||||
deleteSyncCredentials: function deleteSyncCredentials() {
|
||||
for (let host of Utils.getSyncCredentialsHosts()) {
|
||||
let logins = Services.logins.findLogins({}, host, "", "");
|
||||
for each (let login in logins) {
|
||||
Services.logins.removeLogin(login);
|
||||
}
|
||||
let logins = Services.logins.findLogins({}, PWDMGR_HOST, "", "");
|
||||
for each (let login in logins) {
|
||||
Services.logins.removeLogin(login);
|
||||
}
|
||||
|
||||
// Wait until after store is updated in case it fails.
|
||||
|
@ -601,34 +601,6 @@ this.Utils = {
|
||||
return Math.max(Math.min(backoffInterval, MAXIMUM_BACKOFF_INTERVAL),
|
||||
statusInterval);
|
||||
},
|
||||
|
||||
/**
|
||||
* Return a set of hostnames (including the protocol) which may have
|
||||
* credentials for sync itself stored in the login manager.
|
||||
*
|
||||
* In general, these hosts will not have their passwords synced, will be
|
||||
* reset when we drop sync credentials, etc.
|
||||
*/
|
||||
getSyncCredentialsHosts: function() {
|
||||
let result = new Set();
|
||||
// the legacy sync host.
|
||||
result.add(PWDMGR_HOST);
|
||||
// The FxA hosts - these almost certainly all have the same hostname, but
|
||||
// better safe than sorry...
|
||||
for (let prefName of ["identity.fxaccounts.remote.force_auth.uri",
|
||||
"identity.fxaccounts.remote.uri",
|
||||
"identity.fxaccounts.settings.uri"]) {
|
||||
let prefVal;
|
||||
try {
|
||||
prefVal = Services.prefs.getCharPref(prefName);
|
||||
} catch (_) {
|
||||
continue;
|
||||
}
|
||||
let uri = Services.io.newURI(prefVal, null, null);
|
||||
result.add(uri.prePath);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
};
|
||||
|
||||
XPCOMUtils.defineLazyGetter(Utils, "_utf8Converter", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user