Bug 833659 - REINSTALL_FORBIDDEN error isn't triggering when installing a packaged app with a mini-manifest off of X origin when a hosted app was already installed from X origin r=ferjm
authorFabrice Desré <fabrice@mozilla.com>
Thu, 24 Jan 2013 18:24:17 -0800
changeset 119838 de3a78d90afa8d7875798c8eba791dcffd815aaf
parent 119837 ec3d263e24784f137ca1c8e27ca4af1cc84946dd
child 119839 91a8133741df215f8d02fb8b4ae003f6996f7aaa
push id21901
push userfdesre@mozilla.com
push dateFri, 25 Jan 2013 02:24:26 +0000
treeherdermozilla-inbound@de3a78d90afa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersferjm
bugs833659
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 833659 - REINSTALL_FORBIDDEN error isn't triggering when installing a packaged app with a mini-manifest off of X origin when a hosted app was already installed from X origin r=ferjm
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -1630,17 +1630,18 @@ this.DOMApplicationRegistry = {
       aMm.sendAsyncMessage("Webapps:Install:Return:KO", aData);
       Cu.reportError("Error installing packaged app from: " +
                      app.installOrigin + ": " + aError);
     }.bind(this);
 
     // Disallow reinstalls from the same manifest URL for now.
     // See https://bugzilla.mozilla.org/show_bug.cgi?id=821288
     if (this.getAppLocalIdByManifestURL(app.manifestURL) !==
-        Ci.nsIScriptSecurityManager.NO_APP_ID) {
+        Ci.nsIScriptSecurityManager.NO_APP_ID ||
+        this._appId(app.origin) !== null) {
       sendError("REINSTALL_FORBIDDEN");
       return;
     }
 
     let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
                 .createInstance(Ci.nsIXMLHttpRequest);
     xhr.open("GET", app.manifestURL, true);
     xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;