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 33275 c4e9d5d84940
parent 33274 4b28c50a8eea
child 33276 3bad8af89b0e
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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.