Bug 1903606 - Prevent recovery from backups created from an application with a different appName. r=backup-reviewers,sthompson,kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D215002
This commit is contained in:
Mike Conley
2024-06-28 15:50:30 +00:00
parent d3edaeb47b
commit b420e6f986
4 changed files with 76 additions and 0 deletions

View File

@@ -2085,6 +2085,12 @@ export class BackupService extends EventTarget {
let meta = manifest.meta;
if (meta.appName != AppConstants.MOZ_APP_NAME) {
throw new Error(
`Cannot recover a backup from ${meta.appName} in ${AppConstants.MOZ_APP_NAME}`
);
}
// Okay, we have a valid backup-manifest.json. Let's create a new profile
// and start invoking the recover() method on each BackupResource.
let profileSvc = Cc["@mozilla.org/toolkit/profile-service;1"].getService(