Bug 1516208 - Part 1: Remove obsolete permissions from permission database. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sun, 06 Jan 2019 23:21:44 +0100
changeset 34129 c4e9d5d849401bd1ac7a5e8fe2370de21bfd304d
parent 34128 4b28c50a8eea1b1bfb84ddbedd53f4b0be92251a
child 34130 3bad8af89b0e7cfac1a4d109b37dea0c9ea023fe
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersIanN
bugs1516208
Bug 1516208 - Part 1: Remove obsolete permissions from permission database. r=IanN
suite/components/nsSuiteGlue.js
--- a/suite/components/nsSuiteGlue.js
+++ b/suite/components/nsSuiteGlue.js
@@ -388,17 +388,17 @@ SuiteGlue.prototype = {
 
     var timer = Cc["@mozilla.org/timer;1"]
                   .createInstance(Ci.nsITimer);
     timer.init(this, 3000, timer.TYPE_ONE_SHOT);
   },
 
   _migrateUI: function()
   {
-    const UI_VERSION = 5;
+    const UI_VERSION = 6;
 
     // If the pref is not set this is a new or pre SeaMonkey 2.49 profile.
     // We can't tell so we just run migration with version 0.
     let currentUIVersion = 0;
 
     if (Services.prefs.prefHasUserValue("suite.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("suite.migration.version");
     }
@@ -463,17 +463,17 @@ SuiteGlue.prototype = {
       try {
         if (!Services.prefs.getBoolPref("browser.safebrowsing.enabled")) {
           Services.prefs.setBoolPref("browser.safebrowsing.phishing.enabled", false);
           Services.prefs.clearUserPref("browser.safebrowsing.enabled");
         }
       } catch (ex) {}
     }
 
-    // Pretend currentUIVersion 3 never happend (used in 2.57 for a time and became 5).
+    // Pretend currentUIVersion 3 never happend (used in 2.57 for a time and became 6).
 
     // Remove obsolete download preferences set by user.
     if (currentUIVersion < 4) {
       try {
         if (Services.prefs.prefHasUserValue("browser.download.manager.showAlertOnComplete")) {
           Services.prefs.clearUserPref("browser.download.manager.showAlertOnComplete");
         }
         if (Services.prefs.prefHasUserValue("browser.download.manager.showAlertInterval")) {
@@ -492,24 +492,35 @@ SuiteGlue.prototype = {
           Services.prefs.clearUserPref("browser.download.manager.showWhenStarting");
         }
         if (Services.prefs.prefHasUserValue("browser.download.manager.closeWhenDone")) {
           Services.prefs.clearUserPref("browser.download.manager.closeWhenDone");
         }
       } catch (ex) {}
     }
 
-    // The XUL directory viewer is no longer provided.
-    if (currentUIVersion < 5) {
+    if (currentUIVersion < 6) {
+      // Delete obsolete ssl and strict transport security permissions.
+      let perms = Services.perms.enumerator;
+      while (perms.hasMoreElements()) {
+        let perm = perms.getNext();
+        if (perm.type == "falsestart-rc4" ||
+            perm.type == "falsestart-rsa" ||
+            perm.type == "sts/use" ||
+            perm.type == "sts/subd") {
+          Services.perms.removePermission(perm);
+        }
+      }
+
+      // The XUL directory viewer is no longer provided.
       try {
         if (Services.prefs.getIntPref("network.dir.format") == 3) {
           Services.prefs.setIntPref("network.dir.format", 2);
         }
       } catch (ex) {}
-
     }
 
     // Update the migration version.
     Services.prefs.setIntPref("suite.migration.version", UI_VERSION);
   },
 
   // Copies additional profile files from the default profile tho the current profile.
   // Only files not covered by the regular profile creation process.